1. 08 12月, 2008 1 次提交
  2. 30 4月, 2008 1 次提交
    • Y
      pci/irq: restore mask_bits in msi shutdown -v3 · 8e149e09
      Yinghai Lu 提交于
      [PATCH 1/2] pci/irq: restore mask_bits in msi shutdown -v3
      
      Yinghai found that kexec'ing a RHEL 5.1 kernel with 2.6.25-rc3+ kernels
      prevents his NIC from working.  He bisected to
      
      | commit 89d694b9
      | Author: Thomas Gleixner <tglx@linutronix.de>
      | Date:   Mon Feb 18 18:25:17 2008 +0100
      |
      |   genirq: do not leave interupts enabled on free_irq
      |
      |   The default_disable() function was changed in commit:
      |
      |    76d21601
      |    genirq: do not mask interrupts by default
      |
      
      For MSI, default_shutdown will call mask_bit for msi device.  All mask bits
      will left disabled after free_irq.  Then in the kexec case, the next kernel
      can only use msi_enable bit, so all device's MSI can not be used.
      
      So lets to restore the mask bit to its pci reset defined value (enabled) when
      we disable the kernels use of msi to be a little friendlier to kexec'd kernels.
      
      Extend msi_set_mask_bit to msi_set_mask_bits to take mask, so we can fully
      restore that to 0x00 instead of 0xfe.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NJesse Barnes <jbarnes@hobbes.lan>
      8e149e09
  3. 03 5月, 2007 4 次提交
    • M
      MSI: Give archs the option to free all MSI/Xs at once. · 032de8e2
      Michael Ellerman 提交于
      This patch introduces an optional function, arch_teardown_msi_irqs(),
      which gives an arch the opportunity to do per-device teardown for
      MSI/X. If that's not required, the default version simply calls
      arch_teardown_msi_irq() for each msi irq required.
      
      arch_teardown_msi_irqs() is simply passed a pdev, attached to the pdev
      is a list of msi_descs, it is up to the arch to free the irq associated
      with each of these as appropriate.
      
      For archs that _don't_ implement arch_teardown_msi_irqs(), all msi_descs
      with irq == 0 are considered unallocated, and the arch teardown routine
      is not called on them.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      032de8e2
    • M
      MSI: Give archs the option to allocate all MSI/Xs at once. · 9c831334
      Michael Ellerman 提交于
      This patch introduces an optional function, arch_setup_msi_irqs(),
      (note the plural) which gives an arch the opportunity to do per-device
      setup for MSI/X and then allocate all the requested MSI/Xs at once.
      
      If that's not required by the arch, the default version simply calls
      arch_setup_msi_irq() for each MSI irq required.
      
      arch_setup_msi_irqs() is passed a pdev, attached to the pdev is a list
      of msi_descs with irq == 0, it is up to the arch to connect these up to
      an irq (via set_irq_msi()) or return an error. For convenience the number
      of vectors and the type are passed also.
      
      All msi_descs with irq != 0 are considered allocated, and the arch
      teardown routine will be called on them when necessary.
      
      The existing semantics of pci_enable_msix() are that if the requested
      number of irqs can not be allocated, the maximum number that _could_ be
      allocated is returned. To support that, we define that in case of an
      error from arch_setup_msi_irqs(), the number of msi_descs with irq != 0
      are considered allocated, and are counted toward the "max that could be
      allocated".
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9c831334
    • M
      MSI: Use a list instead of the custom link structure · 4aa9bc95
      Michael Ellerman 提交于
      The msi descriptors are linked together with what looks a lot like
      a linked list, but isn't a struct list_head list. Make it one.
      
      The only complication is that previously we walked a list of irqs, and
      got the descriptor for each with get_irq_msi(). Now we have a list of
      descriptors and need to get the irq out of it, so it needs to be in the
      actual struct msi_desc. We use 0 to indicate no irq is setup.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4aa9bc95
    • M
      MSI: Add an arch_msi_check_device() · c9953a73
      Michael Ellerman 提交于
      Add an arch_check_device(), which gives archs a chance to check the input
      to pci_enable_msi/x. The arch might be interested in the value of nvec so
      pass it in. Propagate the error value returned from the arch routine out
      to the caller.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c9953a73
  4. 13 3月, 2007 1 次提交
    • E
      [PATCH] msi: Safer state caching. · 392ee1e6
      Eric W. Biederman 提交于
      There are two ways pci_save_state and pci_restore_state are used.  As
      helper functions during suspend/resume, and as helper functions around
      a hardware reset event.  When used as helper functions around a hardware
      reset event there is no reason to believe the calls will be paired, nor
      is there a good reason to believe that if we restore the msi state from
      before the reset that it will match the current msi state.  Since arch
      code may change the msi message without going through the driver, drivers
      currently do not have enough information to even know when to call
      pci_save_state to ensure they will have msi state in sync with the other
      kernel irq reception data structures.
      
      It turns out the solution is straight forward, cache the state in the
      existing msi data structures (not the magic pci saved things) and
      have the msi code update the cached state each time we write to the hardware.
      This means we never need to read the hardware to figure out what the hardware
      state should be.
      
      By modifying the caching in this manner we get to remove our save_state
      routines and only need to provide restore_state routines.
      
      The only fields that were at all tricky to regenerate were the msi and msi-x
      control registers and the way we regenerate them currently is a bit dependent
      upon assumptions on how we use the allow msi registers to be configured and used
      making the code a little bit brittle.  If we ever change what cases we allow
      or how we configure the msi bits we can address the fragility then.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NAuke Kok <auke-jan.h.kok@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      392ee1e6
  5. 08 2月, 2007 2 次提交
  6. 04 10月, 2006 1 次提交
    • E
      [PATCH] msi: refactor and move the msi irq_chip into the arch code · 3b7d1921
      Eric W. Biederman 提交于
      It turns out msi_ops was simply not enough to abstract the architecture
      specific details of msi.  So I have moved the resposibility of constructing
      the struct irq_chip to the architectures, and have two architecture specific
      functions arch_setup_msi_irq, and arch_teardown_msi_irq.
      
      For simple architectures those functions can do all of the work.  For
      architectures with platform dependencies they can call into the appropriate
      platform code.
      
      With this msi.c is finally free of assuming you have an apic, and this
      actually takes less code.
      
      The helpers for the architecture specific code are declared in the linux/msi.h
      to keep them separate from the msi functions used by drivers in linux/pci.h
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Greg KH <greg@kroah.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3b7d1921