* [PATCH] ARM: tegra: add cpu_disable for hotplug
@ 2013-05-21 10:13 Joseph Lo
[not found] ` <1369131215-2920-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Joseph Lo @ 2013-05-21 10:13 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Joseph Lo
The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't
support that. Adding a Tegra specific cpu_disable function for it.
Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
This patch depends on the series of "ARM: tegra114: add CPU hotplug support".
---
arch/arm/mach-tegra/common.h | 1 +
arch/arm/mach-tegra/hotplug.c | 10 ++++++++++
arch/arm/mach-tegra/platsmp.c | 1 +
3 files changed, 12 insertions(+)
diff --git a/arch/arm/mach-tegra/common.h b/arch/arm/mach-tegra/common.h
index 5900cc4..32f8eb3 100644
--- a/arch/arm/mach-tegra/common.h
+++ b/arch/arm/mach-tegra/common.h
@@ -2,3 +2,4 @@ extern struct smp_operations tegra_smp_ops;
extern int tegra_cpu_kill(unsigned int cpu);
extern void tegra_cpu_die(unsigned int cpu);
+extern int tegra_cpu_disable(unsigned int cpu);
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index d07f152..9695b63 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -46,6 +46,16 @@ void __ref tegra_cpu_die(unsigned int cpu)
BUG();
}
+int tegra_cpu_disable(unsigned int cpu)
+{
+ switch (tegra_chip_id) {
+ case TEGRA114:
+ return 0;
+ default:
+ return cpu == 0 ? -EPERM : 0;
+ }
+}
+
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 554aedc..24db4ac 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -196,5 +196,6 @@ struct smp_operations tegra_smp_ops __initdata = {
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = tegra_cpu_kill,
.cpu_die = tegra_cpu_die,
+ .cpu_disable = tegra_cpu_disable,
#endif
};
--
1.8.2.2
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1369131215-2920-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] ARM: tegra: add cpu_disable for hotplug [not found] ` <1369131215-2920-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> @ 2013-05-21 16:15 ` Stephen Warren 2013-05-22 9:03 ` Peter De Schrijver 0 siblings, 1 reply; 5+ messages in thread From: Stephen Warren @ 2013-05-21 16:15 UTC (permalink / raw) To: Joseph Lo Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 05/21/2013 04:13 AM, Joseph Lo wrote: > The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't > support that. Adding a Tegra specific cpu_disable function for it. > > Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c > +int tegra_cpu_disable(unsigned int cpu) > +{ > + switch (tegra_chip_id) { > + case TEGRA114: > + return 0; > + default: > + return cpu == 0 ? -EPERM : 0; > + } > +} Do we expect all/most future chips to support hotplug of CPU0? Or at least, fewer chips to have the restriction than not? If so, it might be more forward-looking to write that as: if (tegra_chip_id == TEGRA30) return cpu == 0 ? -EPERM : 0; return 0; ? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: tegra: add cpu_disable for hotplug 2013-05-21 16:15 ` Stephen Warren @ 2013-05-22 9:03 ` Peter De Schrijver [not found] ` <20130522090304.GT21944-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Peter De Schrijver @ 2013-05-22 9:03 UTC (permalink / raw) To: Stephen Warren Cc: linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Joseph Lo On Tue, May 21, 2013 at 06:15:48PM +0200, Stephen Warren wrote: > On 05/21/2013 04:13 AM, Joseph Lo wrote: > > The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't > > support that. Adding a Tegra specific cpu_disable function for it. > > > > Signed-off-by: Joseph Lo <josephl@nvidia.com> > > > diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c > > > +int tegra_cpu_disable(unsigned int cpu) > > +{ > > + switch (tegra_chip_id) { > > + case TEGRA114: > > + return 0; > > + default: > > + return cpu == 0 ? -EPERM : 0; > > + } > > +} > > Do we expect all/most future chips to support hotplug of CPU0? Or at > least, fewer chips to have the restriction than not? If so, it might be Yes. I think we can safely assume future chips will support hotplugging CPU0. > more forward-looking to write that as: > > if (tegra_chip_id == TEGRA30) > return cpu == 0 ? -EPERM : 0; > Also Tegra20 doesn't support hotplugging CPU0? Cheers, Peter. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20130522090304.GT21944-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org>]
* Re: [PATCH] ARM: tegra: add cpu_disable for hotplug [not found] ` <20130522090304.GT21944-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org> @ 2013-05-22 21:18 ` Stephen Warren [not found] ` <519D363E.4000409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Stephen Warren @ 2013-05-22 21:18 UTC (permalink / raw) To: Peter De Schrijver Cc: Joseph Lo, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On 05/22/2013 03:03 AM, Peter De Schrijver wrote: > On Tue, May 21, 2013 at 06:15:48PM +0200, Stephen Warren wrote: >> On 05/21/2013 04:13 AM, Joseph Lo wrote: >>> The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't >>> support that. Adding a Tegra specific cpu_disable function for it. >>> >>> Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >> >>> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c >> >>> +int tegra_cpu_disable(unsigned int cpu) >>> +{ >>> + switch (tegra_chip_id) { >>> + case TEGRA114: >>> + return 0; >>> + default: >>> + return cpu == 0 ? -EPERM : 0; >>> + } >>> +} >> >> Do we expect all/most future chips to support hotplug of CPU0? Or at >> least, fewer chips to have the restriction than not? If so, it might be > > Yes. I think we can safely assume future chips will support hotplugging CPU0. > >> more forward-looking to write that as: >> >> if (tegra_chip_id == TEGRA30) >> return cpu == 0 ? -EPERM : 0; >> > > Also Tegra20 doesn't support hotplugging CPU0? Oh right, this isn't a Tegra30+ file. How about just inverting the switch so it doesn't need to change later: switch (tegra_chip_id) { case TEGRA20: case TEGRA30: return cpu == 0 ? -EPERM : 0; default: return 0; } ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <519D363E.4000409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH] ARM: tegra: add cpu_disable for hotplug [not found] ` <519D363E.4000409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2013-05-23 10:03 ` Joseph Lo 0 siblings, 0 replies; 5+ messages in thread From: Joseph Lo @ 2013-05-23 10:03 UTC (permalink / raw) To: Stephen Warren Cc: Peter De Schrijver, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Thu, 2013-05-23 at 05:18 +0800, Stephen Warren wrote: > On 05/22/2013 03:03 AM, Peter De Schrijver wrote: > > On Tue, May 21, 2013 at 06:15:48PM +0200, Stephen Warren wrote: > >> On 05/21/2013 04:13 AM, Joseph Lo wrote: > >>> The Tegra114 could hotplug the CPU0, but the common cpu_disable didn't > >>> support that. Adding a Tegra specific cpu_disable function for it. > >>> > >>> Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > >> > >>> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c > >> > >>> +int tegra_cpu_disable(unsigned int cpu) > >>> +{ > >>> + switch (tegra_chip_id) { > >>> + case TEGRA114: > >>> + return 0; > >>> + default: > >>> + return cpu == 0 ? -EPERM : 0; > >>> + } > >>> +} > >> > >> Do we expect all/most future chips to support hotplug of CPU0? Or at > >> least, fewer chips to have the restriction than not? If so, it might be > > > > Yes. I think we can safely assume future chips will support hotplugging CPU0. > > > >> more forward-looking to write that as: > >> > >> if (tegra_chip_id == TEGRA30) > >> return cpu == 0 ? -EPERM : 0; > >> > > > > Also Tegra20 doesn't support hotplugging CPU0? > > Oh right, this isn't a Tegra30+ file. How about just inverting the > switch so it doesn't need to change later: > > switch (tegra_chip_id) { > case TEGRA20: > case TEGRA30: > return cpu == 0 ? -EPERM : 0; > default: > return 0; > } > OK. Will update a newer version later. Thanks, Joseph ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-23 10:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21 10:13 [PATCH] ARM: tegra: add cpu_disable for hotplug Joseph Lo
[not found] ` <1369131215-2920-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-05-21 16:15 ` Stephen Warren
2013-05-22 9:03 ` Peter De Schrijver
[not found] ` <20130522090304.GT21944-Rysk9IDjsxmJz7etNGeUX8VPkgjIgRvpAL8bYrjMMd8@public.gmane.org>
2013-05-22 21:18 ` Stephen Warren
[not found] ` <519D363E.4000409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-05-23 10:03 ` Joseph Lo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox