History log of /arch/blackfin/mach-bf561/smp.c
Revision Date Author Comments
13dff62d80e93f1cc65b4ad2dddedd12de720272 18-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> blackfin: delete __cpuinit usage from all blackfin 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/blackfin uses of the __cpuinit macros from
all C files. Currently blackfin does not have any __CPUINIT used in
assembly files.

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

Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Bob Liu <lliubbo@gmail.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
150382a53d11256e5666c86525c8bf8d23684532 09-Jul-2013 Steven Miao <realmz6@gmail.com> smp: refine bf561 smpboot code

release boot lock earlier to let coreb do setup and calibrate
set coreb online later after initialization ready
add BFIN_IPI_NONE IPI type
drop unnecesarry smp_mb() and using atomic type

Signed-off-by: Steven Miao <realmz6@gmail.com>
d0014be47dc90d15adf7d6e09031d06e2aa7ce79 12-Dec-2011 Bob Liu <lliubbo@gmail.com> blackfin: smp: cleanup smp code

move idle task point to percpu blackfin_cpudata and add smp_timer_broadcast
interface.
enable SUPPLE_1_WAKEUP and add BFIN_IPI_TIMER ipi support.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
16df3666f43507a6d21e192dae39b69cafc17089 12-Dec-2011 Bob Liu <lliubbo@gmail.com> blackfin: smp: add suspend and wakeup irq flags

Add IRQF_NO_SUSPEND | IRQF_FORCE_RESUME to irq flags, supplement irq should
not be disabled when system do suspend.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
7832bb5d450aefa45b6dac3b3140eade66bb12ad 07-Sep-2011 Yong Zhang <yong.zhang0@gmail.com> Blackfin: irq: remove IRQF_DISABLED

This flag is a NOOP and can be removed now.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Bob Liu <lliubbo@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
3cb8a39fa6695575959fc3661b5d379b4e552eaa 26-Apr-2011 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Blackfin: don't touch cpu_possible_map and cpu_present_map directly

We plan to remove cpu_possible_map and cpu_present_map later and we
have proper init_cpu_possible() and init_cpu_present() APIs.

Therefore this patch rewrites platform_init_cpus and platform_prepare_cpus
by their APIs.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
44491fbc5a228f3c2e61d842fd9fee0bfb839373 14-Apr-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: SMP: fix cpudata cache setup

After some cache setup reordering changesets, the blackfin_cpudata init
was left behind. While cpu0's data was correct, cpu1's data was not.
Not that big of a deal as these are only used in the cpuinfo output, but
should still be fixed. So move the setup of these fields to the common
cache setup function to avoid this happening again in the future.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1907d8be2d54de461c682ee2fac45d97c29fd5dd 24-Mar-2011 Thomas Gleixner <tglx@linutronix.de> bfin: Final irq cleanup

Use the trigger type in irq_data and check level type instead of
looking at desc->handle_irq.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: uclinux-dist-devel@blackfin.uclinux.org
91796c235dcefefde38732e1a969afc5c3d63ae6 18-Mar-2011 Mike Frysinger <vapier@gentoo.org> Blackfin: SMP: convert to irq chip functions

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
c6345ab1a3d17f4b6c80ac79d7fb0f006b32fdaa 05-Aug-2010 Sonic Zhang <sonic.zhang@analog.com> Blackfin: SMP: work around anomaly 05000491

In order to safely work around anomaly 05000491, we have to execute IFLUSH
from L1 instruction sram. The trouble with multi-core systems is that all
L1 sram is visible only to the active core. So we can't just place the
functions into L1 and call it directly. We need to setup a jump table and
place the entry point in external memory. This will call the right func
based on the active core.

In the process, convert from the manual relocation of a small bit of code
into Core B's L1 to the more general framework we already have in place
for loading arbitrary pieces of code into L1.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
73a400646b8e26615f3ef1a0a4bc0cd0d5bd284c 17-Dec-2009 Yi Li <yi.li@analog.com> Blackfin: SMP: rewrite IPI handling to avoid memory allocation

Currently, sending an interprocessor interrupt (IPI) requires building up
a message dynamically which means memory allocation. But often times, we
will want to send an IPI in low level contexts where allocation is not
possible which may lead to a panic(). So create a per-cpu static array
for the message queue and use that instead.

Further, while we have two supplemental interrupts, we are currently only
using one of them. So use the second one for the most common IPI message
of all -- smp_send_reschedule(). This avoids ugly contention for locks
which in turn would require an IPI message ...

In general, this improves SMP performance, and in some cases allows the
SMP port to work in places it wouldn't before. Such as the PREEMPT_RT
state where the slab is protected by a per-cpu spin lock. If the slab
kmalloc/kfree were to put the task to sleep, and that task was actually
the IPI handler, then the system falls down yet again.

