1. 27 7月, 2015 1 次提交
  2. 12 3月, 2015 1 次提交
    • P
      blackfin: Use common outgoing-CPU-notification code · a17b4b74
      Paul E. McKenney 提交于
      This commit removes the open-coded CPU-offline notification with new
      common code.  This change avoids calling scheduler code using RCU from
      an offline CPU that RCU is ignoring.  This commit is compatible with
      the existing code in not checking for timeout during a prior offline
      for a given CPU.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: <adi-buildroot-devel@lists.sourceforge.net>
      a17b4b74
  3. 27 8月, 2014 1 次提交
    • C
      blackfin: Replace __get_cpu_var uses · 7e788ab1
      Christoph Lameter 提交于
      __get_cpu_var() is used for multiple purposes in the kernel source. One of
      them is address calculation via the form &__get_cpu_var(x).  This calculates
      the address for the instance of the percpu variable of the current processor
      based on an offset.
      
      Other use cases are for storing and retrieving data from the current
      processors percpu area.  __get_cpu_var() can be used as an lvalue when
      writing data or on the right side of an assignment.
      
      __get_cpu_var() is defined as :
      
      #define __get_cpu_var(var) (*this_cpu_ptr(&(var)))
      
      __get_cpu_var() always only does an address determination. However, store
      and retrieve operations could use a segment prefix (or global register on
      other platforms) to avoid the address calculation.
      
      this_cpu_write() and this_cpu_read() can directly take an offset into a
      percpu area and use optimized assembly code to read and write per cpu
      variables.
      
      This patch converts __get_cpu_var into either an explicit address
      calculation using this_cpu_ptr() or into a use of this_cpu operations that
      use the offset.  Thereby address calculations are avoided and less registers
      are used when code is generated.
      
      At the end of the patch set all uses of __get_cpu_var have been removed so
      the macro is removed too.
      
      The patch set includes passes over all arches as well. Once these operations
      are used throughout then specialized macros can be defined in non -x86
      arches as well in order to optimize per cpu access by f.e.  using a global
      register that may be set to the per cpu base.
      
      Transformations done to __get_cpu_var()
      
      1. Determine the address of the percpu instance of the current processor.
      
      	DEFINE_PER_CPU(int, y);
      	int *x = &__get_cpu_var(y);
      
          Converts to
      
      	int *x = this_cpu_ptr(&y);
      
      2. Same as #1 but this time an array structure is involved.
      
      	DEFINE_PER_CPU(int, y[20]);
      	int *x = __get_cpu_var(y);
      
          Converts to
      
      	int *x = this_cpu_ptr(y);
      
      3. Retrieve the content of the current processors instance of a per cpu
      variable.
      
      	DEFINE_PER_CPU(int, y);
      	int x = __get_cpu_var(y)
      
         Converts to
      
      	int x = __this_cpu_read(y);
      
      4. Retrieve the content of a percpu struct
      
      	DEFINE_PER_CPU(struct mystruct, y);
      	struct mystruct x = __get_cpu_var(y);
      
         Converts to
      
      	memcpy(&x, this_cpu_ptr(&y), sizeof(x));
      
      5. Assignment to a per cpu variable
      
      	DEFINE_PER_CPU(int, y)
      	__get_cpu_var(y) = x;
      
         Converts to
      
      	__this_cpu_write(y, x);
      
      6. Increment/Decrement etc of a per cpu variable
      
      	DEFINE_PER_CPU(int, y);
      	__get_cpu_var(y)++
      
         Converts to
      
      	__this_cpu_inc(y)
      
      CC: Mike Frysinger <vapier@gentoo.org>
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      7e788ab1
  4. 29 1月, 2014 1 次提交
    • J
      06/18] smp, blackfin: kill SMP single function call interrupt · 5e98c099
      Jiang Liu 提交于
      Commit 9a46ad6d "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.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Shaohua Li <shli@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jiri Kosina <trivial@kernel.org>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: uclinux-dist-devel@blackfin.uclinux.org
      Signed-off-by: NJiang Liu <liuj97@gmail.com>
      5e98c099
  5. 15 11月, 2013 1 次提交
  6. 16 7月, 2013 1 次提交
  7. 15 7月, 2013 1 次提交
    • P
      blackfin: delete __cpuinit usage from all blackfin files · 13dff62d
      Paul Gortmaker 提交于
      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 5e427ec2 ("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: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      13dff62d
  8. 09 7月, 2013 1 次提交
  9. 08 4月, 2013 1 次提交
  10. 08 10月, 2012 1 次提交
  11. 07 9月, 2012 1 次提交
  12. 26 4月, 2012 2 次提交
    • T
      blackfin: Use generic idle thread allocation · 6bba2682
      Thomas Gleixner 提交于
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Link: http://lkml.kernel.org/r/20120420124557.717064871@linutronix.de
      6bba2682
    • T
      smp: Add task_struct argument to __cpu_up() · 8239c25f
      Thomas Gleixner 提交于
      Preparatory patch to make the idle thread allocation for secondary
      cpus generic.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/20120420124556.964170564@linutronix.de
      8239c25f
  13. 09 1月, 2012 2 次提交
  14. 26 10月, 2011 1 次提交
  15. 27 7月, 2011 1 次提交
  16. 23 7月, 2011 1 次提交
  17. 25 5月, 2011 2 次提交
  18. 14 4月, 2011 2 次提交
  19. 18 3月, 2011 4 次提交
  20. 10 1月, 2011 3 次提交
    • Y
      Blackfin: SMP: rewrite IPI handling to avoid memory allocation · 73a40064
      Yi Li 提交于
      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: NYi Li <yi.li@analog.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      73a40064
    • G
      Blackfin: SMP: tweak platform_request_ipi() usage · 75734e66
      Graf Yang 提交于
      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: NGraf Yang <graf.yang@analog.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      75734e66
    • G
      Blackfin: SMP: fix cpumask misbehavior · 9c199b59
      Graf Yang 提交于
      The cpu maps are defines provided by common linux/cpumask.h, not local
      variables.  So stop exporting them locally and include the right header
      for their definition.
      Signed-off-by: NGraf Yang <graf.yang@analog.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      9c199b59
  21. 23 5月, 2010 1 次提交
  22. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  23. 09 3月, 2010 4 次提交
  24. 15 12月, 2009 1 次提交
    • Y
      Blackfin: SMP: don't start up core b until its state has been completely onlined · 578d36f5
      Yi Li 提交于
      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: NYi Li <yi.li@analog.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      578d36f5
  25. 25 11月, 2009 1 次提交
  26. 07 10月, 2009 1 次提交
    • R
      Blackfin: mass clean up of copyright/licensing info · 96f1050d
      Robin Getz 提交于
      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: NRobin Getz <robin.getz@analog.com>
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      96f1050d
  27. 16 7月, 2009 2 次提交