1. 04 9月, 2017 2 次提交
  2. 30 8月, 2017 9 次提交
  3. 29 8月, 2017 2 次提交
    • P
      MIPS: CM: Use BIT/GENMASK for register fields, order & drop shifts · 93c5bba5
      Paul Burton 提交于
      There's no reason for us not to use BIT() & GENMASK() in asm/mips-cm.h
      when declaring macros corresponding to register fields. This patch
      modifies our definitions to do so.
      
      The *_SHF definitions are removed entirely - they duplicate information
      found in the masks, are infrequently used & can be replaced with use of
      __ffs() where needed.
      
      The *_MSK definitions then lose their _MSK suffix which is now somewhat
      redundant, and users are modified to match.
      
      The field definitions are moved to follow the appropriate register's
      accessor functions, which helps to keep the field definitions in order &
      to find the appropriate fields for a given register. Whilst here a
      comment is added describing each register & including its name, which is
      helpful both for linking the register back to hardware documentation &
      for grepping purposes.
      
      This also cleans up a couple of issues that became obvious as a result
      of making the changes described above:
      
        - We previously had definitions for GCR_Cx_RESET_EXT_BASE & a phony
          copy of that named GCR_RESET_EXT_BASE - a register which does not
          exist. The bad definitions were added by commit 497e803e ("MIPS:
          smp-cps: Ensure secondary cores start with EVA disabled") and made
          use of from boot_core(), which is now modified to use the
          GCR_Cx_RESET_EXT_BASE definitions.
      
        - We had a typo in CM_GCR_ERROR_CAUSE_ERRINGO_MSK - we now correctly
          define this as inFo rather than inGo.
      
      Now that we don't duplicate field information between _SHF & _MSK
      definitions, and keep the fields next to the register accessors, it will
      be much easier to spot & prevent any similar oddities being introduced
      in the future.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: Thomas Gleixner <tglx@linutronix.de
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/17001/
      Patchwork: https://patchwork.linux-mips.org/patch/17216/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      93c5bba5
    • 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
  4. 29 6月, 2017 2 次提交
    • P
      MIPS: CPS: Handle cores not powering down more gracefully · 4ad755c9
      Paul Burton 提交于
      If we get into a state where a core that ought to power down isn't doing
      so then the current result is that another CPU gets stuck inside
      cps_cpu_die() waiting for CPU that ought to be powering down to do so.
      The best case scenario is that we then trigger RCU stall messages or
      lockup messages, but neither makes it particularly clear what's
      happening.
      
      Handle this more gracefully by introducing a timeout beyond which we
      warn the user that the core didn't power down & stop waiting for it.
      This at least allows the CPU running cps_cpu_die() to continue normally,
      and hopefully presuming the CPU that powered back up is doing nothing
      harmful the system will continue functioning as normal.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16197/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4ad755c9
    • P
      MIPS: CPS: Prevent multi-core with dcache aliasing · 5570ba2e
      Paul Burton 提交于
      Systems using the MIPS Coherence Manager (CM) cannot support multi-core
      SMP with dcache aliasing. This is because CPU caches are VIPT, but
      interventions in CM-based systems provide only the physical address to
      remote caches. This means that interventions may behave incorrectly in
      the presence of an aliasing dcache, since the physical address used
      when handling an intervention may lead to operation on an aliased cache
      line rather than the correct line.
      
      Prevent us from running into this issue by refusing to boot secondary
      cores in systems where dcache aliasing may occur.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/16196/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5570ba2e
  5. 13 4月, 2017 1 次提交
    • M
      MIPS: smp-cps: Fix potentially uninitialised value of core · bac06cf0
      Matt Redfearn 提交于
      Turning on DEBUG in smp-cps.c, or compiling the kernel with
      CONFIG_DYNAMIC_DEBUG enabled results the build error:
      
      arch/mips/kernel/smp-cps.c: In function 'play_dead':
      ./include/linux/dynamic_debug.h:126:3: error: 'core' may be used
      uninitialized in this function [-Werror=maybe-uninitialized]
      
      Fix this by always initialising the variable.
      
      Fixes: 0d2808f3 ("MIPS: smp-cps: Add support for CPU hotplug of MIPSr6 processors")
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/15848/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      bac06cf0
  6. 12 4月, 2017 1 次提交
  7. 03 3月, 2017 1 次提交
  8. 02 3月, 2017 1 次提交
  9. 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
  10. 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
  11. 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
  12. 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
  13. 24 7月, 2016 2 次提交
  14. 28 5月, 2016 1 次提交
  15. 13 5月, 2016 4 次提交
  16. 25 2月, 2016 1 次提交
  17. 24 1月, 2016 1 次提交
  18. 11 11月, 2015 3 次提交
  19. 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
  20. 16 5月, 2015 1 次提交
  21. 10 4月, 2015 1 次提交
  22. 05 3月, 2015 1 次提交