After running some various stress tests on the system, the static limit
of 5 messages seems to work. On the off chance even this overflows, we
simply panic(), and we can review that scenario to see if the limit needs
to be increased a bit more.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
75734e660665b9bb5da8fc06beb491b716f9af77 21-Sep-2009 Graf Yang <graf.yang@analog.com> Blackfin: SMP: tweak platform_request_ipi() usage

This function takes an irq_handler_t function, but the prototype in
the header doesn't match the function definition. This is due to the
smp headers needing to avoid circular dependencies. So change the
function to take a simple pointer.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
94a038c2e6228727ae0549af75e97b9b634cd468 27-Oct-2010 Mike Frysinger <vapier@gentoo.org> Blackfin: bf561: update a few more SIC_SYSCR locations

Looks like I missed a few new spots when renaming the SICA macros.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
39c999697bf43a97b877fa43cbc9c2a4d1a3a461 19-Oct-2010 Mike Frysinger <vapier@gentoo.org> Blackfin: bf561: rewrite SICA_xxx to just SIC_xxx

This matches all the other Blackfin ports and keep us from having to write
bf561-specific code in many places.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
0b39db28b953945232719e7ff6fb802aa8a2be5f 28-Dec-2009 Graf Yang <graf.yang@analog.com> Blackfin: SMP: add PM/CPU hotplug support

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
0d152c27e336b5fd777da7dd3e814617e7305afd 28-Dec-2009 Yi Li <yi.li@analog.com> Blackfin: SMP: make core timers per-cpu clock events for HRT

SMP systems require per-cpu local clock event devices in order to enable
HRT support. One a BF561, we can use local core timer for this purpose.
Originally, there was one global core-timer clock event device set up for
core A.

To accomplish this feat, we need to split the gptimer0/core timer logic
so that each is a standalone clock event. There is no requirement that
we only have one clock event source anyways. Once we have this, we just
define per-cpu clock event devices for each local core timer.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
682f5dc4ed7cdef1f55e40ee505c4346dfa6fa91 28-Dec-2009 Graf Yang <graf.yang@analog.com> Blackfin: drop cpu_callin_map on SMP systems

Common API already provides functions for managing online CPUs.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
578d36f5e160208821e8f51037ac1038e065ecaf 02-Dec-2009 Yi Li <yi.li@analog.com> Blackfin: SMP: don't start up core b until its state has been completely onlined

When testing PREEMPT_RT kernel on BF561-EZKit, the kernel blocks while
booting. When the kernel initializes the ethernet driver, it sleeps and
never wakes up.

The issue happens when the kernel waits for a timer for Core B to timeout
(the timers are per-cpu based: static DEFINE_PER_CPU(struct tvec_base *,
tvec_bases) = &boot_tvec_bases).

However, the ksoftirqd thread for Core B (note, the ksoftirqd thread is
also per-cpu based) cannot work properly, and the timers for Core B never
times out.

When ksoftirqd() for the first time runs on core B, it is possible core A
is still initializing core B (see smp_init() -> cpu_up() -> __cpu_up()).
So the "cpu_is_offline()" check may return true and ksoftirqd moves to
"wait_to_die".

So delay the core b start up until the per-cpu timers have been set up
fully.

Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
96f1050d3df105c9ae6c6ac224f370199ea82fcd 24-Sep-2009 Robin Getz <robin.getz@analog.com> Blackfin: mass clean up of copyright/licensing info

Bill Gatliff & David Brownell pointed out we were missing some
copyrights, and licensing terms in some of the files in
./arch/blackfin, so this fixes things, and cleans them up.

It also removes:
- verbose GPL text(refer to the top level ./COPYING file)
- file names (you are looking at the file)
- bug url (it's in the ./MAINTAINERS file)
- "or later" on GPL-2, when we did not have that right

It also allows some Blackfin-specific assembly files to be under a BSD
like license (for people to use them outside of Linux).

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1fa9be72b558c39459f98835eb86dbb4ef4da30b 15-May-2009 Graf Yang <graf.yang@analog.com> Blackfin: add support for gptimer0 as a tick source

For systems where the core cycles are not a usable tick source (like SMP
or cycles gets updated), enable gptimer0 as an alternative.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
d8804adf52f5991388fa9af77428e4cc7768059d 29-Apr-2009 Mike Frysinger <vapier@gentoo.org> Blackfin: do not append newlines to panic() messages

The panic() function already handles newlines for us.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
dbc895f95500a73ebf1ff12fe85f2e2b3790f52f 07-Jan-2009 Graf Yang <graf.yang@analog.com> Blackfin arch: smp patch cleanup from LKML review

1. Use inline get_l1_... functions instead of macro
2. Fix compile issue about smp barrier functions

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
c51b4488cd5bff08ed5690a8f303ff7f0894da2a 07-Jan-2009 Graf Yang <graf.yang@analog.com> Blackfin arch: SMP supporting patchset: BF561 related code

Blackfin dual core BF561 processor can support SMP like features.
https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like

In this patch, we provide SMP extend to BF561 kernel code

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>