1. 07 11月, 2013 4 次提交
  2. 30 8月, 2013 1 次提交
    • N
      PCI/ACPI: Fix _OSC ordering to allow PCIe hotplug use when available · 3dc48af3
      Neil Horman 提交于
      This fixes the problem of acpiphp claiming slots that should be managed
      by pciehp, which may keep ExpressCard slots from working.
      
      The acpiphp driver claims PCIe slots unless the BIOS has granted us
      control of PCIe native hotplug via _OSC.  Prior to v3.10, the acpiphp
      .add method (add_bridge()) was always called *after* we had requested
      native hotplug control with _OSC.
      
      But after 3b63aaa7 ("PCI: acpiphp: Do not use ACPI PCI subdriver
      mechanism"), which appeared in v3.10, acpiphp initialization is done
      during the bus scan via the pcibios_add_bus() hook, and this happens
      *before* we request native hotplug control.
      
      Therefore, acpiphp doesn't know yet whether the BIOS will grant control,
      and it claims slots that we should be handling with native hotplug.
      
      This patch requests native hotplug control earlier, so we know whether
      the BIOS granted it to us before we initialize acpiphp.
      
      To avoid reintroducing the ASPM issue fixed by b8178f13 ('Revert
      "PCI/ACPI: Request _OSC control before scanning PCI root bus"'), we run
      _OSC earlier but defer the actual ASPM calls until after the bus scan is
      complete.
      
      Tested successfully by myself.
      
      [bhelgaas: changelog, mark for stable]
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=60736Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      CC: stable@vger.kernel.org	# v3.10+
      CC: Len Brown <lenb@kernel.org>
      CC: "Rafael J. Wysocki" <rjw@sisk.pl>
      3dc48af3
  3. 26 7月, 2013 2 次提交
  4. 30 5月, 2013 4 次提交
  5. 18 5月, 2013 1 次提交
  6. 16 5月, 2013 1 次提交
  7. 17 4月, 2013 1 次提交
  8. 03 4月, 2013 1 次提交
    • B
      Revert "PCI/ACPI: Request _OSC control before scanning PCI root bus" · b8178f13
      Bjorn Helgaas 提交于
      This reverts commit 8c33f51d.
      
      Conflicts:
      	drivers/acpi/pci_root.c
      
      This commit broke some pre-1.1 PCIe devices by leaving them with
      ASPM enabled.  Previously, we had disabled ASPM on these devices
      because many of them don't implement it correctly (per 149e1637).
      
      Requesting _OSC control early means that aspm_disabled may be set
      before we scan the PCI bus and configure link ASPM state.  But the
      ASPM configuration currently skips the check for pre-PCIe 1.1 devices
      when aspm_disabled is set, like this:
      
          acpi_pci_root_add
            acpi_pci_osc_support
              if (flags != base_flags)
                pcie_no_aspm
                  aspm_disabled = 1
            pci_acpi_scan_root
              ...
                pcie_aspm_init_link_state
                  pcie_aspm_sanity_check
                    if (!aspm_disabled)
                      /* check for pre-PCIe 1.1 device */
      
      Therefore, setting aspm_disabled early means that we leave ASPM enabled
      on these pre-PCIe 1.1 devices, which is a regression for some devices.
      
      The best fix would be to clean up the ASPM init so we can evaluate
      _OSC before scanning the bug (that way boot-time and hot-add discovery
      will work the same), but that requires significant rework.
      
      For now, we'll just revert the _OSC change as the lowest-risk fix.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=55211Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      CC: stable@vger.kernel.org	# v3.8+
      b8178f13
  9. 30 3月, 2013 1 次提交
    • Y
      PCI / ACPI: Don't query OSC support with all possible controls · 545d6e18
      Yinghai Lu 提交于
      Found problem on system that firmware that could handle pci aer.
      Firmware get error reporting after pci injecting error, before os boots.
      But after os boots, firmware can not get report anymore, even pci=noaer
      is passed.
      
      Root cause: BIOS _OSC has problem with query bit checking.
      It turns out that BIOS vendor is copying example code from ACPI Spec.
      In ACPI Spec 5.0, page 290:
      
      	If (Not(And(CDW1,1))) // Query flag clear?
      	{	// Disable GPEs for features granted native control.
      		If (And(CTRL,0x01)) // Hot plug control granted?
      		{
      			Store(0,HPCE) // clear the hot plug SCI enable bit
      			Store(1,HPCS) // clear the hot plug SCI status bit
      		}
      	...
      	}
      
      When Query flag is set, And(CDW1,1) will be 1, Not(1) will return 0xfffffffe.
      So it will get into code path that should be for control set only.
      BIOS acpi code should be changed to "If (LEqual(And(CDW1,1), 0)))"
      
      Current kernel code is using _OSC query to notify firmware about support
      from OS and then use _OSC to set control bits.
      During query support, current code is using all possible controls.
      So will execute code that should be only for control set stage.
      
      That will have problem when pci=noaer or aer firmware_first is used.
      As firmware have that control set for os aer already in query support stage,
      but later will not os aer handling.
      
      We should avoid passing all possible controls, just use osc_control_set
      instead.
      That should workaround BIOS bugs with affected systems on the field
      as more bios vendors are copying sample code from ACPI spec.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      545d6e18
  10. 27 3月, 2013 1 次提交
  11. 17 2月, 2013 1 次提交
  12. 30 1月, 2013 1 次提交
  13. 26 1月, 2013 3 次提交
  14. 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
  15. 08 1月, 2013 1 次提交
  16. 03 1月, 2013 3 次提交
    • R
      ACPI / PCI: Move the _PRT setup and cleanup code to pci-acpi.c · 38a9a67a
      Rafael J. Wysocki 提交于
      Move the code related to _PRT setup and removal and to power
      resources from acpi_pci_bind() and acpi_pci_unbind() to the .setup()
      and .cleanup() callbacks in acpi_pci_bus and remove acpi_pci_bind()
      and acpi_pci_unbind() that have no purpose any more.  Accordingly,
      remove the code related to device .bind() and .unbind() operations
      from the ACPI PCI root bridge driver.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      38a9a67a
    • R
      ACPI / PCI: Fold acpi_pci_root_start() into acpi_pci_root_add() · 47525cda
      Rafael J. Wysocki 提交于
      Move the code from the ACPI PCI root bridge's .start() callback
      routine, acpi_pci_root_start(), directly into acpi_pci_root_add()
      and drop acpi_pci_root_start().
      
      It is safe to do that, because it is now always guaranteed that
      when struct pci_dev objects are created, their companion struct
      acpi_device objects are already present, so it is not necessary to
      wait for them to be created before calling pci_bus_add_devices().
      
      This change was previously proposed in a different form by
      Yinghai Lu.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      47525cda
    • R
      ACPI: Change the ordering of PCI root bridge driver registrarion · 92ef2a25
      Rafael J. Wysocki 提交于
      Instead of running acpi_pci_root_init() from a separate subsys
      initcall, call it directly from acpi_scan_init() before scanning the
      ACPI namespace for the first time, so that the PCI root bridge
      driver's .add() routine, acpi_pci_root_start(), is always run
      before binding ACPI drivers or attaching "companion" device objects
      to struct acpi_device objects below the root bridge's device node in
      the ACPI namespace.
      
      The first, simpler reason for doing this is that it makes the
      situation during boot more similar to the situation during hotplug,
      in which the ACPI PCI root bridge driver is always present.
      
      The second reason is that acpi_pci_root_init() causes struct pci_dev
      objects to be created for all PCI devices below the bridge and
      these objects may be necessary for whatever is done with the other
      ACPI device nodes in that namespace scope.  For example, devices
      created by acpi_create_platform_device() sometimes may need to be
      added to the device hierarchy as children of PCI bridges.  For this
      purpose, however, the struct pci_dev objects representing those
      bridges need to exist before the platform devices in question are
      registered.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      92ef2a25
  17. 29 11月, 2012 1 次提交
  18. 08 11月, 2012 2 次提交
  19. 06 11月, 2012 2 次提交
  20. 04 11月, 2012 4 次提交
  21. 25 9月, 2012 4 次提交