Re: [PATCH] Remove CPU_32v6K dependencies in asm/spinlock.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15 January 2011 16:11, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> SMP requires at least the ARMv6K extensions to be present, so if we're
> running on SMP, the WFE and SEV instructions must be available.
>
> However, when we run on UP, the v6K extensions may not be available,
> and so we don't want WFE/SEV to be in the instruction stream. ÂUse the
> SMP alternatives infrastructure to replace these instructions with NOPs
> if we build for SMP but run on UP.
[...]
> --- a/arch/arm/include/asm/spinlock.h
> +++ b/arch/arm/include/asm/spinlock.h
> @@ -5,17 +5,36 @@
> Â#error SMP not supported on pre-ARMv6 CPUs
> Â#endif
>
> +/*
> + * sev and wfe are ARMv6K extensions. ÂUniprocessor ARMv6 may not have the K
> + * extensions, so when running on UP, we have to patch these instructions away.
> + */
> +#define ALT_SMP(smp, up) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> + Â Â Â "9998: Â" smp "\n" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> + Â Â Â " Â Â Â .pushsection \".alt.smp.init\", \"a\"\n" Â Â Â Â\
> +    "    .long  9998b\n"                Â\
> + Â Â Â " Â Â Â " up "\n" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
> + Â Â Â " Â Â Â .popsection\n"
> +
> +#ifdef CONFIG_THUMB2_KERNEL
> +#define SEV Â Â Â Â Â ÂALT_SMP("sev.w", "nop.w")
> +#define WFE(cond) Â Â ÂALT_SMP("wfe" cond ".w", "nop.w")
> +#else
> +#define SEV Â Â Â Â Â ÂALT_SMP("sev", "nop")
> +#define WFE(cond) Â Â ÂALT_SMP("wfe" cond, "nop")
> +#endif

In the SEV macro definition, can you also include the dsb? This
barrier is only there because of sev, otherwise we don't need it (we
have a dmb prior to releasing the lock).

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux