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.4-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fixes from Bjorn Helgaas:
"Here are a few fixes I'd like to have in v4.4: a generic one for sysfs
and three for HiSilicon and DesignWare host controllers.

Summary:

NUMA:
- Prevent out of bounds access in numa_node override (Mathias Krause)

HiSilicon host bridge driver:
- Fix deferred probing (Arnd Bergmann)

Synopsys DesignWare host bridge driver:
- Remove incorrect io_base assignment (Stanimir Varbanov)
- Move align_resource function pointer to pci_host_bridge structure
(Gabriele Paoloni)"

* tag 'pci-v4.4-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
ARM/PCI: Move align_resource function pointer to pci_host_bridge structure
PCI: hisi: Fix deferred probing
PCI: designware: Remove incorrect io_base assignment
PCI: Prevent out of bounds access in numa_node override

+26 -14
+11 -8
arch/arm/kernel/bios32.c
··· 17 17 #include <asm/mach/pci.h> 18 18 19 19 static int debug_pci; 20 - static resource_size_t (*align_resource)(struct pci_dev *dev, 21 - const struct resource *res, 22 - resource_size_t start, 23 - resource_size_t size, 24 - resource_size_t align) = NULL; 25 20 26 21 /* 27 22 * We can't use pci_get_device() here since we are ··· 456 461 sys->busnr = busnr; 457 462 sys->swizzle = hw->swizzle; 458 463 sys->map_irq = hw->map_irq; 459 - align_resource = hw->align_resource; 460 464 INIT_LIST_HEAD(&sys->resources); 461 465 462 466 if (hw->private_data) ··· 464 470 ret = hw->setup(nr, sys); 465 471 466 472 if (ret > 0) { 473 + struct pci_host_bridge *host_bridge; 474 + 467 475 ret = pcibios_init_resources(nr, sys); 468 476 if (ret) { 469 477 kfree(sys); ··· 487 491 busnr = sys->bus->busn_res.end + 1; 488 492 489 493 list_add(&sys->node, head); 494 + 495 + host_bridge = pci_find_host_bridge(sys->bus); 496 + host_bridge->align_resource = hw->align_resource; 490 497 } else { 491 498 kfree(sys); 492 499 if (ret < 0) ··· 577 578 { 578 579 struct pci_dev *dev = data; 579 580 resource_size_t start = res->start; 581 + struct pci_host_bridge *host_bridge; 580 582 581 583 if (res->flags & IORESOURCE_IO && start & 0x300) 582 584 start = (start + 0x3ff) & ~0x3ff; 583 585 584 586 start = (start + align - 1) & ~(align - 1); 585 587 586 - if (align_resource) 587 - return align_resource(dev, res, start, size, align); 588 + host_bridge = pci_find_host_bridge(dev->bus); 589 + 590 + if (host_bridge->align_resource) 591 + return host_bridge->align_resource(dev, res, 592 + start, size, align); 588 593 589 594 return start; 590 595 }
-1
drivers/pci/host/pcie-designware.c
··· 440 440 ret, pp->io); 441 441 continue; 442 442 } 443 - pp->io_base = pp->io->start; 444 443 break; 445 444 case IORESOURCE_MEM: 446 445 pp->mem = win->res;
+2 -2
drivers/pci/host/pcie-hisi.c
··· 111 111 .link_up = hisi_pcie_link_up, 112 112 }; 113 113 114 - static int __init hisi_add_pcie_port(struct pcie_port *pp, 114 + static int hisi_add_pcie_port(struct pcie_port *pp, 115 115 struct platform_device *pdev) 116 116 { 117 117 int ret; ··· 139 139 return 0; 140 140 } 141 141 142 - static int __init hisi_pcie_probe(struct platform_device *pdev) 142 + static int hisi_pcie_probe(struct platform_device *pdev) 143 143 { 144 144 struct hisi_pcie *hisi_pcie; 145 145 struct pcie_port *pp;
+4 -1
drivers/pci/pci-sysfs.c
··· 216 216 if (ret) 217 217 return ret; 218 218 219 - if (node >= MAX_NUMNODES || !node_online(node)) 219 + if ((node < 0 && node != NUMA_NO_NODE) || node >= MAX_NUMNODES) 220 + return -EINVAL; 221 + 222 + if (node != NUMA_NO_NODE && !node_online(node)) 220 223 return -EINVAL; 221 224 222 225 add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
-2
drivers/pci/pci.h
··· 337 337 } 338 338 #endif 339 339 340 - struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus); 341 - 342 340 #endif /* DRIVERS_PCI_H */
+9
include/linux/pci.h
··· 412 412 void (*release_fn)(struct pci_host_bridge *); 413 413 void *release_data; 414 414 unsigned int ignore_reset_delay:1; /* for entire hierarchy */ 415 + /* Resource alignment requirements */ 416 + resource_size_t (*align_resource)(struct pci_dev *dev, 417 + const struct resource *res, 418 + resource_size_t start, 419 + resource_size_t size, 420 + resource_size_t align); 415 421 }; 416 422 417 423 #define to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev) 424 + 425 + struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus); 426 + 418 427 void pci_set_host_bridge_release(struct pci_host_bridge *bridge, 419 428 void (*release_fn)(struct pci_host_bridge *), 420 429 void *release_data);