History log of /arch/arc/kernel/smp.c
Revision Date Author Comments
619f30188ff0d10fccc3cd952a79cb56ff62db54 04-Sep-2014 Vineet Gupta <vgupta@synopsys.com> ARC: Allow SMP kernel to build/boot on UP-only infrastructure

In light of recent SNAFU with SMP build, allow simple platform to build
as SMP but run UP.

* Remove the dependence on simulation SMP extension to enable quick
build/test iterations of SMP kernel.

* In absence of platform SMP registration, prevent the NULL smp feature
name from borkign the system

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
c16e3e22839a33e1485b950ff7e86e58a862adea 12-Jun-2014 Vineet Gupta <vgupta@synopsys.com> ARC: prune extra header includes from smp.c

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2b75c0f93e395aa6130c20a08016b143e6ec8c53 07-May-2014 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] unify cpu private IRQ requests (TIMER/IPI)

The current cpu-private IRQ registration is ugly as it requires need to
expose arch_unmask_irq() outside of intc code.
So switch to percpu IRQ APIs:
-request_percpu_irq [boot core]
-enable_percpu_irq [all cores]

Encapsulated in helper arc_request_percpu_irq()

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
7e5122190b47c2574eda26aa0bbda693b2821449 28-Feb-2013 Noam Camus <noamc@ezchip.com> ARC: [SMP] Fix IPI IRQ registration

Handle it just like timer. Current request_percpu_irq() would fail on
non-boot cpus and thus IRQ will remian unmasked on those cpus.

[vgupta: fix changelong]
Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2d4899f6bddfbeb88c01f2ec28f977e0d8c8d369 08-May-2014 Vineet Gupta <vgupta@synopsys.com> ARC: arc_local_timer_setup() need not pass own cpu id

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
d8e8c7dda11f5d5cf90495f2e89d917a83509bc0 28-Nov-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] optimize IPI send and receive

* Don't send an IPI if receiver already has a pending IPI.
Atomically piggyback the new msg with pending msg.

* IPI receiver looping on xchg() not required

References: https://lkml.org/lkml/2013/11/25/232
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
f2a4aa5646687f9a51616581221b1d348590d47e 26-Nov-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] simplify IPI code

* ipi_data is just a word, no need to keep it as struct

* find_next_bit() not needed to loop thru a 32bit word, ffs suffices
53dc110c97436dcf2a758091c98093657116e91c 25-Nov-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] cpu halt interface doesn't need "self" cpu-id

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ccdaa6e0c86d8f48bf87439e4d6942b7a3e58899 25-Nov-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] IPI ACK interface doesn't need "self" cpu-id

The interface is confusing, it feels like we are getting "sender" info,
whereas it is the "receiver", which can very well be retrived by
smp_processor_id(), if need be.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ddf84433f411b612e935a6719ee395bb9dd2221f 24-Nov-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] cpumask not needed in IPI send path

The current IPI sending callstack needlessly involves cpumask.

arch_send_call_function_single_ipi(cpu) / smp_send_reschedule(cpu)
ipi_send_msg(cpumask_of(cpu)) --> [cpu to cpumask]
plat_smp_ops.ipi_send(callmap)
for_each_cpu(callmap) --> [cpuask to cpu]
do_plat_specific_ipi_PER_CPU

Given that current backends are not capable of 1:N IPIs, lets simplify
the interface for now, by keeping "a" cpu all along.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
06b93c347c93d53f5cd76c3efa277ea114cb2000 11-Sep-2013 Jiang Liu <jiang.liu@huawei.com> smp, ARC: kill SMP single function call interrupt

Commit 9a46ad6d6df3b54 "smp: make smp_call_function_many() use logic
similar to smp_call_function_single()" has unified the way to handle
single and multiple cross-CPU function calls. Now only one interrupt
is needed for architecture specific code to support generic SMP function
call interfaces, so kill the redundant single function call interrupt.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jiang Liu <liuj97@gmail.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
5ea72a90261552ed5fdca35239feb6cba498301e 27-Oct-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [SMP] TLB flush

