Commit Graph

321362 Commits

Author SHA1 Message Date
Bjorn Helgaas a690a4cbf0 Merge branch 'pci/shengzhou-irq' into next
* pci/shengzhou-irq:
  PCI: Use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
2012-09-10 16:35:40 -06:00
Bjorn Helgaas 5aaa71cf12 Merge branch 'pci/oliver-pciehp-resume' into next
* pci/oliver-pciehp-resume:
  PCI: pciehp: Always implement resume, regardless of pciehp_force param
2012-09-10 16:35:30 -06:00
Bjorn Helgaas 2c1f56acb2 Merge branch 'pci/feng-avoid-kmalloc' into next
* pci/feng-avoid-kmalloc:
  PCI: Remove the obsolete no_pci_devices() check
  PCI: Use pci_device_id on stack for pci_get_subsys/class() to avoid kmalloc
2012-09-10 16:31:08 -06:00
Feng Tang e9bf1040f6 PCI: Remove the obsolete no_pci_devices() check
In function pci_get_subsys() there is a check:

	/*
	 * pci_find_subsys() can be called on the ide_setup() path,
	 * super-early in boot.  But the down_read() will enable local
	 * interrupts, which can cause some machines to crash.  So here we
	 * detect and flag that situation and bail out early.
	 */
	if (unlikely(no_pci_devices()))
		return NULL;

But there is no ide_setup() now, and no down_read() either, which
makes the check obsolete. So remove it.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 16:23:29 -06:00
Oliver Neukum 87683e22c6 PCI: pciehp: Always implement resume, regardless of pciehp_force param
Previously, the driver ignored resume unless the pciehp_force module_param
was specified.  On some laptops that means that interrupts are not
delivered after S3, so card removals and insertions are not handled.
This patch makes the driver handle resume regardless of pciehp_force.

[bhelgaas: changelog]
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-09-07 17:06:54 -06:00
Shengzhou Liu e237d83fdf PCI: Use dev->irq instead of dev->pin to enable non MSI/INTx interrupt
On some platforms, root port has neither MSI/MSI-X nor INTx interrupt
generated in RC mode. In this case, we have to use other interrupt, e.g.,
system shared interrupt, for port service IRQ to have AER, Hot-plug, etc.,
services work.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-09-07 15:40:31 -06:00
Bjorn Helgaas be017b255e Merge branch 'pci/bjorn-remove-fakephp' into next
* pci/bjorn-remove-fakephp:
  PCI: Remove the fakephp driver
2012-09-06 16:14:19 -06:00
Bjorn Helgaas c2b5acc3a3 PCI: Remove the fakephp driver
The fakephp driver was scheduled for removal in 2011.

Fakephp presented /sys/bus/pci/slots/.../power files for every PCI
function.  Writing "0" to one of these files logically removed the device
from the system.  The PCI core now provides the same functionality with
/sys/bus/pci/devices/.../remove.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-24 14:32:07 -06:00
Feng Tang b9443f401b PCI: Use pci_device_id on stack for pci_get_subsys/class() to avoid kmalloc
This fixes a kernel warning https://lkml.org/lkml/2012/7/31/682

pci_get_subsys() may get called in late system reboot stage, using
a sleepable kmalloc() sounds fragile and will cause a kernel warning
with my recent commmit 55c844a "x86/reboot: Fix a warning message
triggered by stop_other_cpus()" which disable local interrupt in
late system shutdown/reboot phase. Using a local parameter instead
will fix it and make it eligible for calling from atomic context.

Do the same change for the pci_get_class() as suggested by Bjorn Helgaas.

Initializing the on-stack struct pci_device_id suggested by Fengguang Wu
and Jiri Slaby.  Section 6.7.8 of the C99 standard guarantees that when we
initialize some of the struct members, the rest of the struct is implicitly
initialized the same as objects with static storage duration, i.e., to zero
in this case.

