13 Mar, 2007

1 commit

  • 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: Eric W. Biederman
    Signed-off-by: Greg Kroah-Hartman
    Acked-by: Auke Kok
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

05 Mar, 2007

1 commit

  • In some cases when we are not using msi we need a way to ensure that the
    hardware does not have an msi capability enabled. Currently the code has been
    calling disable_msi_mode to try and achieve that. However disable_msi_mode
    has several other side effects and is only available when msi support is
    compiled in so it isn't really appropriate.

    Instead this patch implements pci_msi_off which disables all msi and msix
    capabilities unconditionally with no additional side effects.

    pci_disable_device was redundantly clearing the bus master enable flag and
    clearing the msi enable bit. A device that is not allowed to perform bus
    mastering operations cannot generate intx or msi interrupt messages as those
    are essentially a special case of dma, and require bus mastering. So the call
    in pci_disable_device to disable msi capabilities was redundant.

    quirk_pcie_pxh also called disable_msi_mode and is updated to use pci_msi_off.

    Signed-off-by: Eric W. Biederman
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

21 Dec, 2006

2 commits

  • Add a few #defines for grabbing and working with the address fields
    in a HT_CAPTYPE_MSI_MAPPING capability. All from the HT spec v3.00.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • There are already several places in the kernel that want to search a PCI
    device for a given Hypertransport capability. Although this is possible
    using pci_find_capability() etc., it makes sense to encapsulate that
    logic in a helper - pci_find_ht_capability().

    To cater for searching exhaustively for a capability, we also provide
    pci_find_next_ht_capability().

    We also need to cater for the fact that the HT capability fields may be
    either 3 or 5 bits wide. pci_find_ht_capability() deals with this for you,
    but callers using the #defines directly must handle that themselves.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     

02 Dec, 2006

1 commit


16 Nov, 2006

1 commit


04 Oct, 2006

1 commit


27 Sep, 2006

1 commit

  • 0x08 is the HT capability, while PCI_CAP_ID_HT_IRQCONF would be
    the subtype 0x80 that mpic_scan_ht_pic() uses.
    Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT.

    And by the way, use it in the ipath driver instead of defining its
    own HT_CAPABILITY_ID.

    Signed-off-by: Brice Goglin
    Signed-off-by: Greg Kroah-Hartman

    Brice Goglin
     

13 Jul, 2006

1 commit


23 Jun, 2006

1 commit

  • Add the vendor-specific extended capability PCI_CAP_ID_VNDR. It is required
    by the Myri-10G Ethernet driver.

    Signed-off-by: Brice Goglin
    Signed-off-by: Greg Kroah-Hartman
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brice Goglin
     

09 Jan, 2006

1 commit

  • This adds some very basic support for the new machines, including the
    Quad G5 (tested), and other new dual core based machines and iMac G5
    iSight (untested). This is still experimental ! There is no thermal
    control yet, there is no proper handing of MSIs, etc.. but it
    boots, I have all 4 cores up on my machine. Compared to the previous
    version of this patch, this one adds DART IOMMU support for the U4
    chipset and thus should work fine on setups with more than 2Gb of RAM.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

09 Sep, 2005

2 commits

  • Some PCI devices (e.g. 3c905B, 3c556B) lose all configuration
    (including BARs) when transitioning from D3hot->D0. This leaves such
    a device in an inaccessible state. The patch below causes the BARs
    to be restored when enabling such a device, so that its driver will
    be able to access it.

    The patch also adds pci_restore_bars as a new global symbol, and adds a
    correpsonding EXPORT_SYMBOL_GPL for that.

    Some firmware (e.g. Thinkpad T21) leaves devices in D3hot after a
    (re)boot. Most drivers call pci_enable_device very early, so devices
    left in D3hot that lose configuration during the D3hot->D0 transition
    will be inaccessible to their drivers.

    Drivers could be modified to account for this, but it would
    be difficult to know which drivers need modification. This is
    especially true since often many devices are covered by the same
    driver. It likely would be necessary to replicate code across dozens
    of drivers.

    The patch below should trigger only when transitioning from D3hot->D0
    (or at boot), and only for devices that have the "no soft reset" bit
    cleared in the PM control register. I believe it is safe to include
    this patch as part of the PCI infrastructure.

    The cleanest implementation of pci_restore_bars was to call
    pci_update_resource. Unfortunately, that does not currently exist
    for the sparc64 architecture. The patch below includes a null
    implemenation of pci_update_resource for sparc64.

    Some have expressed interest in making general use of the the
    pci_restore_bars function, so that has been exported to GPL licensed
    modules.

    Signed-off-by: John W. Linville
    Signed-off-by: Greg Kroah-Hartman

    John W. Linville
     
  • This cleans up some of the #ifdef CONFIG_PCI stuff up, and moves the pci register
    info out to a separate file, where it belongs. Eventually we can stop including
    this file from within pci.h, but lots of code needs to be audited first.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman