1. 20 4月, 2017 1 次提交
  2. 13 4月, 2017 11 次提交
    • R
      Merge branch '4.11-fixes' into mips-for-linux-next · e469b23c
      Ralf Baechle 提交于
      e469b23c
    • P
      MIPS: Remove confusing else statement in __do_page_fault() · 72f941af
      Paul Burton 提交于
      Commit 41c594ab ("[MIPS] MT: Improved multithreading support.")
      added an else case to an if statement in do_page_fault() (which has
      since gained 2 leading underscores) for some unclear reason. If the
      condition in the if statement evaluates true then we execute a goto &
      branch elsewhere anyway, so the else has no effect. Combined with an #if
      0 block with misleading indentation introduced in the same commit it
      makes the code less clear than it could be.
      
      Remove the unnecessary else statement & de-indent the printk within
      the #if 0 block in order to make the code easier for humans to parse.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: trivial@kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15842/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      72f941af
    • P
      MIPS: Stengthen IPI IRQ domain sanity check · e6488982
      Paul Burton 提交于
      Commit fbde2d7d ("MIPS: Add generic SMP IPI support") introduced a
      sanity check that an IPI IRQ domain can be found during boot, in order
      to ensure that IPIs are able to be set up in systems using such domains.
      However it was added at a point where systems may have used an IPI IRQ
      domain in some situations but not others, and we could not know which
      were the case until runtime, so commit 578bffc8 ("MIPS: Don't BUG_ON
      when no IPI domain is found") made that check simply skip IPI init if no
      domain were found in order to fix the boot for systems such as QEMU
      Malta.
      
      We now use IPI IRQ domains for the MIPS CPU interrupt controller, which
      means systems which make use of IPI IRQ domains will always do so when
      running on multiple CPUs. As a result we now strengthen the sanity check
      to ensure that an IPI IRQ domain is found when multiple CPUs are present
      in the system.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15838/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e6488982
    • P
      MIPS: smp-mt: Use CPU interrupt controller IPI IRQ domain support · 1eed4004
      Paul Burton 提交于
      Remove the smp-mt IPI code that supported single-core multithreaded
      systems and instead make use of the IPI IRQ domain support provided by
      the MIPS CPU interrupt controller driver. This removes some less than
      nice code, the horrible split between arch & board code and the
      duplication that led to within board code.
      
      The lantiq portion of this patch has only been compile tested. Malta has
      been tested & is functional.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15837/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1eed4004
    • P
      irqchip: mips-cpu: Introduce IPI IRQ domain support · 3838a547
      Paul Burton 提交于
      Introduce support for registering an IPI IRQ domain suitable for use by
      systems using the MIPS MT (multithreading) ASE within a single core.
      This will allow for such systems to be supported generically, without
      the current kludge of IPI code split between the MIPS arch & the malta
      board support code.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15836/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      3838a547
    • P
      irqchip: mips-cpu: Prepare for non-legacy IRQ domains · 131735af
      Paul Burton 提交于
      The various struct irq_chip callbacks in the MIPS CPU interrupt
      controller driver have been calculating the hardware interrupt number by
      subtracting MIPS_CPU_IRQ_BASE from the virq number. This presumes a
      linear mapping beginning from MIPS_CPU_IRQ_BASE, and this will not hold
      once an IPI IRQ domain is introduced. Switch to using the hwirq field of
      struct irq_data which already contains the hardware interrupt number
      instead of attempting to calculate it.
      
      Similarly, plat_irq_dispatch calculated the virq number by adding
      MIPS_CPU_IRQ_BASE to the hardware interrupt number. Ready this for the
      introduction of an IPI IRQ domain by instead using irq_linear_revmap.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15835/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      131735af
    • P
      irqchip: mips-cpu: Replace magic 0x100 with IE_SW0 · c0cfbe69
      Paul Burton 提交于
      Replace use of the magic number 0x100 (ie. bit 8) with the more
      explanatory IE_SW0 (ie. interrupt enable for software interrupt 0) or
      C_SW0 (ie. cause bit for software interrupt 0) as appropriate.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15834/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c0cfbe69
    • J
      MIPS: KGDB: Use kernel context for sleeping threads · 162b270c
      James Hogan 提交于
      KGDB is a kernel debug stub and it can't be used to debug userland as it
      can only safely access kernel memory.
      
      On MIPS however KGDB has always got the register state of sleeping
      processes from the userland register context at the beginning of the
      kernel stack. This is meaningless for kernel threads (which never enter
      userland), and for user threads it prevents the user seeing what it is
      doing while in the kernel:
      
      (gdb) info threads
        Id   Target Id         Frame
        ...
        3    Thread 2 (kthreadd) 0x0000000000000000 in ?? ()
        2    Thread 1 (init)   0x000000007705c4b4 in ?? ()
        1    Thread -2 (shadowCPU0) 0xffffffff8012524c in arch_kgdb_breakpoint () at arch/mips/kernel/kgdb.c:201
      
      Get the register state instead from the (partial) kernel register
      context stored in the task's thread_struct for resume() to restore. All
      threads now correctly appear to be in context_switch():
      
      (gdb) info threads
        Id   Target Id         Frame
        ...
        3    Thread 2 (kthreadd) context_switch (rq=<optimized out>, cookie=..., next=<optimized out>, prev=0x0) at kernel/sched/core.c:2903
        2    Thread 1 (init)   context_switch (rq=<optimized out>, cookie=..., next=<optimized out>, prev=0x0) at kernel/sched/core.c:2903
        1    Thread -2 (shadowCPU0) 0xffffffff8012524c in arch_kgdb_breakpoint () at arch/mips/kernel/kgdb.c:201
      
      Call clobbered registers which aren't saved and exception registers
      (BadVAddr & Cause) which can't be easily determined without stack
      unwinding are reported as 0. The PC is taken from the return address,
      such that the state presented matches that found immediately after
      returning from resume().
      
      Fixes: 88547001 ("[MIPS] kgdb: add arch support for the kernel's kgdb core")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: linux-mips@linux-mips.org
      Cc: stable@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15829/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      162b270c
    • P
      MIPS: Remove CONFIG_ARCH_HAS_ILOG2_U{32,64} · ca452b95
      Paul Burton 提交于
      We declare CONFIG_ARCH_HAS_ILOG2_U32 & CONFIG_ARCH_HAS_ILOG2_U64 in
      Kconfig, but they are always false since nothing ever selects them. The
      generic fls-based implementation is efficient for MIPS anyway. Remove
      the redundant Kconfig entries.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: trivial@kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15840/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ca452b95
    • 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
    • M
      MIPS: generic: Enable Root FS on NFS in generic_defconfig · f110cc4f
      Matt Redfearn 提交于
      The generic_defconfig is used for platforms like SEAD3 which do not
      usually have fixed storage available, therefore NFS is the preferred
      location of the RFS.
      When the upstream kernel defconfig is built & tested on platforms such
      as SEAD3 this leads to essentially false failures when the RFS fails to
      mount.
      
      There is little harm in having this feature enabled by default, so
      enable it in the defconfig. Kernel autoconfiguration & DHCP must also be
      selected to allow RFS on NFS.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/15853/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f110cc4f
  3. 12 4月, 2017 9 次提交
  4. 11 4月, 2017 1 次提交
    • M
      MIPS: generic: fix out-of-tree defconfig target builds · 337b775b
      Marcin Nowakowski 提交于
      When specifying a generic defconfig target with O=... option set, make
      is invoked in the output location before a target makefile wrapper is
      created. Ensure that the correct makefile is used by specifying the
      kernel source makefile during make invocation.
      
      This fixes the either of the following errors:
      
      $ make sead3_defoncifg ARCH=mips O=test
      make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
      make[2]: *** No rule to make target '32r2el_defconfig'.  Stop.
      arch/mips/Makefile:506: recipe for target 'sead3_defconfig' failed
      make[1]: *** [sead3_defconfig] Error 2
      make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
      Makefile:152: recipe for target 'sub-make' failed
      make: *** [sub-make] Error 2
      
      $ make 32r2el_defconfig ARCH=mips O=test
      make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
      Using ../arch/mips/configs/generic_defconfig as base
      Merging ../arch/mips/configs/generic/32r2.config
      Merging ../arch/mips/configs/generic/el.config
      Merging ../arch/mips/configs/generic/board-sead-3.config
      !
      ! merged configuration written to .config (needs make)
      !
      make[2]: *** No rule to make target 'olddefconfig'.  Stop.
      arch/mips/Makefile:489: recipe for target '32r2el_defconfig' failed
      make[1]: *** [32r2el_defconfig] Error 2
      make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
      Makefile:152: recipe for target 'sub-make' failed
      make: *** [sub-make] Error 2
      
      Fixes: eed0eabd ('MIPS: generic: Introduce generic DT-based board support')
      Fixes: 3f5f0a44 ('MIPS: generic: Convert SEAD-3 to a generic board')
      Signed-off-by: NMarcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15464/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      337b775b
  5. 10 4月, 2017 18 次提交