[bhelgaas: changelog, incorporate Fengguang/Jiri initialization fix]
Bisected-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>
2012-08-24 12:33:13 -06:00
Bjorn Helgaas 7bf79d8a99 Merge branch 'pci/bjorn-cleanup-remove' into next
* pci/bjorn-cleanup-remove:
  PCI: Remove unused pci_dev_b()
  sgi-agp: Use list_for_each_entry() for bus->devices traversal
  parisc/PCI: Use list_for_each_entry() for bus->devices traversal
  parisc/PCI: Enable PERR/SERR on all devices
  frv/PCI: Use list_for_each_entry() for bus->devices traversal
  PCI: Leave normal LIST_POISON in deleted list entries
  PCI: Rename local variables to conventional names
  PCI: Remove unused, commented-out, code
  PCI: Stop and remove devices in one pass
  PCI: Fold stop and remove helpers into their callers
  PCI: Use list_for_each_entry() for bus->devices traversal
  PCI: Remove pci_stop_and_remove_behind_bridge()
  PCI: Don't export stop_bus_device and remove_bus_device interfaces
  pcmcia: Use common pci_stop_and_remove_bus_device()
  PCI: acpiphp: Use common pci_stop_and_remove_bus_device()
  PCI: acpiphp: Stop disabling bridges on remove
2012-08-23 18:36:10 -06:00
Bjorn Helgaas a28afda8cc Merge branch 'pci/bjorn-find-next-ext-cap' into next
* pci/bjorn-find-next-ext-cap:
  PCI: Add Vendor-Specific Extended Capability header info
  PCI: Add pci_find_next_ext_capability()

Conflicts:
	drivers/pci/pci.c
2012-08-23 18:32:36 -06:00
Bjorn Helgaas e1c171b86b Merge branch 'pci/jiang-pcie-cap' into next
* pci/jiang-pcie-cap: (40 commits)
  rtl8192e: Use PCI Express Capability accessors
  et131x: Use PCI Express Capability accessors
  rapdio/tsi721: Use PCI Express Capability accessors
  drm/radeon: Use PCI Express Capability accessors
  [SCSI] qla4xxx: Use PCI Express Capability accessors
  [SCSI] qla4xxx: Use PCI Express Capability accessors
  IB/qib: Use PCI Express Capability accessors
  IB/mthca: Use PCI Express Capability accessors
  rtlwifi: Use PCI Express Capability accessors
  iwlwifi: Use PCI Express Capability accessors
  iwlegacy: Use PCI Express Capability accessors
  ath9k: Use PCI Express Capability accessors
  atl1c: Use PCI Express Capability accessors
  cxgb4: Use PCI Express Capability accessors
  cxgb3: Use PCI Express Capability accessors
  myri10ge: Use PCI Express Capability accessors
  niu: Use PCI Express Capability accessors
  mlx4: Use PCI Express Capability accessors
  vxge: Use PCI Express Capability accessors
  igb: Use PCI Express Capability accessors
  ...
2012-08-23 18:31:58 -06:00
Jiang Liu 479e0d485e rtl8192e: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify rtl8192e driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:16 -06:00
Jiang Liu 532c5f69e2 et131x: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify et131x driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:16 -06:00
Jiang Liu 5cdaaf8a11 rapdio/tsi721: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify tsi721 driver.

[bhelgaas: use word (16-bit) accesses for PCI_EXP_DEVCTL, PCI_EXP_DEVCTL2]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alexandre Bounine <alexandre.bounine@idt.com>
2012-08-23 10:11:16 -06:00
Jiang Liu 32195aec63 drm/radeon: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify radeon driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-23 10:11:16 -06:00
Jiang Liu 5548bfd0ee [SCSI] qla4xxx: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify qla4xxx driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:15 -06:00
Jiang Liu 1009243884 [SCSI] qla4xxx: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify qla2xxx driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:15 -06:00
Jiang Liu 0921caf326 IB/qib: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify qib driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
2012-08-23 10:11:15 -06:00
Jiang Liu 3c55569b08 IB/mthca: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify mthca driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Roland Dreier <roland@purestorage.com>
2012-08-23 10:11:15 -06:00
Jiang Liu 332badc323 rtlwifi: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify rtlwifi driver.

