1. 06 11月, 2012 1 次提交
  2. 23 8月, 2012 4 次提交
  3. 22 8月, 2012 1 次提交
  4. 11 7月, 2012 1 次提交
    • A
      PCI: EHCI: fix crash during suspend on ASUS computers · dbf0e4c7
      Alan Stern 提交于
      Quite a few ASUS computers experience a nasty problem, related to the
      EHCI controllers, when going into system suspend.  It was observed
      that the problem didn't occur if the controllers were not put into the
      D3 power state before starting the suspend, and commit
      151b6128 (USB: EHCI: fix crash during
      suspend on ASUS computers) was created to do this.
      
      It turned out this approach messed up other computers that didn't have
      the problem -- it prevented USB wakeup from working.  Consequently
      commit c2fb8a3f (USB: add
      NO_D3_DURING_SLEEP flag and revert 151b6128) was merged; it
      reverted the earlier commit and added a whitelist of known good board
      names.
      
      Now we know the actual cause of the problem.  Thanks to AceLan Kao for
      tracking it down.
      
      According to him, an engineer at ASUS explained that some of their
      BIOSes contain a bug that was added in an attempt to work around a
      problem in early versions of Windows.  When the computer goes into S3
      suspend, the BIOS tries to verify that the EHCI controllers were first
      quiesced by the OS.  Nothing's wrong with this, but the BIOS does it
      by checking that the PCI COMMAND registers contain 0 without checking
      the controllers' power state.  If the register isn't 0, the BIOS
      assumes the controller needs to be quiesced and tries to do so.  This
      involves making various MMIO accesses to the controller, which don't
      work very well if the controller is already in D3.  The end result is
      a system hang or memory corruption.
      
      Since the value in the PCI COMMAND register doesn't matter once the
      controller has been suspended, and since the value will be restored
      anyway when the controller is resumed, we can work around the BIOS bug
      simply by setting the register to 0 during system suspend.  This patch
      (as1590) does so and also reverts the second commit mentioned above,
      which is now unnecessary.
      
      In theory we could do this for every PCI device.  However to avoid
      introducing new problems, the patch restricts itself to EHCI host
      controllers.
      
      Finally the affected systems can suspend with USB wakeup working
      properly.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=37632
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=42728Based-on-patch-by: NAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NDâniel Fraga <fragabr@gmail.com>
      Tested-by: NJavier Marcet <jmarcet@gmail.com>
      Tested-by: NAndrey Rahmatullin <wrar@wrar.name>
      Tested-by: NOleksij Rempel <bug-track@fisher-privat.net>
      Tested-by: NPavel Pisa <pisa@cmp.felk.cvut.cz>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dbf0e4c7
  5. 06 7月, 2012 1 次提交
    • R
      PCI / PM: restore the original behavior of pci_set_power_state() · db288c9c
      Rafael J. Wysocki 提交于
      Commit cc2893b6 (PCI: Ensure we re-enable devices on resume)
      addressed the problem with USB not being powered after resume on
      recent Lenovo machines, but it did that in a suboptimal way.
      Namely, it should have changed the relevant code paths only,
      which are pci_pm_resume_noirq() and pci_pm_restore_noirq() supposed
      to restore the device's power and standard configuration registers
      after system resume from suspend or hibernation.  Instead, however,
      it modified pci_set_power_state() which is executed in several
      other situations too.  That resulted in some undesirable effects,
      like attempting to change a device's power state in the same way
      multiple times in a row (up to as many as 4 times in a row in the
      snd_hda_intel driver).
      
      Fix the bug addressed by commit cc2893b6 in an alternative way,
      by forcibly powering up all devices in pci_pm_default_resume_early(),
      which is called by pci_pm_resume_noirq() and pci_pm_restore_noirq()
      to restore the device's power and standard configuration registers,
      and modifying pci_pm_runtime_resume() to avoid the forcible power-up
      if not necessary.  Then, revert the changes made by commit cc2893b6
      to make the confusion introduced by it go away.
      Acked-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      db288c9c
  6. 26 6月, 2012 1 次提交
  7. 24 6月, 2012 2 次提交
    • H
      PCI/PM: add PCIe runtime D3cold support · 448bd857
      Huang Ying 提交于
      This patch adds runtime D3cold support and corresponding ACPI platform
      support.  This patch only enables runtime D3cold support; it does not
      enable D3cold support during system suspend/hibernate.
      
      D3cold is the deepest power saving state for a PCIe device, where its main
      power is removed.  While it is in D3cold, you can't access the device at
      all, not even its configuration space (which is still accessible in D3hot).
      Therefore the PCI PM registers can not be used to transition into/out of
      the D3cold state; that must be done by platform logic such as ACPI _PR3.
      
      To support wakeup from D3cold, a system may provide auxiliary power, which
      allows a device to request wakeup using a Beacon or the sideband WAKE#
      signal.  WAKE# is usually connected to platform logic such as ACPI GPE.
      This is quite different from other power saving states, where devices
      request wakeup via a PME message on the PCIe link.
      
      Some devices, such as those in plug-in slots, have no direct platform
      logic.  For example, there is usually no ACPI _PR3 for them.  D3cold
      support for these devices can be done via the PCIe Downstream Port leading
      to the device.  When the PCIe port is powered on/off, the device is powered
      on/off too.  Wakeup events from the device will be notified to the
      corresponding PCIe port.
      
      For more information about PCIe D3cold and corresponding ACPI support,
      please refer to:
      
      - PCI Express Base Specification Revision 2.0
      - Advanced Configuration and Power Interface Specification Revision 5.0
      
      [bhelgaas: changelog]
      Reviewed-by: NRafael J. Wysocki <rjw@sisk.pl>
      Originally-by: NZheng Yan <zheng.z.yan@intel.com>
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      448bd857
    • Z
      PCI/PM: add runtime PM support to PCIe port · 71a83bd7
      Zheng Yan 提交于
      This patch adds runtime PM support to PCIe port.  This is needed by
      PCIe D3cold support, where PCIe device without ACPI node may be
      powered on/off by PCIe port.
      
      Because runtime suspend is broken for some chipsets, a black list is
      used to disable runtime PM support for these chipsets.
      Reviewed-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NZheng Yan <zheng.z.yan@intel.com>
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      71a83bd7
  8. 21 6月, 2012 3 次提交
  9. 17 6月, 2012 1 次提交
  10. 14 6月, 2012 2 次提交
    • Y
      PCI: replace struct pci_bus secondary/subordinate with busn_res · b918c62e
      Yinghai Lu 提交于
      Replace the struct pci_bus secondary/subordinate members with the
      struct resource busn_res.  Later we'll build a resource tree of these
      bus numbers.
      
      [bhelgaas: changelog]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      b918c62e
    • A
      USB: add NO_D3_DURING_SLEEP flag and revert 151b6128 · c2fb8a3f
      Alan Stern 提交于
      This patch (as1558) fixes a problem affecting several ASUS computers:
      The machine crashes or corrupts memory when going into suspend if the
      ehci-hcd driver is bound to any controllers.  Users have been forced
      to unbind or unload ehci-hcd before putting their systems to sleep.
      
      After extensive testing, it was determined that the machines don't
      like going into suspend when any EHCI controllers are in the PCI D3
      power state.  Presumably this is a firmware bug, but there's nothing
      we can do about it except to avoid putting the controllers in D3
      during system sleep.
      
      The patch adds a new flag to indicate whether the problem is present,
      and avoids changing the controller's power state if the flag is set.
      Runtime suspend is unaffected; this matters only for system suspend.
      However as a side effect, the controller will not respond to remote
      wakeup requests while the system is asleep.  Hence USB wakeup is not
      functional -- but of course, this is already true in the current state
      of affairs.
      
      A similar patch has already been applied as commit
      151b6128 (USB: EHCI: fix crash during
      suspend on ASUS computers).  The patch supersedes that one and reverts
      it.  There are two differences:
      
      	The old patch added the flag at the USB level; this patch
      	adds it at the PCI level.
      
      	The old patch applied to all chipsets with the same vendor,
      	subsystem vendor, and product IDs; this patch makes an
      	exception for a known-good system (based on DMI information).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NDâniel Fraga <fragabr@gmail.com>
      Tested-by: NAndrey Rahmatullin <wrar@wrar.name>
      Tested-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c2fb8a3f
  11. 12 6月, 2012 7 次提交
    • A
      PCI: add ACS validation utility · ad805758
      Alex Williamson 提交于
      In a PCI environment, transactions aren't always required to reach
      the root bus before being re-routed.  Intermediate switches between
      an endpoint and the root bus can redirect DMA back downstream before
      things like IOMMUs have a chance to intervene.  Legacy PCI is always
      susceptible to this as it operates on a shared bus.  PCIe added a
      new capability to describe and control this behavior, Access Control
      Services, or ACS.
      
      The utility function pci_acs_enabled() allows us to test the ACS
      capabilities of an individual devices against a set of flags while
      pci_acs_path_enabled() tests a complete path from a given downstream
      device up to the specified upstream device.  We also include the
      ability to add device specific tests as it's likely we'll see
      devices that do not implement ACS, but want to indicate support
      for various capabilities in this space.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      ad805758
    • M
      PCI: remove redundant capabilities checking in pci_{save, restore}_pcie_state · 9cb604ed
      Myron Stowe 提交于
      Unlike PCI Express v1's Capabilities Structure, v2's requires the entire
      structure to be implemented.  In v2 structures, register fields that
      are not implemented are present but hardwired to 0x0.  These may
      include: Link Capabilities, Status, and Control; Slot Capabilities,
      Status, and Control; Root Capabilities, Status, and Control; and all of
      the '2' (Device, Link, and Slot) Capabilities, Status, and Control
      registers.
      
      This patch removes the redundant capability checks corresponding to the
      Link 2's and Slot 2's, Capabilities, Status, and Control registers as they
      will be present if Device Capabilities 2's registers are (which explains
      why the macros for each of the three are identical).
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      9cb604ed
    • M
      PCI: add pci_pcie_cap2() check for PCIe feature capabilities >= v2 · c463b8cb
      Myron Stowe 提交于
      This patch resolves potential issues when accessing PCI Express
      Capability structures.  The makeup of the capability varies
      substantially between v1 and v2:
      
          Version 1 of the PCI Express Capability (defined by PCI Express
          1.0 and 1.1 base) neither requires the endpoint to implement the
          entire PCIe capability structure nor specifies default values of
          registers that are not implemented by the device.
      
          Version 2 of the PCI Express Capability (defined by PCIe 1.1
          Capability Structure Expansion ECN, PCIe 2.0, 2.1, and 3.0) added
          additional registers to the structure and requires all registers
          to be either implemented or hardwired to 0.
      
      Due to the differences in the capability structures, code dealing with
      capability features must be careful not to access the additional
      registers introduced with v2 unless the device is specifically known to
      be a v2 capable device.  Otherwise, attempts to access non-existant
      registers will occur.  This is a subtle issue that is hard to track down
      when it occurs (and it has - see commit 864d296c).
      
      To try and help mitigate such occurrences, this patch introduces
      pci_pcie_cap2() which is similar to pci_pcie_cap() but also checks
      that the PCIe capability version is >= 2.  pci_pcie_cap2() should be
      used for qualifying PCIe capability features introduced after v1.
      
      Suggested by Don Dutile.
      Acked-by: NDonald Dutile <ddutile@redhat.com>
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c463b8cb
    • M
      PCI: remove redundant checking in PCI Express capability routines · cb97ae34
      Myron Stowe 提交于
      There are a number of redundant pci_is_pcie() checks in various PCI
      Express capabilities related routines like the following:
      
          if (!pci_is_pcie(dev))
      	return false;
      
          pos = pci_pcie_cap(dev);
          if (!pos)
      	return false;
      
      The current pci_is_pcie() implementation is merely:
      
          static inline bool pci_is_pcie(struct pci_dev *dev)
          {
              return !!pci_pcie_cap(dev);
          }
      
      so we can just drop the pci_is_pcie() test in such cases.
      Acked-by: NDonald Dutile <ddutile@redhat.com>
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      cb97ae34
    • M
      PCI: make pci_ltr_supported() static · c32823f8
      Myron Stowe 提交于
      The PCI Express Latency Tolerance Reporting (LTR) feature's
      pci_ltr_supported() routine is currently only used within
      drivers/pci/pci.c so make it static.
      Acked-by: NDonald Dutile <ddutile@redhat.com>
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c32823f8
    • B
      PCI: remove pci_max_busnr() (was already commented out) · 533b6608
      Bjorn Helgaas 提交于
      pci_max_busnr() has been commented out for years (since 54c762fe), and
      this patch removes it completely.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      533b6608
    • B
      PCI: remove pci_bus_find_ext_capability() (unused) · 109cdbc2
      Bjorn Helgaas 提交于
      pci_bus_find_ext_capability() is unused, and this patch removes it.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      109cdbc2
  12. 21 5月, 2012 1 次提交
  13. 01 5月, 2012 2 次提交
    • K
      PCI: move mutex locking out of pci_dev_reset function · 977f857c
      Konrad Rzeszutek Wilk 提交于
      The intent of git commit 6fbf9e7a
      "PCI: Introduce __pci_reset_function_locked to be used when holding
      device_lock." was to have a non-locking function that would call
      pci_dev_reset function.
      
      But it fell short of that by just probing and not actually reseting
      the device. To make that work we need a way to move the lock
      around device_lock to not be in pci_dev_reset (as the caller of
      __pci_reset_function_locked already holds said lock). We do this by
      renaming pci_dev_reset to __pci_dev_reset and bubbling said mutex out
      of __pci_dev_reset to pci_dev_reset (a wrapper around __pci_dev_reset).
      The __pci_reset_function_locked  can now call __pci_dev_reset without
      having to worry about the dead-lock.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      977f857c
    • 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
  14. 17 4月, 2012 1 次提交
    • R
      PCI: Retry BARs restoration for Type 0 headers only · a6cb9ee7
      Rafael J. Wysocki 提交于
      Some shortcomings introduced into pci_restore_state() by commit
      26f41062 ("PCI: check for pci bar restore completion and retry")
      have been fixed by recent commit ebfc5b80 ("PCI: Fix regression in
      pci_restore_state(), v3"), but that commit treats all PCI devices as
      those with Type 0 configuration headers.
      
      That is not entirely correct, because Type 1 and Type 2 headers have
      different layouts.  In particular, the area occupied by BARs in Type 0
      config headers contains the secondary status register in Type 1 ones and
      it doesn't make sense to retry the restoration of that register even if
      the value read back from it after a write is not the same as the written
      one (it very well may be different).
      
      For this reason, make pci_restore_state() only retry the restoration
      of BARs for Type 0 config headers.  This effectively makes it behave
      as before commit 26f41062 for all header types except for Type 0.
      Tested-by: NMikko Vinni <mmvinni@yahoo.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6cb9ee7
  15. 16 4月, 2012 1 次提交
    • R
      PCI: Fix regression in pci_restore_state(), v3 · ebfc5b80
      Rafael J. Wysocki 提交于
      Commit 26f41062 ("PCI: check for pci bar restore completion and
      retry") attempted to address problems with PCI BAR restoration on
      systems where FLR had not been completed before pci_restore_state() was
      called, but it did that in an utterly wrong way.
      
      First off, instead of retrying the writes for the BAR registers only, it
      did that for all of the PCI config space of the device, including the
      status register (whose value after the write quite obviously need not be
      the same as the written one).  Second, it added arbitrary delay to
      pci_restore_state() even for systems where the PCI config space
      restoration was successful at first attempt.  Finally, the mdelay(10) it
      added to every iteration of the writing loop was way too much of a delay
      for any reasonable device.
      
      All of this actually caused resume failures for some devices on Mikko's
      system.
      
      To fix the regression, make pci_restore_state() only retry the writes
      for BAR registers and only wait if the first read from the register
      doesn't return the written value.  Additionaly, make it wait for 1 ms,
      instead of 10 ms, after every failing attempt to write into config
      space.
      Reported-by: NMikko Vinni <mmvinni@yahoo.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ebfc5b80
  16. 02 3月, 2012 1 次提交
    • R
      PCI / PCIe: Introduce command line option to disable ARI · 6748dcc2
      Rafael J. Wysocki 提交于
      There are PCIe devices on the market that report ARI support but
      then fail to initialize correctly when ARI is actually used.  This
      leads to situations in which kernels 2.6.34 and newer fail to handle
      systems where the previous kernels worked without any apparent
      problems.  Unfortunately, it is currently unknown how many such
      devices are there.
      
      For this reason, introduce a new kernel command line option,
      pci=noari, allowing users to disable PCIe ARI altogether if they
      see problems with PCIe device initialization.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6748dcc2
  17. 25 2月, 2012 2 次提交
  18. 24 2月, 2012 2 次提交
    • Y
      PCI: move pci_find_saved_cap out of linux/pci.h · 34a4876e
      Yinghai Lu 提交于
      Only one user in driver/pci/pci.c, so we don't need to put it in global
      pci.h
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      34a4876e
    • Y
      PCI: fix memleak for pci dev removing during hotplug · f796841e
      Yinghai Lu 提交于
      unreferenced object 0xffff880276d17700 (size 64):
        comm "swapper/0", pid 1, jiffies 4294897182 (age 3976.028s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 18 f9 de 76 02 88 ff ff  ...........v....
          10 00 00 00 0e 00 00 00 0f 28 40 00 00 00 00 00  .........(@.....
        backtrace:
          [<ffffffff81c8aede>] kmemleak_alloc+0x26/0x43
          [<ffffffff811385f0>] __kmalloc+0x121/0x183
          [<ffffffff813cf821>] pci_add_cap_save_buffer+0x35/0x7c
          [<ffffffff813d12b7>] pci_allocate_cap_save_buffers+0x1d/0x65
          [<ffffffff813cdb52>] pci_device_add+0x92/0xf1
          [<ffffffff81c8afe6>] pci_scan_single_device+0x9f/0xa1
          [<ffffffff813cdbd2>] pci_scan_slot.part.20+0x21/0x106
          [<ffffffff813cdce2>] pci_scan_slot+0x2b/0x35
          [<ffffffff81c8dae4>] __pci_scan_child_bus+0x51/0x107
          [<ffffffff81c8d75b>] pci_scan_bridge+0x376/0x6ae
          [<ffffffff81c8db60>] __pci_scan_child_bus+0xcd/0x107
          [<ffffffff81c8dbab>] pci_scan_child_bus+0x11/0x2a
          [<ffffffff81cca58c>] pci_acpi_scan_root+0x18b/0x21c
          [<ffffffff81c916be>] acpi_pci_root_add+0x1e1/0x42a
          [<ffffffff81406210>] acpi_device_probe+0x50/0x190
          [<ffffffff814a0227>] really_probe+0x99/0x126
      
      Need to free saved_buffer for capabilities.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      f796841e
  19. 15 2月, 2012 2 次提交
  20. 24 1月, 2012 1 次提交
    • R
      kernel-doc: fix new warnings in pci · 6e9292c5
      Randy Dunlap 提交于
      Fix new kernel-doc warnings:
      
      Warning(drivers/pci/pci.c:2811): No description found for parameter 'dev'
      Warning(drivers/pci/pci.c:2811): Excess function parameter 'pdev' description in 'pci_intx_mask_supported'
      Warning(drivers/pci/pci.c:2894): No description found for parameter 'dev'
      Warning(drivers/pci/pci.c:2894): Excess function parameter 'pdev' description in 'pci_check_and_mask_intx'
      Warning(drivers/pci/pci.c:2908): No description found for parameter 'dev'
      Warning(drivers/pci/pci.c:2908): Excess function parameter 'pdev' description in 'pci_check_and_unmask_intx'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6e9292c5
  21. 13 1月, 2012 1 次提交
    • K
      pci: Introduce __pci_reset_function_locked to be used when holding device_lock. · a96d627a
      Konrad Rzeszutek Wilk 提交于
      The use case of this is when a driver wants to call FLR when a device
      is attached to it using the SysFS "bind" or "unbind" functionality.
      
      The call chain when a user does "bind" looks as so:
      
       echo "0000:01.07.0" > /sys/bus/pci/drivers/XXXX/bind
      
      and ends up calling:
        driver_bind:
          device_lock(dev);  <=== TAKES LOCK
          XXXX_probe:
               .. pci_enable_device()
               ...__pci_reset_function(), which calls
                       pci_dev_reset(dev, 0):
                              if (!0) {
                                      device_lock(dev) <==== DEADLOCK
      
      The __pci_reset_function_locked function allows the the drivers
      'probe' function to call the "pci_reset_function" while still holding
      the driver mutex lock.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a96d627a
  22. 07 1月, 2012 2 次提交