* [PATCH 0/2] cpu_logical_map updates for newly merged platforms @ 2011-11-08 14:34 Will Deacon 2011-11-08 14:34 ` [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers Will Deacon 2011-11-08 14:34 ` [PATCH 2/2] ARM: highbank: " Will Deacon 0 siblings, 2 replies; 11+ messages in thread From: Will Deacon @ 2011-11-08 14:34 UTC (permalink / raw) To: linux-arm-kernel It looks like mach-imx and highbank were recently merged and, as such, still refer to logical CPU numbers when interacting directly with hardware. These two patches should address that, but I'm unable to take them for a spin (all highbank donations welcome :). Will Deacon (2): ARM: mach-imx: convert logical CPU numbers to physical numbers ARM: highbank: convert logical CPU numbers to physical numbers arch/arm/mach-highbank/highbank.c | 2 ++ arch/arm/mach-imx/src.c | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) -- 1.7.4.1 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-08 14:34 [PATCH 0/2] cpu_logical_map updates for newly merged platforms Will Deacon @ 2011-11-08 14:34 ` Will Deacon 2011-11-11 9:29 ` Sascha Hauer 2011-11-08 14:34 ` [PATCH 2/2] ARM: highbank: " Will Deacon 1 sibling, 1 reply; 11+ messages in thread From: Will Deacon @ 2011-11-08 14:34 UTC (permalink / raw) To: linux-arm-kernel This patch uses the new cpu_logical_map() macro for converting logical CPU numbers into physical numbers when releasing CPUs during the SMP boot and CPU hotplug paths. Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com> --- arch/arm/mach-imx/src.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c index 36cacbd..63ba593 100644 --- a/arch/arm/mach-imx/src.c +++ b/arch/arm/mach-imx/src.c @@ -14,6 +14,7 @@ #include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/smp.h> #include <asm/unified.h> #define SRC_SCR 0x000 @@ -27,6 +28,7 @@ void imx_enable_cpu(int cpu, bool enable) { u32 mask, val; + cpu = cpu_logical_map(cpu); mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1); val = readl_relaxed(src_base + SRC_SCR); val = enable ? val | mask : val & ~mask; @@ -35,6 +37,7 @@ void imx_enable_cpu(int cpu, bool enable) void imx_set_cpu_jump(int cpu, void *jump_addr) { + cpu = cpu_logical_map(cpu); writel_relaxed(BSYM(virt_to_phys(jump_addr)), src_base + SRC_GPR1 + cpu * 8); } -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-08 14:34 ` [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers Will Deacon @ 2011-11-11 9:29 ` Sascha Hauer 2011-11-11 10:08 ` Will Deacon 0 siblings, 1 reply; 11+ messages in thread From: Sascha Hauer @ 2011-11-11 9:29 UTC (permalink / raw) To: linux-arm-kernel On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > This patch uses the new cpu_logical_map() macro for converting logical > CPU numbers into physical numbers when releasing CPUs during the SMP > boot and CPU hotplug paths. Shawn, is this one ok? Sascha > > Cc: Sascha Hauer <s.hauer@pengutronix.de> > Cc: Shawn Guo <shawn.guo@linaro.org> > Signed-off-by: Will Deacon <will.deacon@arm.com> > --- > arch/arm/mach-imx/src.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c > index 36cacbd..63ba593 100644 > --- a/arch/arm/mach-imx/src.c > +++ b/arch/arm/mach-imx/src.c > @@ -14,6 +14,7 @@ > #include <linux/io.h> > #include <linux/of.h> > #include <linux/of_address.h> > +#include <linux/smp.h> > #include <asm/unified.h> > > #define SRC_SCR 0x000 > @@ -27,6 +28,7 @@ void imx_enable_cpu(int cpu, bool enable) > { > u32 mask, val; > > + cpu = cpu_logical_map(cpu); > mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1); > val = readl_relaxed(src_base + SRC_SCR); > val = enable ? val | mask : val & ~mask; > @@ -35,6 +37,7 @@ void imx_enable_cpu(int cpu, bool enable) > > void imx_set_cpu_jump(int cpu, void *jump_addr) > { > + cpu = cpu_logical_map(cpu); > writel_relaxed(BSYM(virt_to_phys(jump_addr)), > src_base + SRC_GPR1 + cpu * 8); > } > -- > 1.7.4.1 > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-11 9:29 ` Sascha Hauer @ 2011-11-11 10:08 ` Will Deacon 2011-11-11 10:56 ` Will Deacon 0 siblings, 1 reply; 11+ messages in thread From: Will Deacon @ 2011-11-11 10:08 UTC (permalink / raw) To: linux-arm-kernel On Fri, Nov 11, 2011 at 09:29:25AM +0000, Sascha Hauer wrote: > On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > > This patch uses the new cpu_logical_map() macro for converting logical > > CPU numbers into physical numbers when releasing CPUs during the SMP > > boot and CPU hotplug paths. > > Shawn, is this one ok? I reckon I need to post a v2 because this probably breaks when !SMP. Will ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-11 10:08 ` Will Deacon @ 2011-11-11 10:56 ` Will Deacon 2011-11-11 13:07 ` Shawn Guo 0 siblings, 1 reply; 11+ messages in thread From: Will Deacon @ 2011-11-11 10:56 UTC (permalink / raw) To: linux-arm-kernel On Fri, Nov 11, 2011 at 10:08:00AM +0000, Will Deacon wrote: > On Fri, Nov 11, 2011 at 09:29:25AM +0000, Sascha Hauer wrote: > > On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > > > This patch uses the new cpu_logical_map() macro for converting logical > > > CPU numbers into physical numbers when releasing CPUs during the SMP > > > boot and CPU hotplug paths. > > > > Shawn, is this one ok? > > I reckon I need to post a v2 because this probably breaks when !SMP. Actually, I take that back. Looks like the function is only used by hotplug.c and platsmp.c, both of which depend on CONFIG_SMP. So yes, comments from Shawn would be great. Will ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-11 10:56 ` Will Deacon @ 2011-11-11 13:07 ` Shawn Guo 2011-11-11 13:41 ` Will Deacon 0 siblings, 1 reply; 11+ messages in thread From: Shawn Guo @ 2011-11-11 13:07 UTC (permalink / raw) To: linux-arm-kernel On Fri, Nov 11, 2011 at 10:56:07AM +0000, Will Deacon wrote: > On Fri, Nov 11, 2011 at 10:08:00AM +0000, Will Deacon wrote: > > On Fri, Nov 11, 2011 at 09:29:25AM +0000, Sascha Hauer wrote: > > > On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > > > > This patch uses the new cpu_logical_map() macro for converting logical > > > > CPU numbers into physical numbers when releasing CPUs during the SMP > > > > boot and CPU hotplug paths. > > > > > > Shawn, is this one ok? > > > > I reckon I need to post a v2 because this probably breaks when !SMP. > > Actually, I take that back. Looks like the function is only used by > hotplug.c and platsmp.c, both of which depend on CONFIG_SMP. > But the build of src.c does not depend on CONFIG_SMP. So when building with no CONFIG_SMP, we get: CC arch/arm/mach-imx/src.o arch/arm/mach-imx/src.c: In function ?imx_enable_cpu?: arch/arm/mach-imx/src.c:31:2: error: implicit declaration of function ?cpu_logical_map? make[2]: *** [arch/arm/mach-imx/src.o] Error 1 make[1]: *** [arch/arm/mach-imx] Error 2 -- Regards, Shawn ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-11 13:07 ` Shawn Guo @ 2011-11-11 13:41 ` Will Deacon 2011-11-11 23:07 ` Shawn Guo 0 siblings, 1 reply; 11+ messages in thread From: Will Deacon @ 2011-11-11 13:41 UTC (permalink / raw) To: linux-arm-kernel On Fri, Nov 11, 2011 at 01:07:02PM +0000, Shawn Guo wrote: > On Fri, Nov 11, 2011 at 10:56:07AM +0000, Will Deacon wrote: > > On Fri, Nov 11, 2011 at 10:08:00AM +0000, Will Deacon wrote: > > > On Fri, Nov 11, 2011 at 09:29:25AM +0000, Sascha Hauer wrote: > > > > On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > > > > > This patch uses the new cpu_logical_map() macro for converting logical > > > > > CPU numbers into physical numbers when releasing CPUs during the SMP > > > > > boot and CPU hotplug paths. > > > > > > > > Shawn, is this one ok? > > > > > > I reckon I need to post a v2 because this probably breaks when !SMP. > > > > Actually, I take that back. Looks like the function is only used by > > hotplug.c and platsmp.c, both of which depend on CONFIG_SMP. > > > But the build of src.c does not depend on CONFIG_SMP. So when building > with no CONFIG_SMP, we get: > > CC arch/arm/mach-imx/src.o > arch/arm/mach-imx/src.c: In function ?imx_enable_cpu?: > arch/arm/mach-imx/src.c:31:2: error: implicit declaration of function ?cpu_logical_map? > make[2]: *** [arch/arm/mach-imx/src.o] Error 1 > make[1]: *** [arch/arm/mach-imx] Error 2 Ok, then maybe we should #ifdef CONFIG_SMP that function entirely. If that sounds ok, I can post a v2. Will ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers 2011-11-11 13:41 ` Will Deacon @ 2011-11-11 23:07 ` Shawn Guo 0 siblings, 0 replies; 11+ messages in thread From: Shawn Guo @ 2011-11-11 23:07 UTC (permalink / raw) To: linux-arm-kernel On Fri, Nov 11, 2011 at 01:41:35PM +0000, Will Deacon wrote: > On Fri, Nov 11, 2011 at 01:07:02PM +0000, Shawn Guo wrote: > > On Fri, Nov 11, 2011 at 10:56:07AM +0000, Will Deacon wrote: > > > On Fri, Nov 11, 2011 at 10:08:00AM +0000, Will Deacon wrote: > > > > On Fri, Nov 11, 2011 at 09:29:25AM +0000, Sascha Hauer wrote: > > > > > On Tue, Nov 08, 2011 at 02:34:53PM +0000, Will Deacon wrote: > > > > > > This patch uses the new cpu_logical_map() macro for converting logical > > > > > > CPU numbers into physical numbers when releasing CPUs during the SMP > > > > > > boot and CPU hotplug paths. > > > > > > > > > > Shawn, is this one ok? > > > > > > > > I reckon I need to post a v2 because this probably breaks when !SMP. > > > > > > Actually, I take that back. Looks like the function is only used by > > > hotplug.c and platsmp.c, both of which depend on CONFIG_SMP. > > > > > But the build of src.c does not depend on CONFIG_SMP. So when building > > with no CONFIG_SMP, we get: > > > > CC arch/arm/mach-imx/src.o > > arch/arm/mach-imx/src.c: In function ?imx_enable_cpu?: > > arch/arm/mach-imx/src.c:31:2: error: implicit declaration of function ?cpu_logical_map? > > make[2]: *** [arch/arm/mach-imx/src.o] Error 1 > > make[1]: *** [arch/arm/mach-imx] Error 2 > > Ok, then maybe we should #ifdef CONFIG_SMP that function entirely. If that > sounds ok, I can post a v2. > Yes for imx_enable_cpu(), and no for imx_set_cpu_jump() as it's being called by pm-imx6q.c as well. And I would suggest just wrap #ifdef cpu_logical_map, as these two functions are exported in arch/arm/plat-mxc/include/mach/common.h for !SMP users too. -- Regards, Shawn ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] ARM: highbank: convert logical CPU numbers to physical numbers 2011-11-08 14:34 [PATCH 0/2] cpu_logical_map updates for newly merged platforms Will Deacon 2011-11-08 14:34 ` [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers Will Deacon @ 2011-11-08 14:34 ` Will Deacon 2011-11-08 15:59 ` Rob Herring 1 sibling, 1 reply; 11+ messages in thread From: Will Deacon @ 2011-11-08 14:34 UTC (permalink / raw) To: linux-arm-kernel This patch uses the new cpu_logical_map() macro for converting logical CPU numbers into physical numbers when releasing CPUs during the SMP boot and CPU hotplug paths. Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Will Deacon <will.deacon@arm.com> --- arch/arm/mach-highbank/highbank.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index b82dcf0..a6cdc27 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -22,6 +22,7 @@ #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/of_address.h> +#include <linux/smp.h> #include <asm/cacheflush.h> #include <asm/unified.h> @@ -72,6 +73,7 @@ static void __init highbank_map_io(void) void highbank_set_cpu_jump(int cpu, void *jump_addr) { + cpu = cpu_logical_map(cpu); writel(BSYM(virt_to_phys(jump_addr)), HB_JUMP_TABLE_VIRT(cpu)); __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16); outer_clean_range(HB_JUMP_TABLE_PHYS(cpu), -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] ARM: highbank: convert logical CPU numbers to physical numbers 2011-11-08 14:34 ` [PATCH 2/2] ARM: highbank: " Will Deacon @ 2011-11-08 15:59 ` Rob Herring 2011-11-08 16:10 ` Will Deacon 0 siblings, 1 reply; 11+ messages in thread From: Rob Herring @ 2011-11-08 15:59 UTC (permalink / raw) To: linux-arm-kernel On 11/08/2011 08:34 AM, Will Deacon wrote: > This patch uses the new cpu_logical_map() macro for converting logical > CPU numbers into physical numbers when releasing CPUs during the SMP > boot and CPU hotplug paths. > > Cc: Rob Herring <rob.herring@calxeda.com> > Signed-off-by: Will Deacon <will.deacon@arm.com> > --- > arch/arm/mach-highbank/highbank.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c > index b82dcf0..a6cdc27 100644 > --- a/arch/arm/mach-highbank/highbank.c > +++ b/arch/arm/mach-highbank/highbank.c > @@ -22,6 +22,7 @@ > #include <linux/of_irq.h> > #include <linux/of_platform.h> > #include <linux/of_address.h> > +#include <linux/smp.h> > > #include <asm/cacheflush.h> > #include <asm/unified.h> > @@ -72,6 +73,7 @@ static void __init highbank_map_io(void) > > void highbank_set_cpu_jump(int cpu, void *jump_addr) > { > + cpu = cpu_logical_map(cpu); This doesn't build for !CONFIG_SMP. It's possible to want to do this for core 0 in the cpuidle case. Rob > writel(BSYM(virt_to_phys(jump_addr)), HB_JUMP_TABLE_VIRT(cpu)); > __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16); > outer_clean_range(HB_JUMP_TABLE_PHYS(cpu), ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] ARM: highbank: convert logical CPU numbers to physical numbers 2011-11-08 15:59 ` Rob Herring @ 2011-11-08 16:10 ` Will Deacon 0 siblings, 0 replies; 11+ messages in thread From: Will Deacon @ 2011-11-08 16:10 UTC (permalink / raw) To: linux-arm-kernel Hi Rob, On Tue, Nov 08, 2011 at 03:59:17PM +0000, Rob Herring wrote: > On 11/08/2011 08:34 AM, Will Deacon wrote: > > This patch uses the new cpu_logical_map() macro for converting logical > > CPU numbers into physical numbers when releasing CPUs during the SMP > > boot and CPU hotplug paths. > > > > Cc: Rob Herring <rob.herring@calxeda.com> > > Signed-off-by: Will Deacon <will.deacon@arm.com> > > --- > > arch/arm/mach-highbank/highbank.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c > > index b82dcf0..a6cdc27 100644 > > --- a/arch/arm/mach-highbank/highbank.c > > +++ b/arch/arm/mach-highbank/highbank.c > > @@ -22,6 +22,7 @@ > > #include <linux/of_irq.h> > > #include <linux/of_platform.h> > > #include <linux/of_address.h> > > +#include <linux/smp.h> > > > > #include <asm/cacheflush.h> > > #include <asm/unified.h> > > @@ -72,6 +73,7 @@ static void __init highbank_map_io(void) > > > > void highbank_set_cpu_jump(int cpu, void *jump_addr) > > { > > + cpu = cpu_logical_map(cpu); > > This doesn't build for !CONFIG_SMP. It's possible to want to do this for > core 0 in the cpuidle case. Damn, I suspect I have the same problem with the imx code. Although it would be nice to fix this inside of cpu_logical_map, I can't see a way to do that without moving it into a different header file (which?), so I think the best option is to ifdef at the point of use. I'll throw a v2 your way this week. Will ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-11-11 23:07 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-08 14:34 [PATCH 0/2] cpu_logical_map updates for newly merged platforms Will Deacon 2011-11-08 14:34 ` [PATCH 1/2] ARM: mach-imx: convert logical CPU numbers to physical numbers Will Deacon 2011-11-11 9:29 ` Sascha Hauer 2011-11-11 10:08 ` Will Deacon 2011-11-11 10:56 ` Will Deacon 2011-11-11 13:07 ` Shawn Guo 2011-11-11 13:41 ` Will Deacon 2011-11-11 23:07 ` Shawn Guo 2011-11-08 14:34 ` [PATCH 2/2] ARM: highbank: " Will Deacon 2011-11-08 15:59 ` Rob Herring 2011-11-08 16:10 ` Will Deacon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).