[bhelgaas: split iwlegacy, iwlwifi, rtlwifi into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:15 -06:00
Jiang Liu a7238b37ce iwlwifi: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify iwlwifi driver.

[bhelgaas: split iwlegacy, iwlwifi, rtlwifi into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:15 -06:00
Jiang Liu 4460eb5292 iwlegacy: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify iwlegacy driver.

[bhelgaas: split iwlegacy, iwlwifi, rtlwifi into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu 08bd108096 ath9k: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify ath9k driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu eb0ff56366 atl1c: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify atl1c driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu e5c8ae5fca cxgb4: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify cxgb4 driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu c772b44e32 cxgb3: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify cxgb3 driver.

[bhelgaas: split cxgb3 and cxgb4 into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu 9503e25576 myri10ge: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify myri10ge driver.

[bhelgaas: fix myri10ge_toggle_relaxed() return value]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:14 -06:00
Jiang Liu 56cda12986 niu: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify niu driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:13 -06:00
Jiang Liu fadd1daa0b mlx4: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify mlx4 driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:13 -06:00
Jiang Liu d892aa00bc vxge: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify vxge driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:13 -06:00
Jiang Liu 23d028cc86 igb: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify igb driver.

[bhelgaas: split e1000e and igb into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-08-23 10:11:13 -06:00
Jiang Liu f8c0fcacfe e1000e: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify e1000e driver.

[bhelgaas: split e1000e and igb into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-08-23 10:11:13 -06:00
Jiang Liu 0f49bfbd0f tg3: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify tg3 driver.

[bhelgaas: split bnx2x and tg3 into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:13 -06:00
Jiang Liu 2a80eebcbf bnx2x: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify bnx2x driver.

[bhelgaas: split bnx2x and tg3 into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:12 -06:00
Bjorn Helgaas 8200bc72a8 r8169: Preserve other Device Control bits when setting NOSNOOP_EN
Previously, when we turned on the "Enable No Snoop Bit," we cleared all
the other Device Control bits, including error reporting enables,
Max_Payload_Size, Max_Read_Request_Size, etc.  This patch preserves
all the other bits.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:12 -06:00
Jiang Liu 7d7903b2a2 r8169: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify r8169 driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:12 -06:00
Jiang Liu 424ffc943d tile: PCI: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify Tile PCIe code.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
2012-08-23 10:11:12 -06:00
Jiang Liu 39a3612e03 MIPS: PCI: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify MIPS PCIe code.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: David Daney <david.daney@cavium.com>
2012-08-23 10:11:12 -06:00
Jiang Liu 3b87011d9a ARM: PCI: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify ARM PCIe code.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2012-08-23 10:11:12 -06:00
Jiang Liu f12eb72a26 PCI/ASPM: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify PCIe ASPM.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:12 -06:00
Jiang Liu 43bd4ee89f PCI/AER: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify PCIe AER.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:11 -06:00
Jiang Liu 263e54b99e PCI/PME: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify PCIe PME.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:11 -06:00
Jiang Liu 537a77e65d PCI/pciehp: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify pciehp.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
2012-08-23 10:11:11 -06:00
Jiang Liu 2dcfaf85cd PCI/portdrv: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify portdrv.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
2012-08-23 10:11:11 -06:00
Jiang Liu 028fbad480 PCI/hotplug: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify pcihp_slot.c.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
2012-08-23 10:11:11 -06:00
Bjorn Helgaas 76b57c6700 PCI: Wait for pending transactions to complete before 82599 FLR
Before initiating an FLR, we should wait for completion of any outstanding
non-posted requests.  See PCIe spec r3.0, sec 6.6.2.

This makes reset_intel_82599_sfp_virtfn() very similar to the generic
pcie_flr().  The only difference is that the 82599 doesn't report FLR
support in the VF Device Capability register.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:11 -06:00
Jiang Liu 59875ae489 PCI/core: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify core.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 09:41:37 -06:00
Jiang Liu 8c0d3a02c1 PCI: Add accessors for PCI Express Capability
The PCI Express Capability (PCIe spec r3.0, sec 7.8) comes in two
versions, v1 and v2.  In v1 Capability structures (PCIe spec r1.0 and
r1.1), some fields are optional, so the structure size depends on the
device type.

This patch adds functions to access this capability so drivers don't
have to be aware of the differences between v1 and v2.  Note that these
new functions apply only to the "PCI Express Capability," not to any of
the other "PCI Express Extended Capabilities" (AER, VC, ACS, MFVC, etc.)

Function pcie_capability_read_word/dword() reads the PCIe Capabilities
register and returns the value in the reference parameter "val".  If
the PCIe Capabilities register is not implemented on the PCIe device,
"val" is set to 0.

Function pcie_capability_write_word/dword() writes the value to the
specified PCIe Capability register.

Function pcie_capability_clear_and_set_word/dword() sets and/or clears bits
of a PCIe Capability register.

[bhelgaas: changelog, drop "pci_" prefixes, don't export
pcie_capability_reg_implemented()]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 09:41:20 -06:00
Yijing Wang b2ef39be57 PCI: Remove unused field pcie_type from struct pci_dev
With introduction of pci_pcie_type(), pci_dev->pcie_type field becomes
redundant, so remove it.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 09:41:05 -06:00