Commit graph

334 commits

Author SHA1 Message Date
Steven Miao
a2eff9dd8b blackfin: smp: fix msg queue overflow issue
disable preemption when icache flush and use wait mode cross call, hold the msg
queue lock while handle cross function call to avoid overflow

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
2012-01-09 10:26:15 +08:00
Bob Liu
d0014be47d 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>
2012-01-09 10:26:15 +08:00
Paul Gortmaker
6a550b99a0 blackfin: add module.h to files implicitly expecting to use it.
Its presence was implicit everywhere, but we are aiming to fix that,
so call out the users explicitly.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:02 -04:00
Steven Miao
0b2b06efd8 Blackfin: SMP: fix scheduling deadlock
Make sure our smp_send_reschedule() implementation matches the
scheduler_ipi() callback so that it can kick the idle cpu.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-25 19:51:29 -04:00
NeilBrown
f5b9409973 All Arch: remove linkage for sys_nfsservctl system call
The nfsservctl system call is now gone, so we should remove all
linkage for it.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-26 15:09:58 -07:00
Arun Sharma
60063497a9 atomic: use <linux/atomic.h>
This allows us to move duplicated code in <asm/atomic.h>
(atomic_inc_not_zero() for now) to <linux/atomic.h>

Signed-off-by: Arun Sharma <asharma@fb.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26 16:49:47 -07:00
Mike Frysinger
9e770f7780 Blackfin: dpmc: optimize SDRAM programming slightly
No need to reload these registers constantly since they're always
available (we're not making any function calls in between).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:31 -04:00
Mike Frysinger
da31d6fb46 Blackfin: dpmc: don't save/restore scratch registers
The Blackfin C ABI says we do not need to save/restore R0-R3 and P0-P2
as they are available as scratch registers.  So don't bother.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:31 -04:00
Mike Frysinger
9466a0510a Blackfin: bf538: pull gpio/port logic out of core hibernate paths
Re-architect how we save/restore the gpio/port logic that only pertains
to bf538/bf539 parts by pulling it out of the core code paths and pushing
it out to bf538-specific locations.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:30 -04:00
Mike Frysinger
eed7b83658 Blackfin: dpmc: optimize hibernate/resume path
The current save logic used in hibernation is to do a MMR load (base +
offset) into a register, and then push that onto the stack.  Then when
restoring, pop off the stack into a register followed by a MMR store
(base + offset).  These use plenty of 32bit insns rather than 16bit,
are pretty long winded, and full of pipeline bubbles.

So, by taking advantage of MMRs that are contiguous, the multi-register
push/pop insn, and register abuse, we can shrink this code considerably.

When saving, the new logic does a lot of loads into the data and pointer
registers before executing a single multi-register push insn.  Then when
restoring, we do a single multi-register pop insn followed by a lot of
stores.  Overall, this allows us to cut the insn count by ~30%, the code
size by ~45%, and drastically reduce the register hazards that trigger
bubbles in the pipeline.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:29 -04:00
Mike Frysinger
d7228e7eb9 Blackfin: dpmc: do not save/restore EVT0/EVT1/EVT4 when hibernating
EVT0 is for emulation, EVT1 is for reset, and EVT4 is the "global int
disable" region.  None of these are used by software (or even hardware),
so don't bother saving/restoring them when we hibernate since nothing
ever uses these in Linux (the only thing they would be useful for is
core-memory scratch, but that's just crazy talk).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:29 -04:00
Mike Frysinger
584ecbaa25 Blackfin: dpmc: relocate hibernate helper macros
This defines only get used in the hibernate code, so remove them from the
global dpmc header as no one else cares.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:28 -04:00
Mike Frysinger
429e257ea3 Blackfin: dpmc: omit RETE/RETN when hibernating
The RETE/RETN registers are only used in emulation(JTAG) and NMI nodes,
or as scratch registers, neither of which need to be saved/restored as
this code doesn't execute at those core event levels.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:28 -04:00
Mike Frysinger
4705a25c06 Blackfin: dpmc: optimize SIC_IWR programming a little
For parts with more than one SIC_IWR, we can optimize the writing
a little bit using better Blackfin insns.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:27 -04:00
Mike Frysinger
01f8e34c98 Blackfin: gpio/ints: generalize pint logic
Have the logic that uses peripheral interrupt blocks key off of pint
defines rather than CPU names so that things are generalized across
families.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:27 -04:00
Mike Frysinger
85c2737ae7 Blackfin: dpmc: bind to MMR names and not CPUs
Have the code work off of MMR names rather than CPU defines so there is
less code to tweak in the future with new parts.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:26 -04:00
Mike Frysinger
82ed5f73ed Blackfin: bf54x: switch to common pint MMR struct
We have a struct in the headers describing the register layout, so
drop the local duplicate one.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:25 -04:00
Mike Frysinger
b0759a4d23 Blackfin: bf54x: constify pint register array
The array of pointers to register blocks never changes, so constify it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:18:24 -04:00
Mike Frysinger
fb1d9be596 Blackfin: optimize double fault boot checking
This moves the double fault data used at boot time into a single struct
which can then easily be addressed with indexed loads rather than having
to explicitly load multiple addresses.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-23 01:10:43 -04:00
Mike Frysinger
427472c967 Blackfin: wire up new sendmmsg syscall
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-28 17:02:55 -04:00
Eric W. Biederman
7b21fddd08 ns: Wire up the setns system call
32bit and 64bit on x86 are tested and working.  The rest I have looked
at closely and I can't find any problems.

setns is an easy system call to wire up.  It just takes two ints so I
don't expect any weird architecture porting problems.

While doing this I have noticed that we have some architectures that are
very slow to get new system calls.  cris seems to be the slowest where
the last system calls wired up were preadv and pwritev.  avr32 is weird
in that recvmmsg was wired up but never declared in unistd.h.  frv is
behind with perf_event_open being the last syscall wired up.  On h8300
the last system call wired up was epoll_wait.  On m32r the last system
call wired up was fallocate.  mn10300 has recvmmsg as the last system
call wired up.  The rest seem to at least have syncfs wired up which was
new in the 2.6.39.

v2: Most of the architecture support added by Daniel Lezcano <dlezcano@fr.ibm.com>
v3: ported to v2.6.36-rc4 by: Eric W. Biederman <ebiederm@xmission.com>
v4: Moved wiring up of the system call to another patch
v5: ported to v2.6.39-rc6
v6: rebased onto parisc-next and net-next to avoid syscall  conflicts.
v7: ported to Linus's latest post 2.6.39 tree.

>  arch/blackfin/include/asm/unistd.h     |    3 ++-
>  arch/blackfin/mach-common/entry.S      |    1 +
Acked-by: Mike Frysinger <vapier@gentoo.org>

Oh - ia64 wiring looks good.
Acked-by: Tony Luck <tony.luck@intel.com>

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-28 10:48:39 -07:00
KOSAKI Motohiro
fecedc8071 Blackfin: convert old cpumask API to new one
old cpu_xxx() APIs is planned to removed later. then, converted.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:24:11 -04:00
Mike Frysinger
8c05410350 Blackfin: bf537: demux port H mask A and emac rx ints
The BF537 SIC combines the gpio port H mask A interrupts with the
emac rx interrupt, so we need to demux this in software.

It also combines the gpio port H mask B and the emac tx interrupts,
and the watchdog and port F mask B interrupts, but since we don't
support mask B yet, just add the defines for now.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
e2a8092c3f Blackfin: bf537: fix excessive gpio int demuxing
The search logic in the gpio demux walks all possible gpio blocks starting
at the specified pin.  The trouble on bf537 parts when we demux the port
F and port G mask A interrupts is that we also demux port H mask A ints.
Most of the time this isn't an issue as people don't usually use port H,
but might as well avoid it when possible.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
dd8cb37b4e Blackfin: bf54x: drop unused pm gpio handling
This functionality was merged into the common bfin_pm_standby_ctrl func
some time ago, so punt these now unused funcs and data, and localize the
wake funcs that aren't needed externally anymore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
f58c3276d3 Blackfin: move bf537-specific irq code out of common code
The SIC interrupt line muxing that the bf537 does is specific to this
CPU (thankfully), so rip it out of the common code and move it to a
bf537-specific file.  This tidies up the common code significantly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
6327a574f9 Blackfin: move internal irq prototypes out of global namespace
These are only used in a few internal Blackfin places, so move the irq
prototypes out of the global header and into the internal irq one.  No
functional changes other than shuffling locales.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
fc6bd7b8ad Blackfin: clean up irq ifdef logic a bit
Prefer MMR named checks over part-specific lists, condense duplicated
code across different #ifdef branches, simplify CONFIG_PM ifdefs, and
drop unused kgdb header.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:43 -04:00
Mike Frysinger
6b108049d6 Blackfin: ints-priority: unify duplicate vec to irq lookup logic
Seems the ipipe code just copied & pasted the existing irq lookup logic,
so pull the logic out of do_irq() and into a local helper, and convert
the two users over to that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:41 -04:00
Mike Frysinger
e9e334c35e Blackfin: ints-priority: clean up some local vars
The local ivg structs need not be exported, so mark them as static.
Further, the "num_spurious" variable is only incremented and never
actually read anywhere, so punt it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-25 08:13:41 -04:00
Linus Torvalds
80fe02b5da Merge branches 'sched-core-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
  sched: Fix and optimise calculation of the weight-inverse
  sched: Avoid going ahead if ->cpus_allowed is not changed
  sched, rt: Update rq clock when unthrottling of an otherwise idle CPU
  sched: Remove unused parameters from sched_fork() and wake_up_new_task()
  sched: Shorten the construction of the span cpu mask of sched domain
  sched: Wrap the 'cfs_rq->nr_spread_over' field with CONFIG_SCHED_DEBUG
  sched: Remove unused 'this_best_prio arg' from balance_tasks()
  sched: Remove noop in alloc_rt_sched_group()
  sched: Get rid of lock_depth
  sched: Remove obsolete comment from scheduler_tick()
  sched: Fix sched_domain iterations vs. RCU
  sched: Next buddy hint on sleep and preempt path
  sched: Make set_*_buddy() work on non-task entities
  sched: Remove need_migrate_task()
  sched: Move the second half of ttwu() to the remote cpu
  sched: Restructure ttwu() some more
  sched: Rename ttwu_post_activation() to ttwu_do_wakeup()
  sched: Remove rq argument from ttwu_stat()
  sched: Remove rq->lock from the first half of ttwu()
  sched: Drop rq->lock from sched_exec()
  ...

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Fix rt_rq runtime leakage bug
2011-05-19 17:41:22 -07:00
Dominik Brodowski
2d06d8c49a [CPUFREQ] use dynamic debug instead of custom infrastructure
With dynamic debug having gained the capability to report debug messages
also during the boot process, it offers a far superior interface for
debug messages than the custom cpufreq infrastructure. As a first step,
remove the old cpufreq_debug_printk() function and replace it with a call
to the generic pr_debug() function.

How can dynamic debug be used on cpufreq? You need a kernel which has
CONFIG_DYNAMIC_DEBUG enabled.

To enabled debugging during runtime, mount debugfs and

$ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control

for debugging the complete "cpufreq" module. To achieve the same goal during
boot, append

	ddebug_query="module cpufreq +p"

as a boot parameter to the kernel of your choice.

For more detailled instructions, please see
Documentation/dynamic-debug-howto.txt

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Dave Jones <davej@redhat.com>
2011-05-04 11:50:57 -04:00
Ingo Molnar
42ac9e87fd Merge commit 'v2.6.39-rc4' into sched/core
Merge reason: Pick up upstream fixes.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-04-21 11:39:28 +02:00
Peter Zijlstra
184748cc50 sched: Provide scheduler_ipi() callback in response to smp_send_reschedule()
For future rework of try_to_wake_up() we'd like to push part of that
function onto the CPU the task is actually going to run on.

In order to do so we need a generic callback from the existing scheduler IPI.

This patch introduces such a generic callback: scheduler_ipi() and
implements it as a NOP.

BenH notes: PowerPC might use this IPI on offline CPUs under rare conditions!

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110405152728.744338123@chello.nl
2011-04-14 08:52:32 +02:00
Sonic Zhang
8d50de9ee7 Blackfin: SMP: fix cache flush loop
The recent commit (10774912647781) wasn't entirely correct.  While
it fixed some issues, it introduced others.  So pull in the fixes
from the public cache flush functions, and document why we need to
call things directly ourselves.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 19:34:06 -04:00
Lucas De Marchi
25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Thomas Gleixner
43f2f1154a bfin: Convert irq namespace
Convert to the new function names. Scripted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: uclinux-dist-devel@blackfin.uclinux.org
2011-03-29 14:47:59 +02:00
Thomas Gleixner
1907d8be2d 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
2011-03-29 14:47:59 +02:00
Mike Frysinger
4e3d96deff Blackfin: wire up new syncfs syscall
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-22 21:03:16 -04:00
Mike Frysinger
a8d0142fb7 Blackfin: wire up new syscalls
Hook up name_to_handle_at, open_by_handle_at, and clock_adjtime.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:05:25 -04:00
Philippe Gerum
9169b51f8c Blackfin/ipipe: fix deferred pipeline sync for the root stage
This patch makes sure to sync the pipeline for the root stage only
from the outer interrupt level, when resuming kernel code after an
interrupt.

This fixes a bug causing EVT15 to be spuriously popped off upon nested
interrupts, which in turn would cause the preempted kernel code to
resume without supervisor privileges.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:11 -04:00
Philippe Gerum
5b5da4c4b8 Blackfin/ipipe: upgrade to I-pipe mainline
This patch introduces Blackfin-specific bits to support the current
tip of the interrupt pipeline development, mainly:

- 2/3-level interrupt maps (sparse IRQs)
- generic virq handling
- sysinfo v2 format for ipipe_get_sysinfo()

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:10 -04:00
Michael Hennerich
8944b5a258 Blackfin: cpufreq: fix typos
No functional changes here.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:10 -04:00
Thomas Gleixner
e9502850b9 Blackfin: convert gpio irq_chip to new functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:07 -04:00
Thomas Gleixner
172d2d1d84 Blackfin: convert mac irq_chip to new functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:07 -04:00
Thomas Gleixner
dabf64bcc5 Blackfin: convert error irq_chip to new functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:06 -04:00
Thomas Gleixner
ff43a67f67 Blackfin: convert internal irq_chip to new functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:06 -04:00
Thomas Gleixner
4f19ea4978 Blackfin: convert core irq_chip to new functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:05 -04:00
Thomas Gleixner
b10bbbbce7 Blackfin: use proper wrappers for irq_desc
Fixup the open coded access to irq_desc and use the proper wrappers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:05 -04:00
Mike Frysinger
511cdcc500 Blackfin: optimize startup code
Take advantage of more Blackfin-specific insns, and only initialize
registers required by the ABI.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 04:01:04 -04:00