1. 07 1月, 2012 11 次提交
  2. 19 12月, 2011 1 次提交
  3. 15 12月, 2011 1 次提交
    • A
      PCI: Set device power state to PCI_D0 for device without native PM support · b51306c6
      Ajaykumar Hotchandani 提交于
      During test of one IB card with guest VM, found that, msi is not
      initialized properly.
      
      It turns out __write_msi_msg will do nothing if device current_state is
      not PCI_D0.  And, that pci device does not have pm_cap in guest VM.
      
      There is an error in setting of power state to PCI_D0 in
      pci_enable_device(), but error is not returned for this.  Following is
      code flow:
      
      pci_enable_device() -->   __pci_enable_device_flags() -->
      do_pci_enable_device() -->   pci_set_power_state() -->
      __pci_start_power_transition()
      
      We have following condition inside __pci_start_power_transition():
               if (platform_pci_power_manageable(dev)) {
                       error = platform_pci_set_power_state(dev, state);
                       if (!error)
                               pci_update_current_state(dev, state);
               } else {
                       error = -ENODEV;
                       /* Fall back to PCI_D0 if native PM is not supported */
                       if (!dev->pm_cap)
                               dev->current_state = PCI_D0;
               }
      
      Here, from platform_pci_set_power_state(), acpi_pci_set_power_state() is
      getting called and that is failing with ENODEV because of following
      condition:
      
               if (!handle || ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0",&tmp)))
                       return -ENODEV;
      
      Because of that, pci_update_current_state() is not getting called.
      
      With this patch, if device power state can not be set via
      platform_pci_set_power_state and that device does not have native pm
      support, then PCI device power state will be set to PCI_D0.
      
      -v2: This also reverts 47e9037a, as it's
           not needed after this change.
      Acked-by: N"Rafael J. Wysocki" <rjw@sisk.pl>
      Signed-off-by: Ajaykumar Hotchandani<ajaykumar.hotchandani@oracle.com>
      Signed-off-by: Yinghai Lu<yinghai.lu@oracle.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b51306c6
  4. 14 12月, 2011 1 次提交
    • R
      PCI hotplug: Always allow acpiphp to handle non-PCIe bridges · 619a5182
      Rafael J. Wysocki 提交于
      Commit 0d52f54e (PCI / ACPI: Make
      acpiphp ignore root bridges using PCIe native hotplug) added code
      that made the acpiphp driver completely ignore PCIe root complexes
      for which the kernel had been granted control of the native PCIe
      hotplug feature by the BIOS through _OSC.  Unfortunately, however,
      this was a mistake, because on some systems there were PCI bridges
      supporting PCI (non-PCIe) hotplug under such root complexes and
      those bridges should have been handled by acpiphp.
      
      For this reason, revert the changes made by the commit mentioned
      above and make register_slot() in drivers/pci/hotplug/acpiphp_glue.c
      avoid registering hotplug slots for PCIe ports that belong to
      root complexes with native PCIe hotplug enabled (which means that
      the BIOS has granted the kernel control of this feature for the
      given root complex).  This is reported to address the original
      issue fixed by commit 0d52f54e and
      to work on the system where that commit broke things.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      619a5182
  5. 06 12月, 2011 2 次提交
    • J
      PCI: fix ats compile failure · 8c451945
      James Bottomley 提交于
      I get this compile failure on parisc:
      
      drivers/pci/ats.c: In function 'ats_alloc_one':
      drivers/pci/ats.c:29: error: implicit declaration of function 'kzalloc'
      drivers/pci/ats.c:29: warning: assignment makes pointer from integer without a cast
      drivers/pci/ats.c: In function 'ats_free_one':
      drivers/pci/ats.c:45: error: implicit declaration of function 'kfree'
      
      Because ats.c is missing linux/slab.h as an include.  This patch fixes it
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8c451945
    • R
      PCI: defer enablement of SRIOV BARS · bbef98ab
      Ram Pai 提交于
      All the PCI BARs of a device are enabled when the device is enabled
      using pci_enable_device().  This unnecessarily enables SRIOV BARs of the
      device.
      
      On some platforms, which do not support SRIOV as yet, the
      pci_enable_device() fails to enable the device if its SRIOV BARs are not
      allocated resources correctly.
      
      The following patch fixes the above problem. The SRIOV BARs are now
      enabled when IOV capability of the device is enabled in sriov_enable().
      
      NOTE: Note, there is subtle change in the pci_enable_device() API.  Any
      driver that depends on SRIOV BARS to be enabled in pci_enable_device()
      can fail.
      
      The patch has been touch tested on power and x86 platform.
      Tested-by: NMichael Wang <wangyun@linux.vnet.ibm.com>
      Signed-off-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      bbef98ab
  6. 15 11月, 2011 1 次提交
  7. 12 11月, 2011 2 次提交
  8. 08 11月, 2011 1 次提交
  9. 01 11月, 2011 5 次提交
  10. 28 10月, 2011 4 次提交
  11. 15 10月, 2011 10 次提交
    • J
      PCI: Add support for PASID capability · 086ac11f
      Joerg Roedel 提交于
      Devices supporting Process Address Space Identifiers
      (PASIDs) can use an IOMMU to access multiple IO address
      spaces at the same time. A PCIe device indicates support for
      this feature by implementing the PASID capability. This
      patch adds support for the capability to the Linux kernel.
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      086ac11f
    • J
      PCI: Add implementation for PRI capability · c320b976
      Joerg Roedel 提交于
      Implement the necessary functions to handle PRI capabilities
      on PCIe devices. With PRI devices behind an IOMMU can signal
      page fault conditions to software and recover from such
      faults.
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      c320b976
    • J
      PCI: Export ATS functions to modules · d4c0636c
      Joerg Roedel 提交于
      This patch makes the ATS functions usable for modules.
      They will be used by a module implementing some advanced
      AMD IOMMU features.
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      d4c0636c
    • J
      PCI: Move ATS implementation into own file · db3c33c6
      Joerg Roedel 提交于
      ATS does not depend on IOV support, so move the code into
      its own file. This file will also include support for the
      PRI and PASID capabilities later.
      Also give ATS its own Kconfig variable to allow selecting it
      without IOV support.
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      db3c33c6
    • R
      PCI / PM: Remove unnecessary error variable from acpi_dev_run_wake() · 78d090b0
      Rafael J. Wysocki 提交于
      The result returned by acpi_dev_run_wake() is always either -EINVAL
      or -ENODEV, while obviously it should return 0 on success.  The
      problem is that the leftover error variable, that's not really used
      in the function, is initialized with -ENODEV and then returned
      without modification.
      
      To fix this issue remove the error variable from acpi_dev_run_wake()
      and make the function return 0 on success as appropriate.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      78d090b0
    • P
      PCI hotplug: acpiphp: Prevent deadlock on PCI-to-PCI bridge remove · 6af8bef1
      Prarit Bhargava 提交于
      I originally submitted a patch to workaround this by pushing all Ejection
      Requests and Device Checks onto the kacpi_hotplug queue.
      
      http://marc.info/?l=linux-acpi&m=131678270930105&w=2
      
      The patch is still insufficient in that Bus Checks also need to be added.
      
      Rather than add all events, including non-PCI-hotplug events, to the
      hotplug queue, mjg suggested that a better approach would be to modify
      the acpiphp driver so only acpiphp events would be added to the
      kacpi_hotplug queue.
      
      It's a longer patch, but at least we maintain the benefit of having separate
      queues in ACPI.  This, of course, is still only a workaround the problem.
      As Bjorn and mjg pointed out, we have to refactor a lot of this code to do
      the right thing but at this point it is a better to have this code working.
      
      The acpi core places all events on the kacpi_notify queue.  When the acpiphp
      driver is loaded and a PCI card with a PCI-to-PCI bridge is removed the
      following call sequence occurs:
      
      cleanup_p2p_bridge()
      	    -> cleanup_bridge()
      		    -> acpi_remove_notify_handler()
      			    -> acpi_os_wait_events_complete()
      				    -> flush_workqueue(kacpi_notify_wq)
      
      which is the queue we are currently executing on and the process will hang.
      
      Move all hotplug acpiphp events onto the kacpi_hotplug workqueue.  In
      handle_hotplug_event_bridge() and handle_hotplug_event_func() we can simply
      push the rest of the work onto the kacpi_hotplug queue and then avoid the
      deadlock.
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Cc: mjg@redhat.com
      Cc: bhelgaas@google.com
      Cc: linux-acpi@vger.kernel.org
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6af8bef1
    • R
      PCI / PM: Extend PME polling to all PCI devices · 379021d5
      Rafael J. Wysocki 提交于
      The land of PCI power management is a land of sorrow and ugliness,
      especially in the area of signaling events by devices.  There are
      devices that set their PME Status bits, but don't really bother
      to send a PME message or assert PME#.  There are hardware vendors
      who don't connect PME# lines to the system core logic (they know
      who they are).  There are PCI Express Root Ports that don't bother
      to trigger interrupts when they receive PME messages from the devices
      below.  There are ACPI BIOSes that forget to provide _PRW methods for
      devices capable of signaling wakeup.  Finally, there are BIOSes that
      do provide _PRW methods for such devices, but then don't bother to
      call Notify() for those devices from the corresponding _Lxx/_Exx
      GPE-handling methods.  In all of these cases the kernel doesn't have
      a chance to receive a proper notification that it should wake up a
      device, so devices stay in low-power states forever.  Worse yet, in
      some cases they continuously send PME Messages that are silently
      ignored, because the kernel simply doesn't know that it should clear
      the device's PME Status bit.
      
      This problem was first observed for "parallel" (non-Express) PCI
      devices on add-on cards and Matthew Garrett addressed it by adding
      code that polls PME Status bits of such devices, if they are enabled
      to signal PME, to the kernel.  Recently, however, it has turned out
      that PCI Express devices are also affected by this issue and that it
      is not limited to add-on devices, so it seems necessary to extend
      the PME polling to all PCI devices, including PCI Express and planar
      ones.  Still, it would be wasteful to poll the PME Status bits of
      devices that are known to receive proper PME notifications, so make
      the kernel (1) poll the PME Status bits of all PCI and PCIe devices
      enabled to signal PME and (2) disable the PME Status polling for
      devices for which correct PME notifications are received.
      Tested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      379021d5
    • J
      PCI quirk: mmc: Always check for lower base frequency quirk for Ricoh 1180:e823 · 3e309cdf
      Josh Boyer 提交于
      Commit 15bed0f2 added a quirk for the e823 Ricoh card reader to lower the
      base frequency.  However, the quirk first checks to see if the proprietary
      MMC controller is disabled, and returns if so.  On some devices, such as the
      Lenovo X220, the MMC controller is already disabled by firmware it seems,
      but the frequency change is still needed so sdhci-pci can talk to the cards.
      Since the MMC controller is disabled, the frequency fixup was never being run
      on these machines.
      
      This moves the e823 check above the MMC controller check so that it always
      gets run.
      
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=722509Signed-off-by: NJosh Boyer <jwboyer@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      3e309cdf
    • B
      PCI: Make pci_setup_bridge() non-static for use by arch code · e2444273
      Benjamin Herrenschmidt 提交于
      The "powernv" platform of the powerpc architecture needs to assign PCI
      resources using a specific algorithm to fit some HW constraints of
      the IBM "IODA" architecture (related to the ability to create error
      handling domains that encompass specific segments of MMIO space).
      
      For doing so, it wants to call pci_setup_bridge() from architecture
      specific resource management in order to configure bridges after all
      resources have been assigned. So make it non-static.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e2444273
    • B
      PCI: Add quirk for known incorrect MPSS · a94d072b
      Ben Hutchings 提交于
      Using legacy interrupts and TLPs > 256 bytes on the SFC4000 (all
      revisions) may cause interrupt messages to be replayed.  In some
      systems this results in a non-recoverable MCE.  Early boards using the
      SFC4000 set the maximum payload size supported (MPSS) to 1024 bytes
      and we should override that.
      
      There are probably other devices with similar issues, so give this
      quirk a generic name.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a94d072b
  12. 05 10月, 2011 1 次提交