1. 30 8月, 2017 2 次提交
  2. 29 8月, 2017 1 次提交
    • M
      MIPS: SMP: Constify smp ops · ff2c8252
      Matt Redfearn 提交于
      smp_ops providers do not modify their ops structures, so they should be
      made const for robustness. Since currently the MIPS kernel is not mapped
      with memory protection, this does not in itself provide any security
      benefit, but it still makes sense to make this change.
      
      There are also slight code size efficincies from the structure being
      made read-only, saving 128 bytes of kernel text on a
      pistachio_defconfig.
      Before:
         text	   data	    bss	    dec	    hex	filename
      7187239	1772752	 470224	9430215	 8fe4c7	vmlinux
      After:
         text	   data	    bss	    dec	    hex	filename
      7187111	1772752	 470224	9430087	 8fe447	vmlinux
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Steven J. Hill <steven.hill@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16784/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ff2c8252
  3. 08 3月, 2017 1 次提交
  4. 02 3月, 2017 1 次提交
  5. 03 1月, 2017 2 次提交
    • F
      MIPS: BMIPS: Migrate interrupts during bmips_cpu_disable · 51ad4ace
      Florian Fainelli 提交于
      While we properly disabled the per-CPU timer interrupt, we also need to
      make sure that all interrupts that can possibly have this CPU in their
      smp_affinity mask also have a chance to see this interrupt migrated to a
      CPU not being taken offline.
      
      [ralf@linux-mips.org: Fix merge conflict.]
      
      Fixes: 230b6ff5 ("MIPS: BMIPS: Mask off timer IRQs when hot-unplugging a CPU")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Cc: cernekee@gmail.com
      Cc: jaedon.shin@gmail.com
      Cc: justinpopo6@gmail.com
      Cc: tglx@linutronix.de
      Cc: marc.zyngier@arm.com
      Cc: jason@lakedaemon.net
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14488/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      51ad4ace
    • M
      MIPS: SMP: Remove cpu_callin_map · 5892d6a6
      Matt Redfearn 提交于
      The previous commit made cpu_callin_map redundant, since it is no longer
      used to signal secondary CPUs starting, or going offline. Remove it now.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: Yang Shi <yang.shi@windriver.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14503/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5892d6a6
  6. 29 7月, 2016 1 次提交
    • J
      MIPS: SMP: Update cpu_foreign_map on CPU disable · 826e99be
      James Hogan 提交于
      When a CPU is disabled via CPU hotplug, cpu_foreign_map is not updated.
      This could result in cache management SMP calls being sent to offline
      CPUs instead of online siblings in the same core.
      
      Add a call to calculate_cpu_foreign_map() in the various MIPS cpu
      disable callbacks after set_cpu_online(). All cases are updated for
      consistency and to keep cpu_foreign_map strictly up to date, not just
      those which may support hardware multithreading.
      
      Fixes: cccf34e9 ("MIPS: c-r4k: Fix cache flushing for MT cores")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Hongliang Tao <taohl@lemote.com>
      Cc: Hua Yan <yanh@lemote.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13799/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      826e99be
  7. 13 5月, 2016 1 次提交
  8. 09 5月, 2016 1 次提交
  9. 03 8月, 2015 1 次提交
    • A
      MIPS: SMP: Don't increment irq_count multiple times for call function IPIs · 4ace6139
      Alex Smith 提交于
      The majority of SMP platforms handle their IPIs through do_IRQ()
      which calls irq_{enter/exit}(). When a call function IPI is received,
      smp_call_function_interrupt() is called which also calls
      irq_{enter,exit}(), meaning irq_count is raised twice.
      
      When tick broadcasting is used (which is implemented via a call
      function IPI), this incorrectly causes all CPU idle time on the core
      receiving broadcast ticks to be accounted as time spent servicing
      IRQs, as account_process_tick() will account as such if irq_count is
      greater than 1. This results in 100% CPU usage being reported on a
      core which receives its ticks via broadcast.
      
      This patch removes the SMP smp_call_function_interrupt() wrapper which
      calls irq_{enter,exit}(). Platforms which handle their IPIs through
      do_IRQ() now call generic_smp_call_function_interrupt() directly to
      avoid incrementing irq_count a second time. Platforms which don't
      (loongson, sgi-ip27, sibyte) call generic_smp_call_function_interrupt()
      wrapped in irq_{enter,exit}().
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10770/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4ace6139
  10. 30 5月, 2015 1 次提交
  11. 05 3月, 2015 1 次提交
  12. 24 11月, 2014 6 次提交
    • K
      MIPS: BMIPS: Let each platform customize the CPU1 IRQ mask · d8010ceb
      Kevin Cernekee 提交于
      On some chips like bcm3384, "other stuff" gets wired up to CPU1's IE_IRQ1
      input, generating spurious IRQs.  In this case we want the platform code
      to be able to mask it off.
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: jfraser@broadcom.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8163/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d8010ceb
    • K
      MIPS: BMIPS: Explicitly configure reset vectors prior to secondary boot · 3677a283
      Kevin Cernekee 提交于
      The secondary CPU's reset vector needs to be set to KSEG1 for a cold
      boot (release from reset), or KSEG0 for a warm restart.  On a cold boot
      KSEG0 may be unavailable (BMIPS4380), and on a warm restart KSEG1 may
      be unavailable (XKS01 mode on 4380 or 5000).
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: jfraser@broadcom.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8161/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3677a283
    • J
      MIPS: BMIPS: Mask off timer IRQs when hot-unplugging a CPU · 230b6ff5
      Jon Fraser 提交于
      CPU interrupts need to be disabled on a cpu being taken down.
      When a cpu is hot-plugged out of the system the following sequence occurs.
      
      On the CPU where the hotplug sequence was initiated:
          cpu_down
              _cpu_down {
                  __cpu_notify(CPU_DOWN_PREPARE
                  __stop_machine(take_cpu_down
                      wait for cpu to run disable code.
                  __cpu_die
              }
      
      On the CPU  being disabled:
          take_cpu_down
              __cpu_disable {
                  mp_ops->cpu_disable
                      bmips_cpu_disable
                          clear_c0_status(IE_IRQ5) (added)
                  cpu_notify(CPU_DYING...
              }
      
      Before the cpu_notifier is called with CPU_DYING, all interrupts on the
      dying cpu must be disabled.  This guarantees that before tick_notify is
      called with the CPU_DYING event and sets the clock device pointer to
      NULL, there can not be any more clock interrupts.
      
      When this wasn't done, an unfortunately-timed timer interrupt sometimes
      caused hangs immediately prior to system suspend:
      
          Debug PM is not enabled. To enable partial suspend, rebuild kernel with CONFIG_PM_DEBUG
          Pass 1 out of 1,PM: Syncing filesystems ... mode=none, tp1=done.
          1, flags=5, cycle_tp=, sleep=
          Freezing user space processes ... (elapsed 0.01 seconds) done.
          Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
          PM: suspend of devices complete after 54.199 msecs
          PM: late suspend of devices complete after 0.172 msecs
          Disabling non-boot CPUs ...
          SMP: CPU1 is offline
          INFO: rcu_sched detected stalls on CPUs/tasks: { 3} (detected by 0, t=62537 jiffies)
          Call Trace:
          [<804baa78>] dump_stack+0x8/0x34
          [<8008a2d8>] __rcu_pending+0x4b8/0x55c
          [<8008adf4>] rcu_check_callbacks+0x78/0x180
          [<80037830>] update_process_times+0x40/0x6c
          [<80072fe4>] tick_sched_timer+0x74/0xe4
          [<80050180>] __run_hrtimer.clone.30+0x64/0x140
          [<80051150>] hrtimer_interrupt+0x19c/0x4bc
          [<8000cdb8>] c0_compare_interrupt+0x50/0x88
          [<80081b18>] handle_irq_event_percpu+0x5c/0x2f4
          [<80086490>] handle_percpu_irq+0x8c/0xc0
          [<800811b4>] generic_handle_irq+0x34/0x54
          [<800067dc>] do_IRQ+0x18/0x2c
          [<8000375c>] plat_irq_dispatch+0xd0/0x128
          [<80004a04>] ret_from_irq+0x0/0x4
          [<80004c40>] r4k_wait+0x20/0x40
          [<80006b6c>] cpu_idle+0x98/0xf0
          [<805d3988>] start_kernel+0x424/0x440
      Signed-off-by: NJon Fraser <jfraser@broadcom.com>
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8160/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      230b6ff5
    • J
      MIPS: BMIPS: Allow BMIPS3300 to utilize SMP ebase relocation code · fa010672
      Jon Fraser 提交于
      BMIPS3300 processors do not have the hardware to support SMP, but with a
      small tweak, the SMP ebase relocation code allows BMIPS3300-based
      platforms to reuse the S2/S3 power management code from BMIPS4380-based
      chips.  Normally this is as simple as adding one line to prom_init():
      
          board_ebase_setup = &bmips_ebase_setup;
      Signed-off-by: NJon Fraser <jfraser@broadcom.com>
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8159/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fa010672
    • K
      MIPS: BMIPS: Introduce helper function to change the reset vector · fc455787
      Kevin Cernekee 提交于
      This will need to be called from a few different places, and the logic
      is starting to get a bit hairy (with the need for IPIs, CPU bug
      workarounds, and hazards).
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: jfraser@broadcom.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8158/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fc455787
    • K
      MIPS: BMIPS: Align secondary boot sequence with latest firmware releases · bdb2e05c
      Kevin Cernekee 提交于
      On some older BMIPS5200 (dual core / quad thread) platforms, the
      PROM code set up CPU2/CPU3 so they would be started through an NMI
      instead of through the ACTION register.  But this was incompatible with
      some power management features that were later added, so the scheme was
      changed so that Linux is fully responsible for booting CPU2/CPU3.
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Cc: f.fainelli@gmail.com
      Cc: mbizon@freebox.fr
      Cc: jogo@openwrt.org
      Cc: jfraser@broadcom.com
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/8157/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      bdb2e05c
  13. 27 8月, 2014 1 次提交
    • C
      mips: Replace __get_cpu_var uses · 35898716
      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: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      35898716
  14. 27 5月, 2014 1 次提交
  15. 23 1月, 2014 1 次提交
  16. 30 10月, 2013 1 次提交
  17. 05 8月, 2013 1 次提交
  18. 31 7月, 2013 2 次提交
  19. 19 7月, 2013 1 次提交
  20. 15 7月, 2013 1 次提交
    • P
      MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code · 078a55fc
      Paul Gortmaker 提交于
      commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
      
      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)
      and are flagged as __cpuinit  -- so if we remove the __cpuinit from
      the arch specific callers, we will also get section mismatch warnings.
      As an intermediate step, we intend to turn the linux/init.h cpuinit
      related content into no-ops as early as possible, since that will get
      rid of these warnings.  In any case, they are temporary and harmless.
      
      Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
      from asm files.  MIPS is interesting in this respect, because there
      are also uasm users hiding behind their own renamed versions of the
      __cpuinit macros.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      [ralf@linux-mips.org: Folded in Paul's followup fix.]
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/5494/
      Patchwork: https://patchwork.linux-mips.org/patch/5495/
      Patchwork: https://patchwork.linux-mips.org/patch/5509/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      078a55fc
  21. 01 7月, 2013 1 次提交
  22. 19 7月, 2012 2 次提交
  23. 29 3月, 2012 2 次提交
    • R
      remove references to cpu_*_map in arch/ · 0b5f9c00
      Rusty Russell 提交于
      This has been obsolescent for a while; time for the final push.
      
      In adjacent context, replaced old cpus_* with cpumask_*.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: David S. Miller <davem@davemloft.net> (arch/sparc)
      Acked-by: Chris Metcalf <cmetcalf@tilera.com> (arch/tile)
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: linux-hexagon@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Helge Deller <deller@gmx.de>
      Cc: sparclinux@vger.kernel.org
      0b5f9c00
    • D
      Disintegrate asm/system.h for MIPS · b81947c6
      David Howells 提交于
      Disintegrate asm/system.h for MIPS.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      cc: linux-mips@linux-mips.org
      b81947c6
  24. 21 2月, 2012 1 次提交
  25. 08 12月, 2011 1 次提交