All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
@ 2017-11-29  8:21 ` Alexey Brodkin
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Brodkin @ 2017-11-29  8:21 UTC (permalink / raw)
  To: linux-snps-arc; +Cc: linux-kernel, Vineet Gupta, Alexey Brodkin

As of today we assumed that "machine_desc->init_per_cpu" calls
are only usable on SMP systems when we want to run some piece of
code on early boot for each and every core, I guess assumption was
we have "machine_desc->init_early" for single-core cases where
the one and only master core can do all the things.

But it turned out for platforms which might be both UP and SMP it
might be benificial to use "init_per_cpu" for both UP and SMP cases
with which we achieve 2 things simultaneously:
 1) Exactly the same one code will be used for UP&SMP for
    things required to be done on each an every core regardless if it's
    a master and the only core in UP system or any other slave core in SMP
    setup.
 1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 arch/arc/include/asm/mach_desc.h | 2 --
 arch/arc/kernel/irq.c            | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arc/include/asm/mach_desc.h b/arch/arc/include/asm/mach_desc.h
index c28e6c347b49..871f3cb16af9 100644
--- a/arch/arc/include/asm/mach_desc.h
+++ b/arch/arc/include/asm/mach_desc.h
@@ -34,9 +34,7 @@ struct machine_desc {
 	const char		*name;
 	const char		**dt_compat;
 	void			(*init_early)(void);
-#ifdef CONFIG_SMP
 	void			(*init_per_cpu)(unsigned int);
-#endif
 	void			(*init_machine)(void);
 	void			(*init_late)(void);
 
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
index 538b36afe89e..62b185057c04 100644
--- a/arch/arc/kernel/irq.c
+++ b/arch/arc/kernel/irq.c
@@ -31,10 +31,10 @@ void __init init_IRQ(void)
 	/* a SMP H/w block could do IPI IRQ request here */
 	if (plat_smp_ops.init_per_cpu)
 		plat_smp_ops.init_per_cpu(smp_processor_id());
+#endif
 
 	if (machine_desc->init_per_cpu)
 		machine_desc->init_per_cpu(smp_processor_id());
-#endif
 }
 
 /*
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
@ 2017-11-29  8:21 ` Alexey Brodkin
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Brodkin @ 2017-11-29  8:21 UTC (permalink / raw)
  To: linux-snps-arc

As of today we assumed that "machine_desc->init_per_cpu" calls
are only usable on SMP systems when we want to run some piece of
code on early boot for each and every core, I guess assumption was
we have "machine_desc->init_early" for single-core cases where
the one and only master core can do all the things.

But it turned out for platforms which might be both UP and SMP it
might be benificial to use "init_per_cpu" for both UP and SMP cases
with which we achieve 2 things simultaneously:
 1) Exactly the same one code will be used for UP&SMP for
    things required to be done on each an every core regardless if it's
    a master and the only core in UP system or any other slave core in SMP
    setup.
 1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 arch/arc/include/asm/mach_desc.h | 2 --
 arch/arc/kernel/irq.c            | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arc/include/asm/mach_desc.h b/arch/arc/include/asm/mach_desc.h
