1. 28 5月, 2013 1 次提交
  2. 08 5月, 2013 1 次提交
  3. 18 4月, 2013 1 次提交
  4. 13 4月, 2013 2 次提交
    • J
      PCI: Add pcibios hooks for adding and removing PCI buses · 10a95747
      Jiang Liu 提交于
      On ACPI-based platforms, the pci_slot driver creates PCI slot devices
      according to information from ACPI tables by registering an ACPI PCI
      subdriver.  The ACPI PCI subdriver will only be called when creating/
      destroying PCI root buses, and it won't be called when hot-plugging
      P2P bridges.  It may cause stale PCI slot devices after hot-removing
      a P2P bridge if that bridge has associated PCI slots.  And the acpiphp
      driver has the same issue too.
      
      This patch introduces two hook points into the PCI core, which will
      be invoked when creating/destroying PCI buses for PCI host and P2P
      bridges.  They could be used to setup/destroy platform dependent stuff
      in a unified way, both at boot time and for PCI hotplug operations.
      Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NYinghai Lu <yinghai@kernel.org>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Toshi Kani <toshi.kani@hp.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Myron Stowe <myron.stowe@redhat.com>
      10a95747
    • J
      PCI: Clean up usages of pci_bus->is_added · 981cf9ea
      Jiang Liu 提交于
      Now pci_bus->is_added is only used to guard invoking of
      pcibios_fixup_bus() in pci_scan_child_bus(), so just set
      it directly after the fixups and remove the other test
      and set in pci_bus_add_devices().
      
      [bhelgaas: changelog]
      Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NYinghai Lu <yinghai@kernel.org>
      981cf9ea
  5. 26 1月, 2013 5 次提交
  6. 14 1月, 2013 1 次提交
    • R
      ACPI / PCI: Set root bridge ACPI handle in advance · 6c0cc950
      Rafael J. Wysocki 提交于
      The ACPI handles of PCI root bridges need to be known to
      acpi_bind_one(), so that it can create the appropriate
      "firmware_node" and "physical_node" files for them, but currently
      the way it gets to know those handles is not exactly straightforward
      (to put it lightly).
      
      This is how it works, roughly:
      
        1. acpi_bus_scan() finds the handle of a PCI root bridge,
           creates a struct acpi_device object for it and passes that
           object to acpi_pci_root_add().
      
        2. acpi_pci_root_add() creates a struct acpi_pci_root object,
           populates its "device" field with its argument's address
           (device->handle is the ACPI handle found in step 1).
      
        3. The struct acpi_pci_root object created in step 2 is passed
           to pci_acpi_scan_root() and used to get resources that are
           passed to pci_create_root_bus().
      
        4. pci_create_root_bus() creates a struct pci_host_bridge object
           and passes its "dev" member to device_register().
      
        5. platform_notify(), which for systems with ACPI is set to
           acpi_platform_notify(), is called.
      
      So far, so good.  Now it starts to be "interesting".
      
        6. acpi_find_bridge_device() is used to find the ACPI handle of
           the given device (which is the PCI root bridge) and executes
           acpi_pci_find_root_bridge(), among other things, for the
           given device object.
      
        7. acpi_pci_find_root_bridge() uses the name (sic!) of the given
           device object to extract the segment and bus numbers of the PCI
           root bridge and passes them to acpi_get_pci_rootbridge_handle().
      
        8. acpi_get_pci_rootbridge_handle() browses the list of ACPI PCI
           root bridges and finds the one that matches the given segment
           and bus numbers.  Its handle is then used to initialize the
           ACPI handle of the PCI root bridge's device object by
           acpi_bind_one().  However, this is *exactly* the ACPI handle we
           started with in step 1.
      
      Needless to say, this is quite embarassing, but it may be avoided
      thanks to commit f3fd0c8a (ACPI: Allow ACPI handles of devices to be
      initialized in advance), which makes it possible to initialize the
      ACPI handle of a device before passing it to device_register().
      
      Accordingly, add a new __weak routine, pcibios_root_bridge_prepare(),
      defaulting to an empty implementation that can be replaced by the
      interested architecutres (x86 and ia64 at the moment) with functions
      that will set the root bridge's ACPI handle before its dev member is
      passed to device_register().  Make both x86 and ia64 provide such
      implementations of pcibios_root_bridge_prepare() and remove
      acpi_pci_find_root_bridge() and acpi_get_pci_rootbridge_handle() that
      aren't necessary any more.
      
      Included is a fix for breakage on systems with non-ACPI PCI host
      bridges from Bjorn Helgaas.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      6c0cc950
  7. 03 1月, 2013 1 次提交
  8. 08 12月, 2012 1 次提交
  9. 06 12月, 2012 1 次提交
  10. 29 11月, 2012 2 次提交
  11. 10 11月, 2012 1 次提交
  12. 04 11月, 2012 2 次提交
  13. 19 9月, 2012 1 次提交
  14. 25 8月, 2012 1 次提交
  15. 24 8月, 2012 1 次提交
  16. 23 8月, 2012 3 次提交
  17. 20 8月, 2012 1 次提交
  18. 10 7月, 2012 3 次提交
    • B
      PCI: reimplement P2P bridge 1K I/O windows (Intel P64H2) · 2b28ae19
      Bjorn Helgaas 提交于
      9d265124 and 15a260d5 added quirks for P2P bridges that support
      I/O windows that start/end at 1K boundaries, not just the 4K boundaries
      defined by the PCI spec.  For details, see the IOBL_ADR register and the
      EN1K bit in the CNF register in the Intel 82870P2 (P64H2).
      
      These quirks complicate the code that reads P2P bridge windows
      (pci_read_bridge_io() and pci_cfg_fake_ranges()) because the bridge
      I/O resource is updated in the HEADER quirk, in pci_read_bridge_io(),
      in pci_setup_bridge(), and again in the FINAL quirk.  This is confusing
      and makes it impossible to reassign the bridge windows after FINAL
      quirks are run.
      
      This patch adds support for 1K windows in the generic paths, so the
      HEADER quirk only has to enable this support.  The FINAL quirk, which
      used to undo damage done by pci_setup_bridge(), is no longer needed.
      
      This removes "if (!res->start) res->start = ..." from pci_read_bridge_io();
      that was part of 9d265124 to avoid overwriting the resource filled in
      by the quirk.  Since pci_read_bridge_io() itself now knows about
      granularity, the quirk no longer updates the resource and this test is no
      longer needed.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      2b28ae19
    • B
      PCI: leave MEM and IO decoding disabled during 64-bit BAR sizing, too · bbffe435
      Bjorn Helgaas 提交于
      After 253d2e54, we disable MEM and IO decoding for most devices while we
      size 32-bit BARs.  However, we restore the original COMMAND register before
      we size the upper 32 bits of 64-bit BARs, so we can still cause a conflict.
      
      This patch waits to restore the original COMMAND register until we're
      completely finished sizing the BAR.
      
      Reference: https://lkml.org/lkml/2007/8/25/154Acked-by: NJacob Pan <jacob.jun.pan@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      bbffe435
    • B
      PCI: allow P2P bridge windows starting at PCI bus address zero · 5dde383e
      Bjorn Helgaas 提交于
      cd81e1ea added checks that prevent us from using P2P bridge windows
      that start at PCI bus address zero.  The reason was to "prevent us from
      overwriting resources that are unassigned."
      
      But generic code should allow address zero in both BARs and bridge
      windows, so I think that commit was a mistake.
      
      Windows at bus address zero are legal and likely to exist on machines with
      an offset between bus addresses and CPU addresses.  For example, in the
      following hypothetical scenario, the bridge at 00:01.0 has a window at bus
      address zero and the device at 01:00.0 has a BAR at bus address zero, and
      I think both are perfectly valid:
      
          PCI host bridge to bus 0000:00
          pci_bus 0000:00: root bus resource [mem 0x100000000-0x1ffffffff] (bus address [0x00000000-0xffffffff])
          pci 0000:00:01.0: PCI bridge to [bus 01]
          pci 0000:00:01.0:   bridge window [mem 0x100000000-0x100ffffff]
          pci 0000:01:00.0: reg 10: [mem 0x100000000-0x100ffffff]
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5dde383e
  19. 21 6月, 2012 1 次提交
    • B
      PCI: fix P2P bridge I/O port window sign extension · 8f38eaca
      Bjorn Helgaas 提交于
      On P2P bridges with 32-bit I/O decoding, we incorrectly sign-extended
      windows starting at 0x80000000 or above.  In "base |= (io_base_hi << 16)",
      "io_base_hi" is promoted to a signed int before being extended to an
      unsigned long.
      
      This would cause a window starting at I/O address 0x80000000 to be
      treated as though it started at 0xffffffff80008000 instead, which
      should cause "no compatible bridge window" errors when we enumerate
      devices using that I/O space.
      
      The mmio and mmio_pref casts are not strictly necessary, but without
      them, correctness depends on the types of the PCI_MEMORY_RANGE_MASK and
      PCI_PREF_RANGE_MASK constants, which are not obvious from reading the
      local code.
      
      Found by Coverity (CID 138747 and CID 138748).
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      8f38eaca
  20. 14 6月, 2012 8 次提交
  21. 01 5月, 2012 2 次提交
    • B
      PCI: work around Stratus ftServer broken PCIe hierarchy · 284f5f9d
      Bjorn Helgaas 提交于
      A PCIe downstream port is a P2P bridge.  Its secondary interface is
      a link that should lead only to device 0 (unless ARI is enabled)[1], so
      we don't probe for non-zero device numbers.
      
      Some Stratus ftServer systems have a PCIe downstream port (02:00.0) that
      leads to both an upstream port (03:00.0) and a downstream port (03:01.0),
      and 03:01.0 has important devices below it:
      
        [0000:02]-+-00.0-[03-3c]--+-00.0-[04-09]--...
                                  \-01.0-[0a-0d]--+-[USB]
                                                  +-[NIC]
                                                  +-...
      
      Previously, we didn't enumerate device 03:01.0, so USB and the network
      didn't work.  This patch adds a DMI quirk to scan all device numbers,
      not just 0, below a downstream port.
      
      Based on a patch by Prarit Bhargava.
      
      [1] PCIe spec r3.0, sec 7.3.1
      
      CC: Myron Stowe <mstowe@redhat.com>
      CC: Don Dutile <ddutile@redhat.com>
      CC: James Paradis <james.paradis@stratus.com>
      CC: Matthew Wilcox <matthew.r.wilcox@intel.com>
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      CC: Prarit Bhargava <prarit@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      284f5f9d
    • Y
      PCI: add host bridge release support · 4fa2649a
      Yinghai Lu 提交于
      We need a hook to release host bridge resources allocated when creating
      root bus.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4fa2649a