Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v4.3-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:
"These are fixes for things we merged for v4.3 (VPD, MSI, and bridge
window management), and a new Renesas R8A7794 SoC device ID.

Details:

Resource management:
- Revert pci_read_bridge_bases() unification (Bjorn Helgaas)
- Clear IORESOURCE_UNSET when clipping a bridge window (Bjorn
Helgaas)

MSI:
- Fix MSI IRQ domains for VFs on virtual buses (Alex Williamson)

Renesas R-Car host bridge driver:
- Add R8A7794 support (Sergei Shtylyov)

Miscellaneous:
- Fix devfn for VPD access through function 0 (Alex Williamson)
- Use function 0 VPD only for identical functions (Alex Williamson)"

* tag 'pci-v4.3-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: rcar: Add R8A7794 support
PCI: Use function 0 VPD for identical functions, regular VPD for others
PCI: Fix devfn for VPD access through function 0
PCI/MSI: Fix MSI IRQ domains for VFs on virtual buses
PCI: Clear IORESOURCE_UNSET when clipping a bridge window
PCI: Revert "PCI: Call pci_read_bridge_bases() from core instead of arch code"

+80 -43
+2 -1
Documentation/devicetree/bindings/pci/pci-rcar-gen2.txt
··· 7 7 8 8 Required properties: 9 9 - compatible: "renesas,pci-r8a7790" for the R8A7790 SoC; 10 - "renesas,pci-r8a7791" for the R8A7791 SoC. 10 + "renesas,pci-r8a7791" for the R8A7791 SoC; 11 + "renesas,pci-r8a7794" for the R8A7794 SoC. 11 12 - reg: A list of physical regions to access the device: the first is 12 13 the operational registers for the OHCI/EHCI controllers and the 13 14 second is for the bridge configuration and control registers.
+6 -1
arch/alpha/kernel/pci.c
··· 242 242 243 243 void pcibios_fixup_bus(struct pci_bus *bus) 244 244 { 245 - struct pci_dev *dev; 245 + struct pci_dev *dev = bus->self; 246 + 247 + if (pci_has_flag(PCI_PROBE_ONLY) && dev && 248 + (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { 249 + pci_read_bridge_bases(bus); 250 + } 246 251 247 252 list_for_each_entry(dev, &bus->devices, bus_list) { 248 253 pdev_save_srm_config(dev);
+2
arch/frv/mb93090-mb00/pci-vdk.c
··· 294 294 printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); 295 295 #endif 296 296 297 + pci_read_bridge_bases(bus); 298 + 297 299 if (bus->number == 0) { 298 300 struct pci_dev *dev; 299 301 list_for_each_entry(dev, &bus->devices, bus_list) {
+3 -2
arch/ia64/pci/pci.c
··· 533 533 { 534 534 struct pci_dev *dev; 535 535 536 - if (b->self) 536 + if (b->self) { 537 + pci_read_bridge_bases(b); 537 538 pcibios_fixup_bridge_resources(b->self); 538 - 539 + } 539 540 list_for_each_entry(dev, &b->devices, bus_list) 540 541 pcibios_fixup_device_resources(dev); 541 542 platform_pci_fixup_bus(b);
+8 -1
arch/microblaze/pci/pci-common.c
··· 863 863 864 864 void pcibios_fixup_bus(struct pci_bus *bus) 865 865 { 866 - /* Fixup the bus */ 866 + /* When called from the generic PCI probe, read PCI<->PCI bridge 867 + * bases. This is -not- called when generating the PCI tree from 868 + * the OF device-tree. 869 + */ 870 + if (bus->self != NULL) 871 + pci_read_bridge_bases(bus); 872 + 873 + /* Now fixup the bus bus */ 867 874 pcibios_setup_bus_self(bus); 868 875 869 876 /* Now fixup devices on that bus */
+6
arch/mips/pci/pci.c
··· 311 311 312 312 void pcibios_fixup_bus(struct pci_bus *bus) 313 313 { 314 + struct pci_dev *dev = bus->self; 315 + 316 + if (pci_has_flag(PCI_PROBE_ONLY) && dev && 317 + (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { 318 + pci_read_bridge_bases(bus); 319 + } 314 320 } 315 321 316 322 EXPORT_SYMBOL(PCIBIOS_MIN_IO);
+1
arch/mn10300/unit-asb2305/pci.c
··· 324 324 struct pci_dev *dev; 325 325 326 326 if (bus->self) { 327 + pci_read_bridge_bases(bus); 327 328 pcibios_fixup_bridge_resources(bus->self); 328 329 } 329 330
+7 -1
arch/powerpc/kernel/pci-common.c
··· 1032 1032 1033 1033 void pcibios_fixup_bus(struct pci_bus *bus) 1034 1034 { 1035 - /* Fixup the bus */ 1035 + /* When called from the generic PCI probe, read PCI<->PCI bridge 1036 + * bases. This is -not- called when generating the PCI tree from 1037 + * the OF device-tree. 1038 + */ 1039 + pci_read_bridge_bases(bus); 1040 + 1041 + /* Now fixup the bus bus */ 1036 1042 pcibios_setup_bus_self(bus); 1037 1043 1038 1044 /* Now fixup devices on that bus */
+1
arch/x86/pci/common.c
··· 166 166 { 167 167 struct pci_dev *dev; 168 168 169 + pci_read_bridge_bases(b); 169 170 list_for_each_entry(dev, &b->devices, bus_list) 170 171 pcibios_fixup_device_resources(dev); 171 172 }
+4
arch/xtensa/kernel/pci.c
··· 210 210 211 211 void pcibios_fixup_bus(struct pci_bus *bus) 212 212 { 213 + if (bus->parent) { 214 + /* This is a subordinate bridge */ 215 + pci_read_bridge_bases(bus); 216 + } 213 217 } 214 218 215 219 void pcibios_set_master(struct pci_dev *dev)
+3
drivers/parisc/dino.c
··· 560 560 } else if (bus->parent) { 561 561 int i; 562 562 563 + pci_read_bridge_bases(bus); 564 + 565 + 563 566 for(i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) { 564 567 if((bus->self->resource[i].flags & 565 568 (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
+1
drivers/parisc/lba_pci.c
··· 693 693 if (bus->parent) { 694 694 int i; 695 695 /* PCI-PCI Bridge */ 696 + pci_read_bridge_bases(bus); 696 697 for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) 697 698 pci_claim_bridge_resource(bus->self, i); 698 699 } else {
+4 -23
drivers/pci/access.c
··· 442 442 static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count, 443 443 void *arg) 444 444 { 445 - struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn)); 445 + struct pci_dev *tdev = pci_get_slot(dev->bus, 446 + PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); 446 447 ssize_t ret; 447 448 448 449 if (!tdev) ··· 457 456 static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count, 458 457 const void *arg) 459 458 { 460 - struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn)); 459 + struct pci_dev *tdev = pci_get_slot(dev->bus, 460 + PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); 461 461 ssize_t ret; 462 462 463 463 if (!tdev) ··· 475 473 .release = pci_vpd_pci22_release, 476 474 }; 477 475 478 - static int pci_vpd_f0_dev_check(struct pci_dev *dev) 479 - { 480 - struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn)); 481 - int ret = 0; 482 - 483 - if (!tdev) 484 - return -ENODEV; 485 - if (!tdev->vpd || !tdev->multifunction || 486 - dev->class != tdev->class || dev->vendor != tdev->vendor || 487 - dev->device != tdev->device) 488 - ret = -ENODEV; 489 - 490 - pci_dev_put(tdev); 491 - return ret; 492 - } 493 - 494 476 int pci_vpd_pci22_init(struct pci_dev *dev) 495 477 { 496 478 struct pci_vpd_pci22 *vpd; ··· 483 497 cap = pci_find_capability(dev, PCI_CAP_ID_VPD); 484 498 if (!cap) 485 499 return -ENODEV; 486 - if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0) { 487 - int ret = pci_vpd_f0_dev_check(dev); 488 500 489 - if (ret) 490 - return ret; 491 - } 492 501 vpd = kzalloc(sizeof(*vpd), GFP_ATOMIC); 493 502 if (!vpd) 494 503 return -ENOMEM;
+2
drivers/pci/bus.c
··· 256 256 257 257 res->start = start; 258 258 res->end = end; 259 + res->flags &= ~IORESOURCE_UNSET; 260 + orig_res.flags &= ~IORESOURCE_UNSET; 259 261 dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n", 260 262 &orig_res, res); 261 263
+1
drivers/pci/host/pci-rcar-gen2.c
··· 362 362 static struct of_device_id rcar_pci_of_match[] = { 363 363 { .compatible = "renesas,pci-r8a7790", }, 364 364 { .compatible = "renesas,pci-r8a7791", }, 365 + { .compatible = "renesas,pci-r8a7794", }, 365 366 { }, 366 367 }; 367 368
+11 -12
drivers/pci/probe.c
··· 676 676 static void pci_set_bus_msi_domain(struct pci_bus *bus) 677 677 { 678 678 struct irq_domain *d; 679 + struct pci_bus *b; 679 680 680 681 /* 681 - * Either bus is the root, and we must obtain it from the 682 - * firmware, or we inherit it from the bridge device. 682 + * The bus can be a root bus, a subordinate bus, or a virtual bus 683 + * created by an SR-IOV device. Walk up to the first bridge device 684 + * found or derive the domain from the host bridge. 683 685 */ 684 - if (pci_is_root_bus(bus)) 685 - d = pci_host_bridge_msi_domain(bus); 686 - else 687 - d = dev_get_msi_domain(&bus->self->dev); 686 + for (b = bus, d = NULL; !d && !pci_is_root_bus(b); b = b->parent) { 687 + if (b->self) 688 + d = dev_get_msi_domain(&b->self->dev); 689 + } 690 + 691 + if (!d) 692 + d = pci_host_bridge_msi_domain(b); 688 693 689 694 dev_set_msi_domain(&bus->dev, d); 690 695 } ··· 860 855 child->bridge_ctl = bctl; 861 856 } 862 857 863 - /* Read and initialize bridge resources */ 864 - pci_read_bridge_bases(child); 865 - 866 858 cmax = pci_scan_child_bus(child); 867 859 if (cmax > subordinate) 868 860 dev_warn(&dev->dev, "bridge has subordinate %02x but max busn %02x\n", ··· 920 918 921 919 if (!is_cardbus) { 922 920 child->bridge_ctl = bctl; 923 - 924 - /* Read and initialize bridge resources */ 925 - pci_read_bridge_bases(child); 926 921 max = pci_scan_child_bus(child); 927 922 } else { 928 923 /*
+18 -2
drivers/pci/quirks.c
··· 1907 1907 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, 1908 1908 PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos); 1909 1909 1910 + /* 1911 + * Quirk non-zero PCI functions to route VPD access through function 0 for 1912 + * devices that share VPD resources between functions. The functions are 1913 + * expected to be identical devices. 1914 + */ 1910 1915 static void quirk_f0_vpd_link(struct pci_dev *dev) 1911 1916 { 1912 - if (!dev->multifunction || !PCI_FUNC(dev->devfn)) 1917 + struct pci_dev *f0; 1918 + 1919 + if (!PCI_FUNC(dev->devfn)) 1913 1920 return; 1914 - dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0; 1921 + 1922 + f0 = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); 1923 + if (!f0) 1924 + return; 1925 + 1926 + if (f0->vpd && dev->class == f0->class && 1927 + dev->vendor == f0->vendor && dev->device == f0->device) 1928 + dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0; 1929 + 1930 + pci_dev_put(f0); 1915 1931 } 1916 1932 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, 1917 1933 PCI_CLASS_NETWORK_ETHERNET, 8, quirk_f0_vpd_link);