1. 05 7月, 2016 2 次提交
    • P
      irqchip/mips-gic: Match IPI IRQ domain by bus token only · 547aefc4
      Paul Burton 提交于
      Commit fbde2d7d ("MIPS: Add generic SMP IPI support") introduced
      code which calls irq_find_matching_host with a NULL node parameter in
      order to discover IPI IRQ domains which are not associated with the DT
      root node's interrupt parent. This suggests that implementations of IPI
      IRQ domains should effectively ignore the node parameter if it is NULL
      and search purely based upon the bus token. Commit 2af70a96
      ("irqchip/mips-gic: Add a IPI hierarchy domain") did not do this when
      implementing the GIC IPI IRQ domain, and on MIPS Boston boards this
      leads to no IPI domain being discovered and a NULL pointer dereference
      when attempting to send an IPI:
      
        CPU 0 Unable to handle kernel paging request at virtual address 0000000000000040, epc == ffffffff8016e70c, ra == ffffffff8010ff5c
        Oops[#1]:
        CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc6-00223-gad0d1b6 #945
        task: a8000000ff066fc0 ti: a8000000ff068000 task.ti: a8000000ff068000
        $ 0   : 0000000000000000 0000000000000001 ffffffff80730000 0000000000000003
        $ 4   : 0000000000000000 ffffffff8057e5b0 a800000001e3ee00 0000000000000000
        $ 8   : 0000000000000000 0000000000000023 0000000000000001 0000000000000001
        $12   : 0000000000000000 ffffffff803323d0 0000000000000000 0000000000000000
        $16   : 0000000000000000 0000000000000000 0000000000000001 ffffffff801108fc
        $20   : 0000000000000000 ffffffff8057e5b0 0000000000000001 0000000000000000
        $24   : 0000000000000000 ffffffff8012de28
        $28   : a8000000ff068000 a8000000ff06fbc0 0000000000000000 ffffffff8010ff5c
        Hi    : ffffffff8014c174
        Lo    : a800000001e1e140
        epc   : ffffffff8016e70c __ipi_send_mask+0x24/0x11c
        ra    : ffffffff8010ff5c mips_smp_send_ipi_mask+0x68/0x178
        Status: 140084e2        KX SX UX KERNEL EXL
        Cause : 00800008 (ExcCode 02)
        BadVA : 0000000000000040
        PrId  : 0001a920 (MIPS I6400)
        Process swapper/0 (pid: 1, threadinfo=a8000000ff068000, task=a8000000ff066fc0, tls=0000000000000000)
        Stack : 0000000000000000 0000000000000000 0000000000000001 ffffffff801108fc
                  0000000000000000 ffffffff8057e5b0 0000000000000001 ffffffff8010ff5c
                  0000000000000001 0000000000000020 0000000000000000 0000000000000000
                  0000000000000000 ffffffff801108fc 0000000000000000 0000000000000001
                  0000000000000001 0000000000000000 0000000000000000 ffffffff801865e8
                  a8000000ff0c7500 a8000000ff06fc90 0000000000000001 0000000000000002
                  ffffffff801108fc ffffffff801868b8 0000000000000000 ffffffff801108fc
                  0000000000000000 0000000000000003 ffffffff8068c700 0000000000000001
                  ffffffff80730000 0000000000000001 a8000000ff00a290 ffffffff80110c50
                  0000000000000003 a800000001e48308 0000000000000003 0000000000000008
                  ...
        Call Trace:
        [<ffffffff8016e70c>] __ipi_send_mask+0x24/0x11c
        [<ffffffff8010ff5c>] mips_smp_send_ipi_mask+0x68/0x178
        [<ffffffff801865e8>] generic_exec_single+0x150/0x170
        [<ffffffff801868b8>] smp_call_function_single+0x108/0x160
        [<ffffffff80110c50>] cps_boot_secondary+0x328/0x394
        [<ffffffff80110534>] __cpu_up+0x38/0x90
        [<ffffffff8012de4c>] bringup_cpu+0x24/0xac
        [<ffffffff8012df40>] cpuhp_up_callbacks+0x58/0xdc
        [<ffffffff8012e648>] cpu_up+0x118/0x18c
        [<ffffffff806dc158>] smp_init+0xbc/0xe8
        [<ffffffff806d4c18>] kernel_init_freeable+0xa0/0x228
        [<ffffffff8056c908>] kernel_init+0x10/0xf0
        [<ffffffff80105098>] ret_from_kernel_thread+0x14/0x1c
      
      Fix this by allowing the GIC IPI IRQ domain to match purely based upon
      the bus token if the node provided is NULL.
      
      Fixes: 2af70a96 ("irqchip/mips-gic: Add a IPI hierarchy domain")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160705132600.27730-2-paul.burton@imgtec.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      547aefc4
    • P
      irqchip/mips-gic: Map to VPs using HW VPNum · 99ec8a36
      Paul Burton 提交于
      When mapping an interrupt to a VP(E) we must use the identifier for the
      VP that the hardware expects, and this does not always match up with the
      Linux CPU number. Commit d46812bb ("irqchip: mips-gic: Use HW IDs
      for VPE_OTHER_ADDR") corrected this for the cases that existed at the
      time it was written, but commit 2af70a96 ("irqchip/mips-gic: Add a
      IPI hierarchy domain") added another case before the former patch was
      merged. This leads to incorrectly using Linux CPU numbers when mapping
      interrupts to VPs, which breaks on certain systems such as those with
      multi-core I6400 CPUs. Fix by adding the appropriate call to
      mips_cm_vp_id() to retrieve the expected VP identifier.
      
      Fixes: d46812bb ("irqchip: mips-gic: Use HW IDs for VPE_OTHER_ADDR")
      Fixes: 2af70a96 ("irqchip/mips-gic: Add a IPI hierarchy domain")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160705132600.27730-1-paul.burton@imgtec.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      99ec8a36
  2. 14 6月, 2016 1 次提交
    • H
      irqchip/mips-gic: Fix IRQs in gic_dev_domain · 4b2312bd
      Harvey Hunt 提交于
      When allocating a new device IRQ, gic_dev_domain_alloc() correctly calls
      irq_domain_set_hwirq_and_chip(), but gic_irq_domain_alloc() does not. This
      means that gic_irq_domain believes all IRQs from the dev domain have an
      hwirq of 0 and creates incorrect mappings in the linear_revmap. As
      gic_irq_domain is a parent of the gic_dev_domain, this leads to an
      inability to boot on devices with a GIC. Excerpt of the error:
      
      [    2.297649] irq 0: nobody cared (try booting with the "irqpoll" option)
      ...
      [    2.436963] handlers:
      [    2.439492] Disabling IRQ #0
      
      Fix this by calling irq_domain_set_hwirq_and_chip() for both the dev and
      irq domain.
      
      Now that we are modifying the parent domain, be sure to clear it up in
      case of an allocation error.
      
      Fixes: c98c1822 ("irqchip/mips-gic: Add device hierarchy domain")
      Fixes: 2af70a96 ("irqchip/mips-gic: Add a IPI hierarchy domain")
      Signed-off-by: NHarvey Hunt <harvey.hunt@imgtec.com>
      Tested-by: Govindraj Raja <Govindraj.Raja@imgtec.com> # On Pistachio SoC
      Reviewed-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: jason@lakedaemon.net
      Cc: marc.zyngier@arm.com
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1464001552-31174-1-git-send-email-harvey.hunt@imgtec.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      4b2312bd
  3. 28 5月, 2016 1 次提交
  4. 13 5月, 2016 2 次提交
  5. 22 4月, 2016 1 次提交
    • P
      irqchip/mips-gic: Don't overrun pcpu_masks array · 91951f98
      Paul Burton 提交于
      Commit 2a078705 ("irqchip/mips-gic: Use gic_vpes instead of
      NR_CPUS") & commit 78930f09 ("irqchip/mips-gic: Clear percpu_masks
      correctly when mapping") both introduce code which accesses gic_vpes
      entries in the pcpu_masks array. However, this array has length NR_CPUS.
      If NR_CPUS is less than gic_vpes (ie. the kernel supports use of less
      CPUs than are present in the system) then we overrun the array, clobber
      some other data & generally die pretty promptly.
      
      Most notably this affects uniprocessor kernels running on any multicore
      or multithreaded Malta with a GIC (ie. the vast majority of real Malta
      boards).
      
      Fix this by only accessing up to min(gic_vpes, NR_CPUS) entries in the
      pcpu_masks array, preventing the array overrun.
      
      Fixes: 2a078705 ("irqchip/mips-gic: Use gic_vpes instead of NR_CPUS")
      Fixes: 78930f09 ("irqchip/mips-gic: Clear percpu_masks correctly when mapping")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Link: http://lkml.kernel.org/r/1461234714-9975-1-git-send-email-paul.burton@imgtec.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      91951f98
  6. 25 2月, 2016 6 次提交
  7. 11 11月, 2015 1 次提交
    • A
      irqchip: irq-mips-gic: Provide function to map GIC user section · c0a9f72c
      Alex Smith 提交于
      The GIC provides a "user-mode visible" section containing a mirror of
      the counter registers which can be mapped into user memory. This will
      be used by the VDSO time function implementations, so provide a
      function to map it in.
      
      When the GIC is not enabled in Kconfig a dummy inline version of this
      function is provided, along with "#define gic_present 0", so that we
      don't have to litter the VDSO code with ifdefs.
      
      [markos.chandras@imgtec.com:
        - Move mapping code to arch/mips/kernel/vdso.c and use a resource
          type to get the GIC usermode information
        - Avoid renaming function arguments and use __gic_base_addr to hold
          the base GIC address prior to ioremap.]
      [ralf@linux-mips.org: Fix up gic_get_usm_range() to compile and make inline
      again.]
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alex Smith <alex.smith@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/11281/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c0a9f72c
  8. 27 9月, 2015 2 次提交
  9. 16 9月, 2015 1 次提交
    • T
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner 提交于
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
  10. 26 8月, 2015 2 次提交
  11. 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
  12. 12 7月, 2015 3 次提交
  13. 10 7月, 2015 1 次提交
    • J
      MIPS: Malta: Make GIC FDC IRQ workaround Malta specific · 6249ecbb
      James Hogan 提交于
      Wider testing reveals that the Fast Debug Channel (FDC) interrupt is
      routed through the GIC just fine on Pistachio SoC, even though it
      contains interAptiv cores. Clearly the FDC interrupt routing problems
      previously observed on interAptiv and proAptiv cores are specific to the
      Malta FPGA bitstreams.
      
      Move the workaround for interAptiv and proAptiv out of
      gic_get_c0_fdc_int() in the GIC irqchip driver into Malta's
      get_c0_fdc_int() platform callback, to allow the Pistachio SoC to use
      the FDC interrupt.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: linux-mips@linux-mips.org
      Reviewed-by: NAndrew Bresticker <abrestic@chromium.org>
      Cc: James Hartley <james.hartley@imgtec.com>
      Patchwork: http://patchwork.linux-mips.org/patch/9748/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6249ecbb
  14. 13 6月, 2015 1 次提交
  15. 05 5月, 2015 1 次提交
  16. 31 3月, 2015 4 次提交
  17. 30 3月, 2015 1 次提交
  18. 05 3月, 2015 1 次提交
  19. 05 2月, 2015 2 次提交
    • J
      MIPS: cevt-r4k: Drop GIC special case · ae58d882
      James Hogan 提交于
      The cevt-r4k driver used to call into the GIC driver to find whether the
      timer was pending, but only with External Interrupt Controller (EIC)
      mode, where the Cause.IP bits can't be used as they encode the interrupt
      priority level (Cause.RIPL) instead.
      
      However commit e9de688d ("irqchip: mips-gic: Support local
      interrupts") changed the condition from cpu_has_veic to gic_present.
      This fails on cores such as P5600 which have a GIC but the local
      interrupts aren't routable by the GIC, causing c0_compare_int_usable()
      to consider the interrupt unusable so r4k_clockevent_init() fails.
      
      The previous behaviour, added in commit 98b67c37 ("MIPS: Add EIC
      support for GIC."), wasn't really correct either as far as I can tell,
      since P5600 apparently supports EIC mode too, and in any case the use of
      Cause.TI with r2 should have been sufficient anyway since commit
      010c108d ("MIPS: PowerTV: Fix support for timer interrupts with > 64
      external IRQs").
      
      Therefore drop the call into the gic driver altogether, and add a
      comment in c0_compare_int_pending() to clarify that Cause.TI does get
      checked since MIPS r2.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Fixes: e9de688d ("irqchip: mips-gic: Support local interrupts")
      Reviewed-by: NAndrew Bresticker <abrestic@chromium.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Steven J. Hill <steven.hill@imgtec.com>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/9077/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ae58d882
    • J
      IRQCHIP: mips-gic: Avoid rerouting timer IRQs for smp-cmp · 1b6af71a
      James Hogan 提交于
      Commit e9de688d ("irqchip: mips-gic: Support local interrupts")
      changed the GIC irqchip driver so that all local interrupts were routed
      to the same CPU pin used for external interrupts. Unfortunately this
      causes a regression when smp-cmp is used. The CPUs are started by the
      bootloader and put in a timer based waiting poll loop, but when their
      timer interrupts are rerouted to a different IRQ pin which is not
      unmasked they never wake up.
      
      Since smp-cmp support is deprecated and everybody who was using it
      should be switching to smp-cps which brings up the secondary CPUs
      without bootloader assistance, I've gone for the simple fix which can be
      easily removed once smp-cmp is removed, rather than a fully generic fix.
      
      In __gic_init() the local GIC_VPE_TIMER_MAP register is read to find the
      boot-time routing of the local timer interrupt, and a chained handler is
      added to that CPU pin as well as the normal one.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Fixes: e9de688d ("irqchip: mips-gic: Support local interrupts")
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Qais Yousef <qais.yousef@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Reviewed-by: NAndrew Bresticker <abrestic@chromium.org>
      Patchwork: https://patchwork.linux-mips.org/patch/9081/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1b6af71a
  20. 26 1月, 2015 1 次提交
  21. 24 11月, 2014 5 次提交