gitlab.arm.com will be in the maintainance mode on Wednesday June 29th 01:00 - 10:00 (UTC+1). Repositories is read only during the maintainance.

Commit d28f3e72 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas::

 - Fix PCI kconfig menu organization (Rob Herring)

 - Fix pci_alloc_irq_vectors_affinity() error return to allow "reduce
   and retry" for drivers using IRQ sets (Ming Lei)

 - Fix "pci=disable_acs_redir" initdata use-after-free problem (Logan
   Gunthorpe)

* tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter
  PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity()
  PCI: Fix PCI kconfig menu organization
parents 8b4fe58d d2fd6e81
...@@ -21,13 +21,14 @@ menuconfig PCI ...@@ -21,13 +21,14 @@ menuconfig PCI
support for PCI-X and the foundations for PCI Express support. support for PCI-X and the foundations for PCI Express support.
Say 'Y' here unless you know what you are doing. Say 'Y' here unless you know what you are doing.
if PCI
config PCI_DOMAINS config PCI_DOMAINS
bool bool
depends on PCI depends on PCI
config PCI_DOMAINS_GENERIC config PCI_DOMAINS_GENERIC
bool bool
depends on PCI
select PCI_DOMAINS select PCI_DOMAINS
config PCI_SYSCALL config PCI_SYSCALL
...@@ -37,7 +38,6 @@ source "drivers/pci/pcie/Kconfig" ...@@ -37,7 +38,6 @@ source "drivers/pci/pcie/Kconfig"
config PCI_MSI config PCI_MSI
bool "Message Signaled Interrupts (MSI and MSI-X)" bool "Message Signaled Interrupts (MSI and MSI-X)"
depends on PCI
select GENERIC_MSI_IRQ select GENERIC_MSI_IRQ
help help
This allows device drivers to enable MSI (Message Signaled This allows device drivers to enable MSI (Message Signaled
...@@ -59,7 +59,6 @@ config PCI_MSI_IRQ_DOMAIN ...@@ -59,7 +59,6 @@ config PCI_MSI_IRQ_DOMAIN
config PCI_QUIRKS config PCI_QUIRKS
default y default y
bool "Enable PCI quirk workarounds" if EXPERT bool "Enable PCI quirk workarounds" if EXPERT
depends on PCI
help help
This enables workarounds for various PCI chipset bugs/quirks. This enables workarounds for various PCI chipset bugs/quirks.
Disable this only if your target machine is unaffected by PCI Disable this only if your target machine is unaffected by PCI
...@@ -67,7 +66,7 @@ config PCI_QUIRKS ...@@ -67,7 +66,7 @@ config PCI_QUIRKS
config PCI_DEBUG config PCI_DEBUG
bool "PCI Debugging" bool "PCI Debugging"
depends on PCI && DEBUG_KERNEL depends on DEBUG_KERNEL
help help
Say Y here if you want the PCI core to produce a bunch of debug Say Y here if you want the PCI core to produce a bunch of debug
messages to the system log. Select this if you are having a messages to the system log. Select this if you are having a
...@@ -77,7 +76,6 @@ config PCI_DEBUG ...@@ -77,7 +76,6 @@ config PCI_DEBUG
config PCI_REALLOC_ENABLE_AUTO config PCI_REALLOC_ENABLE_AUTO
bool "Enable PCI resource re-allocation detection" bool "Enable PCI resource re-allocation detection"
depends on PCI
depends on PCI_IOV depends on PCI_IOV
help help
Say Y here if you want the PCI core to detect if PCI resource Say Y here if you want the PCI core to detect if PCI resource
...@@ -90,7 +88,6 @@ config PCI_REALLOC_ENABLE_AUTO ...@@ -90,7 +88,6 @@ config PCI_REALLOC_ENABLE_AUTO
config PCI_STUB config PCI_STUB
tristate "PCI Stub driver" tristate "PCI Stub driver"
depends on PCI
help help
Say Y or M here if you want be able to reserve a PCI device Say Y or M here if you want be able to reserve a PCI device
when it is going to be assigned to a guest operating system. when it is going to be assigned to a guest operating system.
...@@ -99,7 +96,6 @@ config PCI_STUB ...@@ -99,7 +96,6 @@ config PCI_STUB
config PCI_PF_STUB config PCI_PF_STUB
tristate "PCI PF Stub driver" tristate "PCI PF Stub driver"
depends on PCI
depends on PCI_IOV depends on PCI_IOV
help help
Say Y or M here if you want to enable support for devices that Say Y or M here if you want to enable support for devices that
...@@ -111,7 +107,7 @@ config PCI_PF_STUB ...@@ -111,7 +107,7 @@ config PCI_PF_STUB
config XEN_PCIDEV_FRONTEND config XEN_PCIDEV_FRONTEND
tristate "Xen PCI Frontend" tristate "Xen PCI Frontend"
depends on PCI && X86 && XEN depends on X86 && XEN
select PCI_XEN select PCI_XEN
select XEN_XENBUS_FRONTEND select XEN_XENBUS_FRONTEND
default y default y
...@@ -133,7 +129,6 @@ config PCI_BRIDGE_EMUL ...@@ -133,7 +129,6 @@ config PCI_BRIDGE_EMUL
config PCI_IOV config PCI_IOV
bool "PCI IOV support" bool "PCI IOV support"
depends on PCI
select PCI_ATS select PCI_ATS
help help
I/O Virtualization is a PCI feature supported by some devices I/O Virtualization is a PCI feature supported by some devices
...@@ -144,7 +139,6 @@ config PCI_IOV ...@@ -144,7 +139,6 @@ config PCI_IOV
config PCI_PRI config PCI_PRI
bool "PCI PRI support" bool "PCI PRI support"
depends on PCI
select PCI_ATS select PCI_ATS
help help
PRI is the PCI Page Request Interface. It allows PCI devices that are PRI is the PCI Page Request Interface. It allows PCI devices that are
...@@ -154,7 +148,6 @@ config PCI_PRI ...@@ -154,7 +148,6 @@ config PCI_PRI
config PCI_PASID config PCI_PASID
bool "PCI PASID support" bool "PCI PASID support"
depends on PCI
select PCI_ATS select PCI_ATS
help help
Process Address Space Identifiers (PASIDs) can be used by PCI devices Process Address Space Identifiers (PASIDs) can be used by PCI devices
...@@ -167,7 +160,7 @@ config PCI_PASID ...@@ -167,7 +160,7 @@ config PCI_PASID
config PCI_P2PDMA config PCI_P2PDMA
bool "PCI peer-to-peer transfer support" bool "PCI peer-to-peer transfer support"
depends on PCI && ZONE_DEVICE depends on ZONE_DEVICE
select GENERIC_ALLOCATOR select GENERIC_ALLOCATOR
help help
Enableѕ drivers to do PCI peer-to-peer transactions to and from Enableѕ drivers to do PCI peer-to-peer transactions to and from
...@@ -184,12 +177,11 @@ config PCI_P2PDMA ...@@ -184,12 +177,11 @@ config PCI_P2PDMA
config PCI_LABEL config PCI_LABEL
def_bool y if (DMI || ACPI) def_bool y if (DMI || ACPI)
depends on PCI
select NLS select NLS
config PCI_HYPERV config PCI_HYPERV
tristate "Hyper-V PCI Frontend" tristate "Hyper-V PCI Frontend"
depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64 depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
help help
The PCI device frontend driver allows the kernel to import arbitrary The PCI device frontend driver allows the kernel to import arbitrary
PCI devices from a PCI backend to support PCI driver domains. PCI devices from a PCI backend to support PCI driver domains.
...@@ -198,3 +190,5 @@ source "drivers/pci/hotplug/Kconfig" ...@@ -198,3 +190,5 @@ source "drivers/pci/hotplug/Kconfig"
source "drivers/pci/controller/Kconfig" source "drivers/pci/controller/Kconfig"
source "drivers/pci/endpoint/Kconfig" source "drivers/pci/endpoint/Kconfig"
source "drivers/pci/switch/Kconfig" source "drivers/pci/switch/Kconfig"
endif
...@@ -1168,7 +1168,8 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, ...@@ -1168,7 +1168,8 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
const struct irq_affinity *affd) const struct irq_affinity *affd)
{ {
static const struct irq_affinity msi_default_affd; static const struct irq_affinity msi_default_affd;
int vecs = -ENOSPC; int msix_vecs = -ENOSPC;
int msi_vecs = -ENOSPC;
if (flags & PCI_IRQ_AFFINITY) { if (flags & PCI_IRQ_AFFINITY) {
if (!affd) if (!affd)
...@@ -1179,16 +1180,17 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, ...@@ -1179,16 +1180,17 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
} }
if (flags & PCI_IRQ_MSIX) { if (flags & PCI_IRQ_MSIX) {
vecs = __pci_enable_msix_range(dev, NULL, min_vecs, max_vecs, msix_vecs = __pci_enable_msix_range(dev, NULL, min_vecs,
affd); max_vecs, affd);
if (vecs > 0) if (msix_vecs > 0)
return vecs; return msix_vecs;
} }
if (flags & PCI_IRQ_MSI) { if (flags & PCI_IRQ_MSI) {
vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs, affd); msi_vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs,
if (vecs > 0) affd);
return vecs; if (msi_vecs > 0)
return msi_vecs;
} }
/* use legacy irq if allowed */ /* use legacy irq if allowed */
...@@ -1199,7 +1201,9 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, ...@@ -1199,7 +1201,9 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
} }
} }
return vecs; if (msix_vecs == -ENOSPC)
return -ENOSPC;
return msi_vecs;
} }
EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity); EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity);
......
...@@ -6195,7 +6195,8 @@ static int __init pci_setup(char *str) ...@@ -6195,7 +6195,8 @@ static int __init pci_setup(char *str)
} else if (!strncmp(str, "pcie_scan_all", 13)) { } else if (!strncmp(str, "pcie_scan_all", 13)) {
pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS);
} else if (!strncmp(str, "disable_acs_redir=", 18)) { } else if (!strncmp(str, "disable_acs_redir=", 18)) {
disable_acs_redir_param = str + 18; disable_acs_redir_param =
kstrdup(str + 18, GFP_KERNEL);
} else { } else {
printk(KERN_ERR "PCI: Unknown option `%s'\n", printk(KERN_ERR "PCI: Unknown option `%s'\n",
str); str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment