1. 03 3月, 2017 1 次提交
  2. 02 3月, 2017 1 次提交
  3. 03 1月, 2017 2 次提交
    • M
      MIPS: SMP-CPS: Don't BUG if a CPU fails to start · 5b0093f3
      Matt Redfearn 提交于
      If there is no online CPU within a core which could receive the IPI to
      start another VP in that core, a BUG() is triggered. Instead print a
      warning and gracefully handle the failure such that the system remains
      usable, albeit without the requested secondary CPU.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14504/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5b0093f3
    • 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
  4. 30 9月, 2016 1 次提交
    • M
      MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs · 6ca8ac77
      Matt Redfearn 提交于
      Commit 0d2808f3 ("MIPS: smp-cps: Add support for CPU hotplug of
      MIPSr6 processors") added a call to mips_cm_lock_other in order to lock
      the CPC in CPUs containing a version 3 or higher Coherence Manager,
      which use the general CM core other register, where previous CMs had a
      dedicated core other register for the CPC.
      
      A kernel BUG() is triggered, however, if mips_cm_lock_other is called
      with a VP other than 0 on a CPU with CM < 3, a condition introduced by
      0d2808f3.
      
      Avoid the BUG() by always locking VP0 when locking the CPC, since the
      required register, cpc_stat_conf, is shared by all vps in a core.
      
      Fixes: 0d2808f3 ("MIPS: smp-cps: Add support for CPU hotplug...)
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14297/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6ca8ac77
  5. 04 8月, 2016 1 次提交
    • M
      tree-wide: replace config_enabled() with IS_ENABLED() · 97f2645f
      Masahiro Yamada 提交于
      The use of config_enabled() against config options is ambiguous.  In
      practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
      author might have used it for the meaning of IS_ENABLED().  Using
      IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc.  makes the intention
      clearer.
      
      This commit replaces config_enabled() with IS_ENABLED() where possible.
      This commit is only touching bool config options.
      
      I noticed two cases where config_enabled() is used against a tristate
      option:
      
       - config_enabled(CONFIG_HWMON)
        [ drivers/net/wireless/ath/ath10k/thermal.c ]
      
       - config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
        [ drivers/gpu/drm/gma500/opregion.c ]
      
      I did not touch them because they should be converted to IS_BUILTIN()
      in order to keep the logic, but I was not sure it was the authors'
      intention.
      
      Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Cc: Stas Sergeev <stsp@list.ru>
      Cc: Matt Redfearn <matt.redfearn@imgtec.com>
      Cc: Joshua Kinard <kumba@gentoo.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: "Dmitry V. Levin" <ldv@altlinux.org>
      Cc: yu-cheng yu <yu-cheng.yu@intel.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Nikolay Martynov <mar.kolya@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Rafal Milecki <zajec5@gmail.com>
      Cc: James Cowgill <James.Cowgill@imgtec.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alex Smith <alex.smith@imgtec.com>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
      Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Roland McGrath <roland@hack.frob.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Kalle Valo <kvalo@qca.qualcomm.com>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Tony Wu <tung7970@gmail.com>
      Cc: Huaitong Han <huaitong.han@intel.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrea Gelmini <andrea.gelmini@gelma.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: "Maciej W. Rozycki" <macro@imgtec.com>
      Cc: David Daney <david.daney@cavium.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      97f2645f
  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. 24 7月, 2016 2 次提交
  8. 28 5月, 2016 1 次提交
  9. 13 5月, 2016 4 次提交
  10. 25 2月, 2016 1 次提交
  11. 24 1月, 2016 1 次提交
  12. 11 11月, 2015 3 次提交
  13. 09 7月, 2015 1 次提交
    • M
      MIPS: kernel: smp-cps: Fix 64-bit compatibility errors due to pointer casting · fd5ed306
      Markos Chandras 提交于
      Commit 1d8f1f5a ("MIPS: smp-cps: hotplug support") added hotplug
      support in the SMP/CPS implementation but it introduced a few build problems
      on 64-bit kernels due to pointer being casted to and from 'int' C types. We
      fix this problem by using 'unsigned long' instead which should match the size
      of the pointers in 32/64-bit kernels. Finally, we fix the comment since the
      CM base address is loaded to v1($3) instead of v0.
      
      Fixes the following build problems:
      
      arch/mips/kernel/smp-cps.c: In function 'wait_for_sibling_halt':
      arch/mips/kernel/smp-cps.c:366:17: error: cast from pointer to integer of
      different size [-Werror=pointer-to-int-cast]
      [...]
      arch/mips/kernel/smp-cps.c: In function 'cps_cpu_die':
      arch/mips/kernel/smp-cps.c:427:13: error: cast to pointer
      from integer of different size [-Werror=int-to-pointer-cast]
      
      cc1: all warnings being treated as errors
      
      Fixes: 1d8f1f5a ("MIPS: smp-cps: hotplug support")
      Cc: <stable@vger.kernel.org> # 3.16+
      Reviewed-by: NPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/10586/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fd5ed306
  14. 16 5月, 2015 1 次提交
  15. 10 4月, 2015 1 次提交
  16. 05 3月, 2015 1 次提交
  17. 24 11月, 2014 2 次提交
  18. 31 7月, 2014 2 次提交
  19. 16 6月, 2014 1 次提交
  20. 28 5月, 2014 8 次提交
    • P
      MIPS: smp-cps: duplicate core0 CCA on secondary cores · 0155a065
      Paul Burton 提交于
      Rather than hardcoding CCA=0x5 for secondary cores, re-use the CCA from
      the boot CPU. This allows overrides of the CCA using the cca= kernel
      parameter to take effect on all CPUs for consistency.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      0155a065
    • P
      MIPS: smp-cps: set a coherent default CCA · 33b68665
      Paul Burton 提交于
      This patch sets a default CCA suited for use with multi-core SMP on all
      current MIPS CPS based systems. It may still be overriden by the cca=
      argument on the kernel command line.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      33b68665
    • P
      MIPS: smp-cps: prevent multi-core SMP with unsuitable CCA · 5c399f6e
      Paul Burton 提交于
      If the user or bootloader sets the CCA to a value which is not suited
      for multi-core SMP (ie. anything non-coherent) then limit the system to
      using only a single core and warn the user.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      5c399f6e
    • P
      MIPS: smp-cps: hotplug support · 1d8f1f5a
      Paul Burton 提交于
      This patch adds support for offlining CPUs via hotplug when using the
      CONFIG_MIPS_CPS SMP implementation. When a CPU is offlined one of 2
      things will happen:
      
        - If the CPU is part of a core which implements the MT ASE and there
          is at least one other VPE online within that core then the VPE will
          be halted by settings its TCHalt bit.
      
        - Otherwise if supported the core will be powered down via the CPC.
      
        - Otherwise the CPU will hang by executing an infinite loop.
      
      Bringing CPUs back online is then a process of either clearing the
      appropriate VPEs TCHalt bit or powering up the appropriate core via the
      CPC. Throughout the process the struct core_boot_config vpe_mask field
      must be maintained such that mips_cps_boot_vpes will start & stop the
      correct VPEs.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      1d8f1f5a
    • P
      MIPS: smp-cps: use CPC core-other locking · dd9233d0
      Paul Burton 提交于
      The core which the CPC core-other region relates to is based upon the
      core-local core-other addressing register. As its name suggests this
      register is shared between all VPEs within a core, and if there is a
      possibility that multiple VPEs within a core will attempt to access
      another core simultaneously then locking is required. This wasn't
      previously a problem with the only user being cpu0 during boot, but will
      be an issue once hotplug is implemented & may race with other users such
      as cpuidle.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      dd9233d0
    • P
      MIPS: smp-cps: flush cache after patching mips_cps_core_entry · 0f4d3d11
      Paul Burton 提交于
      The start of mips_cps_core_entry is patched in order to provide the code
      with the address of the CM register region at a point where it will be
      running non-coherent with the rest of the system. However the cache
      wasn't being flushed after that patching which could in principle lead
      to secondary cores using an invalid CM base address.
      
      The patching is moved to cps_prepare_cpus since local_flush_icache_range
      has not been initialised at the point cps_smp_setup is called.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      0f4d3d11
    • P
      MIPS: smp-cps: function to determine whether CPS SMP is in use · 68c1232f
      Paul Burton 提交于
      The core power down state for cpuidle will require that the CPS SMP
      implementation is in use. This patch provides a mips_cps_smp_in_use
      function which determines whether or not the CPS SMP implementation is
      currently in use.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      68c1232f
    • P
      MIPS: smp-cps: rework core/VPE initialisation · 245a7868
      Paul Burton 提交于
      When hotplug and/or a powered down idle state are supported cases will
      arise where a non-zero VPE must be brought online without VPE 0, and it
      where multiple VPEs must be onlined simultaneously. This patch prepares
      for that by:
      
        - Splitting struct boot_config into core & VPE boot config structures,
          allocated one per core or VPE respectively. This allows for multiple
          VPEs to be onlined simultaneously without clobbering each others
          configuration.
      
        - Indicating which VPEs should be online within a core at any given
          time using a bitmap. This allows multiple VPEs to be brought online
          simultaneously and also indicates to VPE 0 whether it should halt
          after starting any non-zero VPEs that should be online within the
          core. For example if all VPEs within a core are offlined via hotplug
          and the user onlines the second VPE within that core:
      
            1) The core will be powered up.
      
            2) VPE 0 will run from the BEV (ie. mips_cps_core_entry) to
               initialise the core.
      
            3) VPE 0 will start VPE 1 because its bit is set in the cores
               bitmap.
      
            4) VPE 0 will halt itself because its bit is clear in the cores
               bitmap.
      
        - Moving the core & VPE initialisation to assembly code which does not
          make any use of the stack. This is because if a non-zero VPE is to
          be brought online in a powered down core then when VPE 0 of that
          core runs it may not have a valid stack, and even if it did then
          it's messy to run through parts of generic kernel code on VPE 0
          before starting the correct VPE.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      245a7868
  21. 27 5月, 2014 1 次提交
  22. 27 3月, 2014 1 次提交