1. 30 4月, 2012 2 次提交
    • G
      powerpc/irqdomain: Fix broken NR_IRQ references · 4013369f
      Grant Likely 提交于
      The switch from using irq_map to irq_alloc_desc*() for managing irq
      number allocations introduced new bugs in some of the powerpc
      interrupt code.  Several functions rely on the value of NR_IRQS to
      determine the maximum irq number that could get allocated.  However,
      with sparse_irq and using irq_alloc_desc*() the maximum possible irq
      number is now specified with 'nr_irqs' which may be a number larger
      than NR_IRQS.  This has caused breakage on powermac when
      CONFIG_NR_IRQS is set to 32.
      
      This patch removes most of the direct references to NR_IRQS in the
      powerpc code and replaces them with either a nr_irqs reference or by
      using the common for_each_irq_desc() macro.  The powerpc-specific
      for_each_irq() macro is removed at the same time.
      
      Also, the Cell axon_msi driver is refactored to remove the global
      build assumption on the size of NR_IRQS and instead add a limit to the
      maximum irq number when calling irq_domain_add_nomap().
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4013369f
    • G
      powerpc/8xx: Fix NR_IRQ bugs and refactor 8xx interrupt controller · 8751ed14
      Grant Likely 提交于
      The mpc8xx driver uses a reference to NR_IRQS that is buggy.  It uses
      NR_IRQs for the array size of the ppc_cached_irq_mask bitmap, but
      NR_IRQs could be smaller than the number of hardware irqs that
      ppc_cached_irq_mask tracks.
      
      Also, while fixing that problem, it became apparent that the interrupt
      controller only supports 32 interrupt numbers, but it is written as if
      it supports multiple register banks which is more complicated.
      
      This patch pulls out the buggy reference to NR_IRQs and fixes the size
      of the ppc_cached_irq_mask to match the number of HW irqs.  It also
      drops the now-unnecessary code since ppc_cached_irq_mask is no longer
      an array.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8751ed14
  2. 23 4月, 2012 4 次提交
    • B
      powerpc/mpic: Properly set default triggers · 446f6d06
      Benjamin Herrenschmidt 提交于
      This gets rid of the unused default senses array, and replaces the
      incorrect use of IRQ_TYPE_NONE with the new IRQ_TYPE_DEFAULT for
      the initial set_trigger() call when mapping an interrupt.
      
      This in turn makes us read the HW state and update the irq desc
      accordingly.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      446f6d06
    • B
      powerpc/mpic: Fix confusion between hw_irq and virq · 3a2b4f7c
      Benjamin Herrenschmidt 提交于
      mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.
      
      However, one of the two call sites calls it with a ... hw_irq. The
      other call site also happens to have the hw_irq at hand, so let's
      change it to just take that as an argument. Also change mpic_is_tm()
      for consistency.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3a2b4f7c
    • B
      powerpc/pmac: Don't add_timer() twice · 3027691e
      Benjamin Herrenschmidt 提交于
      If the interrupt and the timeout happen roughly at the same
      time, we can get into a situation where the timer function
      is run while the interrupt has already been processed. In
      this case, the timer function might end up doing an add_timer
      on an already pending timer, causing a BUG_ON() to trigger.
      
      Instead, just skip the whole timeout operation if we see that
      the timer is pending. The spinlock ensures that the only way
      that happens is if we already started a new operation and thus
      the timeout can be ignored.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3027691e
    • G
      powerpc/eeh: Fix crash caused by null eeh_dev · 2ef822c5
      Gavin Shan 提交于
      The problem was reported by Anton Blanchard. While EEH error
      happened to the PCI device without the corresponding device
      driver, kernel crash was seen. Eventually, I successfully
      reproduced the problem on Firebird-L machine with utility
      "errinjct". Initially, the device driver for Emulex ethernet
      MAC has been disabled from .config and force data parity on
      the Emulex ethernet MAC with help of "errinjct". Eventually,
      I saw the kernel crash after issueing couple of "lspci -v"
      command.
      
      The root cause behind is that the PCI device, including the
      reference to the corresponding eeh device, will be removed
      from the system while EEH does recovery. Afterwards, the
      PCI device will be probed again and added into the system
      accordingly. So it's not safe to retrieve the eeh device from
      the corresponding PCI device after the PCI device has been removed
      and not added again.
      
      The patch fixes the issue and retrieve the eeh device from OF node
      instead of PCI device after the PCI device has been removed.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Tested-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2ef822c5
  3. 20 4月, 2012 6 次提交
  4. 19 4月, 2012 1 次提交
    • P
      powerpc: fix system.h fallout in sysdev/scom.c [chroma_defconfig] · 1bc68a9e
      Paul Gortmaker 提交于
      The following shows up in chroma_defconfig:
      
       CC      arch/powerpc/sysdev/scom.o
      arch/powerpc/sysdev/scom.c: In function 'scom_debug_init':
      arch/powerpc/sysdev/scom.c:182:36: error: 'powerpc_debugfs_root' undeclared (first use in this function)
      arch/powerpc/sysdev/scom.c:182:36: note: each undeclared identifier is reported only once for each function it appears in
      make[2]: *** [arch/powerpc/sysdev/scom.o] Error 1
      make[1]: *** [arch/powerpc/sysdev/scom.o] Error 2
      
      A bisect leads to commit 9ffc93f2
      
          "Remove all #inclusions of asm/system.h"
      
      Add the debug header which contains powerpc_debugfs_root.
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      1bc68a9e
  5. 12 4月, 2012 1 次提交
    • G
      irq_domain: Move irq_virq_count into NOMAP revmap · 6fa6c8e2
      Grant Likely 提交于
      This patch replaces the old global setting of irq_virq_count that is only
      used by the NOMAP mapping and instead uses a revmap_data property so that
      the maximum NOMAP allocation can be set per NOMAP irq_domain.
      
      There is exactly one user of irq_virq_count in-tree right now: PS3.
      Also, irq_virq_count is only useful for the NOMAP mapping.  So,
      instead of having a single global irq_virq_count values, this change
      drops it entirely and added a max_irq argument to irq_domain_add_nomap().
      That makes it a property of an individual nomap irq domain instead of
      a global system settting.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      6fa6c8e2
  6. 11 4月, 2012 2 次提交
  7. 10 4月, 2012 1 次提交
    • B
      powerpc: Fix page fault with lockdep regression · 08f1ec8a
      Benjamin Herrenschmidt 提交于
      commit a546498f
      introduced a regression on 32-bit when irq tracing
      is enabled by exposing an old bug in our irq tracing
      code for exception entry.
      
      The code would save and restore some GPRs around the
      calls to the C lockdep code, however, it tries to be
      too smart for its own good and restores some of the
      GPRs from the exception frame (as saved there on
      exception entry).
      
      However, for page faults, we do replace those GPRs with
      arguments to do_page_fault before we call transfer_to_handler
      and so restoring from the exception frame is plain wrong in
      this case.
      
      This was fine as long as we didn't touch the interrupt state
      when taking page fault, but when I started doing it, it would
      trigger the lockdep calls and the bug.
      
      This fixes it by cleaning up that code a bit. It did create
      a small stack frame for the sake of backtraces, so let's
      make it a bit bigger and use it to save and restore the
      stuff we care about.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      08f1ec8a
  8. 03 4月, 2012 5 次提交
  9. 02 4月, 2012 5 次提交
  10. 30 3月, 2012 2 次提交
  11. 29 3月, 2012 9 次提交
  12. 28 3月, 2012 2 次提交