- Add mm_cpumask setting (aggregating only, unlike some other arches)
used to restrict the TLB flush cross-calling

- cross-calling versions of TLB flush routines (thanks to Noam)

Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
064a6269245655b15054ad9783bca9bfd8dc1f9e 31-Oct-2013 Vineet Gupta <vgupta@synopsys.com> ARC: use __weak instead of __attribute__((weak))

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ce7599567e27eabc1003e35b6f05579268dafecd 24-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> arc: delete __cpuinit usage from all arc files

The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.

This removes all the arch/arc uses of the __cpuinit macros from
all C files. Currently arc does not have any __CPUINIT used in
assembly files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
fa35e42a00ec0120db2b5128753206efb288e789 21-Mar-2013 Thomas Gleixner <tglx@linutronix.de> arc: Use generic idle loop

The generic idle loop implements all functionality. Aside of that it
allows arc to implement the tsk_is_polling() functionality correctly,
despite the patently (now gone) comment in the original arc cpu_idle()
function:
/* Since we SLEEP in idle loop, TIF_POLLING_NRFLAG can't be set */
See kernel/cpu/idle.c

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Tested-by: Vineet Gupta <vgupta@synopsys.com>
Link: http://lkml.kernel.org/r/20130321215233.711253792@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
10b1271875abb9d590c14fa6c8b24b0d6f768ca2 18-Jan-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [Review] Multi-platform image #7: SMP common code to use callbacks

This again is for switch from singleton platform SMP API to
multi-platform paradigm

Platform code is not yet setup to populate the callbacks, that happens
in next commit

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
877768c84d6ca8f7dedafff0e44615a12e82f8f4 23-Jan-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [Review] Multi-platform image #3: switch to board callback

-platform API is retired and instead callbacks are used

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
03a6d28cdddfbd11b338c23e7fe51d0816b9bdef 18-Jan-2013 Vineet Gupta <vgupta@synopsys.com> ARC: [Review] Multi-platform image #2: Board callback Infrastructure

The orig platform code orgnaization was singleton design pattern - only
one platform (and board thereof) would build at a time.

Thus any platform/board specific code (e.g. irq init, early init ...)
expected by ARC common code was exported as well defined set of APIs,
with only ONE instance building ever.

Now with multiple-platform build requirement, that design of code no
longer holds - multiple board specific calls need to build at the same
time - so ARC common code can't use the API approach, it needs a
callback based design where each board registers it's specific set of
functions, and at runtime, depending on board detection, the callbacks
are used from the registry.

This commit adds all the infrastructure, where board specific callbacks
are specified as a "maThine description".

All the hooks are placed in right spots, no board callbacks registered
yet (with MACHINE_STARt/END constructs) so the hooks will not run.

Next commit will actually convert the platform to this infrastructure.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
41195d236e84458bebd4fdc218610a92231ac791 18-Jan-2013 Vineet Gupta <vgupta@synopsys.com> ARC: SMP support

ARC common code to enable a SMP system + ISS provided SMP extensions.

ARC700 natively lacks SMP support, hence some of the core features are
are only enabled if SoCs have the necessary h/w pixie-dust. This
includes:
-Inter Processor Interrupts (IPI)
-Cache coherency
-load-locked/store-conditional
...

The low level exception handling would be completely broken in SMP
because we don't have hardware assisted stack switching. Thus a fair bit
of this code is repurposing the MMU_SCRATCH reg for event handler
prologues to keep them re-entrant.

Many thanks to Rajeshwar Ranga for his initial "major" contributions to
SMP Port (back in 2008), and to Noam Camus and Gilad Ben-Yossef for help
with resurrecting that in 3.2 kernel (2012).

Note that this platform code is again singleton design pattern - so
multiple SMP platforms won't build at the moment - this deficiency is
addressed in subsequent patches within this series.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>