aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 15:15:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 15:15:19 -0400
commit425553209b387fa2125df09d01a2d1c1724bd205 (patch)
treef13d9feb8f37b009d6a54bb0af369207c7ae03d9 /drivers/pci/pci.c
parent681a2895486243a82547d8c9f53043eb54b53da0 (diff)
parent617b4157a5c82ab3e9509aa388bfd3d47e0e623a (diff)
Merge tag 'pci-v3.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into next
Pull PCI changes from Bjorn Helgaas: "Enumeration - Notify driver before and after device reset (Keith Busch) - Use reset notification in NVMe (Keith Busch) NUMA - Warn if we have to guess host bridge node information (Myron Stowe) - Work around AMD Fam15h BIOSes that fail to provide _PXM (Suravee Suthikulpanit) - Clean up and mark early_root_info_init() as deprecated (Suravee Suthikulpanit) Driver binding - Add "driver_override" for force specific binding (Alex Williamson) - Fail "new_id" addition for devices we already know about (Bandan Das) Resource management - Support BAR sizes up to 8GB (Nikhil Rao, Alan Cox) - Don't move IORESOURCE_PCI_FIXED resources (Bjorn Helgaas) - Mark SBx00 HPET BAR as IORESOURCE_PCI_FIXED (Bjorn Helgaas) - Fail safely if we can't handle BARs larger than 4GB (Bjorn Helgaas) - Reject BAR above 4GB if dma_addr_t is too small (Bjorn Helgaas) - Don't convert BAR address to resource if dma_addr_t is too small (Bjorn Helgaas) - Don't set BAR to zero if dma_addr_t is too small (Bjorn Helgaas) - Don't print anything while decoding is disabled (Bjorn Helgaas) - Don't add disabled subtractive decode bus resources (Bjorn Helgaas) - Add resource allocation comments (Bjorn Helgaas) - Restrict 64-bit prefetchable bridge windows to 64-bit resources (Yinghai Lu) - Assign i82875p_edac PCI resources before adding device (Yinghai Lu) PCI device hotplug - Remove unnecessary "dev->bus" test (Bjorn Helgaas) - Use PCI_EXP_SLTCAP_PSN define (Bjorn Helgaas) - Fix rphahp endianess issues (Laurent Dufour) - Acknowledge spurious "cmd completed" event (Rajat Jain) - Allow hotplug service drivers to operate in polling mode (Rajat Jain) - Fix cpqphp possible NULL dereference (Rickard Strandqvist) MSI - Replace pci_enable_msi_block() by pci_enable_msi_exact() (Alexander Gordeev) - Replace pci_enable_msix() by pci_enable_msix_exact() (Alexander Gordeev) - Simplify populate_msi_sysfs() (Jan Beulich) Virtualization - Add Intel Patsburg (X79) root port ACS quirk (Alex Williamson) - Mark RTL8110SC INTx masking as broken (Alex Williamson) Generic host bridge driver - Add generic PCI host controller driver (Will Deacon) Freescale i.MX6 - Use new clock names (Lucas Stach) - Drop old IRQ mapping (Lucas Stach) - Remove optional (and unused) IRQs (Lucas Stach) - Add support for MSI (Lucas Stach) - Fix imx6_add_pcie_port() section mismatch warning (Sachin Kamat) Renesas R-Car - Add gen2 device tree support (Ben Dooks) - Use new OF interrupt mapping when possible (Lucas Stach) - Add PCIe driver (Phil Edworthy) - Add PCIe MSI support (Phil Edworthy) - Add PCIe device tree bindings (Phil Edworthy) Samsung Exynos - Remove unnecessary OOM messages (Jingoo Han) - Fix add_pcie_port() section mismatch warning (Sachin Kamat) Synopsys DesignWare - Make MSI ISR shared IRQ aware (Lucas Stach) Miscellaneous - Check for broken config space aliasing (Alex Williamson) - Update email address (Ben Hutchings) - Fix Broadcom CNB20LE unintended sign extension (Bjorn Helgaas) - Fix incorrect vgaarb conditional in WARN_ON() (Bjorn Helgaas) - Remove unnecessary __ref annotations (Bjorn Helgaas) - Add arch/x86/kernel/quirks.c to MAINTAINERS PCI file patterns (Bjorn Helgaas) - Fix use of uninitialized MPS value (Bjorn Helgaas) - Tidy x86/gart messages (Bjorn Helgaas) - Fix return value from pci_user_{read,write}_config_*() (Gavin Shan) - Turn pcibios_penalize_isa_irq() into a weak function (Hanjun Guo) - Remove unused serial device IDs (Jean Delvare) - Use designated initialization in PCI_VDEVICE (Mark Rustad) - Fix powerpc NULL dereference in pci_root_buses traversal (Mike Qiu) - Configure MPS on ARM (Murali Karicheri) - Remove unnecessary includes of <linux/init.h> (Paul Gortmaker) - Move Open Firmware devspec attribute to PCI common code (Sebastian Ott) - Use pdev->dev.groups for attribute creation on s390 (Sebastian Ott) - Remove pcibios_add_platform_entries() (Sebastian Ott) - Add new ID for Intel GPU "spurious interrupt" quirk (Thomas Jarosch) - Rename pci_is_bridge() to pci_has_subordinate() (Yijing Wang) - Add and use new pci_is_bridge() interface (Yijing Wang) - Make pci_bus_add_device() void (Yijing Wang) DMA API - Clarify physical/bus address distinction in docs (Bjorn Helgaas) - Fix typos in docs (Emilio López) - Update dma_pool_create ()and dma_pool_alloc() descriptions (Gioh Kim) - Change dma_declare_coherent_memory() CPU address to phys_addr_t (Bjorn Helgaas) - Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory() (Bjorn Helgaas)" * tag 'pci-v3.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (92 commits) MAINTAINERS: Add generic PCI host controller driver PCI: generic: Add generic PCI host controller driver PCI: imx6: Add support for MSI PCI: designware: Make MSI ISR shared IRQ aware PCI: imx6: Remove optional (and unused) IRQs PCI: imx6: Drop old IRQ mapping PCI: imx6: Use new clock names i82875p_edac: Assign PCI resources before adding device ARM/PCI: Call pcie_bus_configure_settings() to set MPS PCI: imx6: Fix imx6_add_pcie_port() section mismatch warning PCI: Make pci_bus_add_device() void PCI: exynos: Fix add_pcie_port() section mismatch warning PCI: Introduce new device binding path using pci_dev.driver_override PCI: rcar: Add gen2 device tree support PCI: cpqphp: Fix possible null pointer dereference PCI: rcar: Add R-Car PCIe device tree bindings PCI: rcar: Add MSI support for PCIe PCI: rcar: Add Renesas R-Car PCIe driver PCI: Fix return value from pci_user_{read,write}_config_*() PCI: exynos: Remove unnecessary OOM messages ...
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 759475ef6ff3..7ae7aa0166b6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1468,6 +1468,17 @@ void __weak pcibios_release_device(struct pci_dev *dev) {}
1468 */ 1468 */
1469void __weak pcibios_disable_device (struct pci_dev *dev) {} 1469void __weak pcibios_disable_device (struct pci_dev *dev) {}
1470 1470
1471/**
1472 * pcibios_penalize_isa_irq - penalize an ISA IRQ
1473 * @irq: ISA IRQ to penalize
1474 * @active: IRQ active or not
1475 *
1476 * Permits the platform to provide architecture-specific functionality when
1477 * penalizing ISA IRQs. This is the default implementation. Architecture
1478 * implementations can override this.
1479 */
1480void __weak pcibios_penalize_isa_irq(int irq, int active) {}
1481
1471static void do_pci_disable_device(struct pci_dev *dev) 1482static void do_pci_disable_device(struct pci_dev *dev)
1472{ 1483{
1473 u16 pci_command; 1484 u16 pci_command;
@@ -3306,8 +3317,27 @@ static void pci_dev_unlock(struct pci_dev *dev)
3306 pci_cfg_access_unlock(dev); 3317 pci_cfg_access_unlock(dev);
3307} 3318}
3308 3319
3320/**
3321 * pci_reset_notify - notify device driver of reset
3322 * @dev: device to be notified of reset
3323 * @prepare: 'true' if device is about to be reset; 'false' if reset attempt
3324 * completed
3325 *
3326 * Must be called prior to device access being disabled and after device
3327 * access is restored.
3328 */
3329static void pci_reset_notify(struct pci_dev *dev, bool prepare)
3330{
3331 const struct pci_error_handlers *err_handler =
3332 dev->driver ? dev->driver->err_handler : NULL;
3333 if (err_handler && err_handler->reset_notify)
3334 err_handler->reset_notify(dev, prepare);
3335}
3336
3309static void pci_dev_save_and_disable(struct pci_dev *dev) 3337static void pci_dev_save_and_disable(struct pci_dev *dev)
3310{ 3338{
3339 pci_reset_notify(dev, true);
3340
3311 /* 3341 /*
3312 * Wake-up device prior to save. PM registers default to D0 after 3342 * Wake-up device prior to save. PM registers default to D0 after
3313 * reset and a simple register restore doesn't reliably return 3343 * reset and a simple register restore doesn't reliably return
@@ -3329,6 +3359,7 @@ static void pci_dev_save_and_disable(struct pci_dev *dev)
3329static void pci_dev_restore(struct pci_dev *dev) 3359static void pci_dev_restore(struct pci_dev *dev)
3330{ 3360{
3331 pci_restore_state(dev); 3361 pci_restore_state(dev);
3362 pci_reset_notify(dev, false);
3332} 3363}
3333 3364
3334static int pci_dev_reset(struct pci_dev *dev, int probe) 3365static int pci_dev_reset(struct pci_dev *dev, int probe)
@@ -3345,6 +3376,7 @@ static int pci_dev_reset(struct pci_dev *dev, int probe)
3345 3376
3346 return rc; 3377 return rc;
3347} 3378}
3379
3348/** 3380/**
3349 * __pci_reset_function - reset a PCI device function 3381 * __pci_reset_function - reset a PCI device function
3350 * @dev: PCI device to reset 3382 * @dev: PCI device to reset
@@ -4126,7 +4158,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
4126 u16 cmd; 4158 u16 cmd;
4127 int rc; 4159 int rc;
4128 4160
4129 WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY))); 4161 WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) && (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
4130 4162
4131 /* ARCH specific VGA enables */ 4163 /* ARCH specific VGA enables */
4132 rc = pci_set_vga_state_arch(dev, decode, command_bits, flags); 4164 rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);