index c28e6c347b49..871f3cb16af9 100644
--- a/arch/arc/include/asm/mach_desc.h
+++ b/arch/arc/include/asm/mach_desc.h
@@ -34,9 +34,7 @@ struct machine_desc {
 	const char		*name;
 	const char		**dt_compat;
 	void			(*init_early)(void);
-#ifdef CONFIG_SMP
 	void			(*init_per_cpu)(unsigned int);
-#endif
 	void			(*init_machine)(void);
 	void			(*init_late)(void);
 
diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
index 538b36afe89e..62b185057c04 100644
--- a/arch/arc/kernel/irq.c
+++ b/arch/arc/kernel/irq.c
@@ -31,10 +31,10 @@ void __init init_IRQ(void)
 	/* a SMP H/w block could do IPI IRQ request here */
 	if (plat_smp_ops.init_per_cpu)
 		plat_smp_ops.init_per_cpu(smp_processor_id());
+#endif
 
 	if (machine_desc->init_per_cpu)
 		machine_desc->init_per_cpu(smp_processor_id());
-#endif
 }
 
 /*
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
  2017-11-29  8:21 ` Alexey Brodkin
@ 2017-11-30 17:46   ` Vineet Gupta
  -1 siblings, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2017-11-30 17:46 UTC (permalink / raw)
  To: Alexey Brodkin, linux-snps-arc; +Cc: linux-kernel, Vineet Gupta

On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
> As of today we assumed that "machine_desc->init_per_cpu" calls
> are only usable on SMP systems when we want to run some piece of
> code on early boot for each and every core, I guess assumption was
> we have "machine_desc->init_early" for single-core cases where
> the one and only master core can do all the things.
> 
> But it turned out for platforms which might be both UP and SMP it
> might be benificial to use "init_per_cpu" for both UP and SMP cases
> with which we achieve 2 things simultaneously:
>   1) Exactly the same one code will be used for UP&SMP for
>      things required to be done on each an every core regardless if it's
>      a master and the only core in UP system or any other slave core in SMP
>      setup.
>   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
> 

Seems fine to me. However this needs to go with the actual platform change which 
needs it.

-Vineet

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
@ 2017-11-30 17:46   ` Vineet Gupta
  0 siblings, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2017-11-30 17:46 UTC (permalink / raw)
  To: linux-snps-arc

On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
> As of today we assumed that "machine_desc->init_per_cpu" calls
> are only usable on SMP systems when we want to run some piece of
> code on early boot for each and every core, I guess assumption was
> we have "machine_desc->init_early" for single-core cases where
> the one and only master core can do all the things.
> 
> But it turned out for platforms which might be both UP and SMP it
> might be benificial to use "init_per_cpu" for both UP and SMP cases
> with which we achieve 2 things simultaneously:
>   1) Exactly the same one code will be used for UP&SMP for
>      things required to be done on each an every core regardless if it's
>      a master and the only core in UP system or any other slave core in SMP
>      setup.
>   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
> 

Seems fine to me. However this needs to go with the actual platform change which 
needs it.

-Vineet

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
  2017-11-30 17:46   ` Vineet Gupta
@ 2018-06-14 22:26     ` Alexey Brodkin
  -1 siblings, 0 replies; 8+ messages in thread
From: Alexey Brodkin @ 2018-06-14 22:26 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: wbx, linux-kernel, linux-snps-arc

Hi Vineet,

On Thu, 2017-11-30 at 09:46 -0800, Vineet Gupta wrote:
> On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
> > As of today we assumed that "machine_desc->init_per_cpu" calls
> > are only usable on SMP systems when we want to run some piece of
> > code on early boot for each and every core, I guess assumption was
> > we have "machine_desc->init_early" for single-core cases where
> > the one and only master core can do all the things.
> > 
> > But it turned out for platforms which might be both UP and SMP it
> > might be benificial to use "init_per_cpu" for both UP and SMP cases
> > with which we achieve 2 things simultaneously:
> >   1) Exactly the same one code will be used for UP&SMP for
> >      things required to be done on each an every core regardless if it's
> >      a master and the only core in UP system or any other slave core in SMP
> >      setup.
> >   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
> > 
> 
> Seems fine to me. However this needs to go with the actual platform change which 
> needs it.

Well for example this might get in the way of building kernel for HSDK with
CONFIG_SMP disabled which is IMHO quite valid case in terms of testing
code-base compiled with no CONFIG_SMP (something Waldemar was up to).

Is it a strong enough reason for that patch to be applied?

-Alexey

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
@ 2018-06-14 22:26     ` Alexey Brodkin
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Brodkin @ 2018-06-14 22:26 UTC (permalink / raw)
  To: linux-snps-arc

Hi Vineet,

On Thu, 2017-11-30@09:46 -0800, Vineet Gupta wrote:
> On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
> > As of today we assumed that "machine_desc->init_per_cpu" calls
> > are only usable on SMP systems when we want to run some piece of
> > code on early boot for each and every core, I guess assumption was
> > we have "machine_desc->init_early" for single-core cases where
> > the one and only master core can do all the things.
> > 
> > But it turned out for platforms which might be both UP and SMP it
> > might be benificial to use "init_per_cpu" for both UP and SMP cases
> > with which we achieve 2 things simultaneously:
> >   1) Exactly the same one code will be used for UP&SMP for
> >      things required to be done on each an every core regardless if it's
> >      a master and the only core in UP system or any other slave core in SMP
> >      setup.
> >   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
> > 
> 
> Seems fine to me. However this needs to go with the actual platform change which 
> needs it.

Well for example this might get in the way of building kernel for HSDK with
CONFIG_SMP disabled which is IMHO quite valid case in terms of testing
code-base compiled with no CONFIG_SMP (something Waldemar was up to).

Is it a strong enough reason for that patch to be applied?

-Alexey

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
  2018-06-14 22:26     ` Alexey Brodkin
@ 2018-06-20 23:11       ` Vineet Gupta
  -1 siblings, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2018-06-20 23:11 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: wbx, linux-kernel, linux-snps-arc

On 06/14/2018 03:26 PM, Alexey Brodkin wrote:
> Hi Vineet,
>
> On Thu, 2017-11-30 at 09:46 -0800, Vineet Gupta wrote:
>> On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
>>> As of today we assumed that "machine_desc->init_per_cpu" calls
>>> are only usable on SMP systems when we want to run some piece of
>>> code on early boot for each and every core, I guess assumption was
>>> we have "machine_desc->init_early" for single-core cases where
>>> the one and only master core can do all the things.
>>>
>>> But it turned out for platforms which might be both UP and SMP it
>>> might be benificial to use "init_per_cpu" for both UP and SMP cases
>>> with which we achieve 2 things simultaneously:
>>>   1) Exactly the same one code will be used for UP&SMP for
>>>      things required to be done on each an every core regardless if it's
>>>      a master and the only core in UP system or any other slave core in SMP
>>>      setup.
>>>   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
>>>
>> Seems fine to me. However this needs to go with the actual platform change which 
>> needs it.
> Well for example this might get in the way of building kernel for HSDK with
> CONFIG_SMP disabled which is IMHO quite valid case in terms of testing
> code-base compiled with no CONFIG_SMP 

Fair enough - although world is moving away from UP.


> (something Waldemar was up to).

Really, why does he care if we are running SMP kernel - oh his simulation time
goes up. But honestly he should try and use the SMP kernel for testing as that
might uncover any system wide / SMP specific bugs in testing uclibc as well !

> Is it a strong enough reason for that patch to be applied?

Well per my original reply I didn't have any objections for this per-se and wanted
to see the platform patch. Seems we don't need platform patch as it is not under
#ifdef in hsdk/platform.c

I'll queue this up !

-Vineet

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs
@ 2018-06-20 23:11       ` Vineet Gupta
  0 siblings, 0 replies; 8+ messages in thread
From: Vineet Gupta @ 2018-06-20 23:11 UTC (permalink / raw)
  To: linux-snps-arc

On 06/14/2018 03:26 PM, Alexey Brodkin wrote:
> Hi Vineet,
>
> On Thu, 2017-11-30@09:46 -0800, Vineet Gupta wrote:
>> On 11/29/2017 12:21 AM, Alexey Brodkin wrote:
>>> As of today we assumed that "machine_desc->init_per_cpu" calls
>>> are only usable on SMP systems when we want to run some piece of
>>> code on early boot for each and every core, I guess assumption was
>>> we have "machine_desc->init_early" for single-core cases where
>>> the one and only master core can do all the things.
>>>
>>> But it turned out for platforms which might be both UP and SMP it
>>> might be benificial to use "init_per_cpu" for both UP and SMP cases
>>> with which we achieve 2 things simultaneously:
>>>   1) Exactly the same one code will be used for UP&SMP for
>>>      things required to be done on each an every core regardless if it's
>>>      a master and the only core in UP system or any other slave core in SMP
>>>      setup.
>>>   1) There will be no "ifdef CONFIG_SMP" around "init_per_cpu".
>>>
>> Seems fine to me. However this needs to go with the actual platform change which 
>> needs it.
> Well for example this might get in the way of building kernel for HSDK with
> CONFIG_SMP disabled which is IMHO quite valid case in terms of testing
> code-base compiled with no CONFIG_SMP 

Fair enough - although world is moving away from UP.


> (something Waldemar was up to).

Really, why does he care if we are running SMP kernel - oh his simulation time
goes up. But honestly he should try and use the SMP kernel for testing as that
might uncover any system wide / SMP specific bugs in testing uclibc as well !

> Is it a strong enough reason for that patch to be applied?

Well per my original reply I didn't have any objections for this per-se and wanted
to see the platform patch. Seems we don't need platform patch as it is not under
#ifdef in hsdk/platform.c

I'll queue this up !

-Vineet

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-20 23:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29  8:21 [PATCH] ARC: Enable machine_desc->init_per_cpu for non-SMP configs Alexey Brodkin
2017-11-29  8:21 ` Alexey Brodkin
2017-11-30 17:46 ` Vineet Gupta
2017-11-30 17:46   ` Vineet Gupta
2018-06-14 22:26   ` Alexey Brodkin
2018-06-14 22:26     ` Alexey Brodkin
2018-06-20 23:11     ` Vineet Gupta
2018-06-20 23:11       ` Vineet Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.