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

Pull PCI fixes from Bjorn Helgaas:
"Yinghai fixed a couple regressions: one resource assignment problem
introduced in v3.10 that showed up with SR-IOV on powerpc, and another
SR-IOV hot-remove issue related to refcounting changes we merged for
v3.11.

Yinghai is still working on another SR-IOV-related fix or two, which
will be simpler if pciehp is non-modular, so I included the Kconfig
changes now to get them in earlier.

Finally, a minor fix for the ARM Marvell EBU host bridge driver that
was merged for v3.11

Hotplug:
PCI: pciehp: Fix null pointer deref when hot-removing SR-IOV device
PCI: hotplug: Convert to be builtin only, not modular
PCI: pciehp: Convert pciehp to be builtin only, not modular

Resource allocation:
PCI: Retry allocation of only the resource type that failed

ARM:
PCI: mvebu: Disable prefetchable memory support in PCI-to-PCI bridge"

* tag 'pci-v3.11-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: mvebu: Disable prefetchable memory support in PCI-to-PCI bridge
PCI: Retry allocation of only the resource type that failed
PCI: pciehp: Convert pciehp to be builtin only, not modular
PCI: hotplug: Convert to be builtin only, not modular
PCI: pciehp: Fix null pointer deref when hot-removing SR-IOV device

+87 -44
+1 -1
arch/ia64/configs/generic_defconfig
··· 31 31 CONFIG_ACPI_DOCK=y 32 32 CONFIG_ACPI_PROCESSOR=m 33 33 CONFIG_ACPI_CONTAINER=m 34 - CONFIG_HOTPLUG_PCI=m 34 + CONFIG_HOTPLUG_PCI=y 35 35 CONFIG_HOTPLUG_PCI_ACPI=m 36 36 CONFIG_PACKET=y 37 37 CONFIG_UNIX=y
+1 -1
arch/ia64/configs/gensparse_defconfig
··· 25 25 CONFIG_ACPI_FAN=m 26 26 CONFIG_ACPI_PROCESSOR=m 27 27 CONFIG_ACPI_CONTAINER=m 28 - CONFIG_HOTPLUG_PCI=m 28 + CONFIG_HOTPLUG_PCI=y 29 29 CONFIG_HOTPLUG_PCI_ACPI=m 30 30 CONFIG_PACKET=y 31 31 CONFIG_UNIX=y
+1 -1
arch/ia64/configs/tiger_defconfig
··· 31 31 CONFIG_ACPI_FAN=m 32 32 CONFIG_ACPI_PROCESSOR=m 33 33 CONFIG_ACPI_CONTAINER=m 34 - CONFIG_HOTPLUG_PCI=m 34 + CONFIG_HOTPLUG_PCI=y 35 35 CONFIG_HOTPLUG_PCI_ACPI=m 36 36 CONFIG_PACKET=y 37 37 CONFIG_UNIX=y
+1 -1
arch/ia64/configs/xen_domu_defconfig
··· 32 32 CONFIG_ACPI_FAN=m 33 33 CONFIG_ACPI_PROCESSOR=m 34 34 CONFIG_ACPI_CONTAINER=m 35 - CONFIG_HOTPLUG_PCI=m 35 + CONFIG_HOTPLUG_PCI=y 36 36 CONFIG_HOTPLUG_PCI_ACPI=m 37 37 CONFIG_PACKET=y 38 38 CONFIG_UNIX=y
+1 -1
arch/powerpc/configs/ppc64_defconfig
··· 58 58 CONFIG_PPC_DENORMALISATION=y 59 59 CONFIG_PCCARD=y 60 60 CONFIG_ELECTRA_CF=y 61 - CONFIG_HOTPLUG_PCI=m 61 + CONFIG_HOTPLUG_PCI=y 62 62 CONFIG_HOTPLUG_PCI_RPA=m 63 63 CONFIG_HOTPLUG_PCI_RPA_DLPAR=m 64 64 CONFIG_PACKET=y
+1 -1
arch/powerpc/configs/ppc64e_defconfig
··· 32 32 CONFIG_SPARSEMEM_MANUAL=y 33 33 CONFIG_PCI_MSI=y 34 34 CONFIG_PCCARD=y 35 - CONFIG_HOTPLUG_PCI=m 35 + CONFIG_HOTPLUG_PCI=y 36 36 CONFIG_PACKET=y 37 37 CONFIG_UNIX=y 38 38 CONFIG_XFRM_USER=m
+1 -1
arch/powerpc/configs/pseries_defconfig
··· 53 53 CONFIG_PPC_SUBPAGE_PROT=y 54 54 CONFIG_SCHED_SMT=y 55 55 CONFIG_PPC_DENORMALISATION=y 56 - CONFIG_HOTPLUG_PCI=m 56 + CONFIG_HOTPLUG_PCI=y 57 57 CONFIG_HOTPLUG_PCI_RPA=m 58 58 CONFIG_HOTPLUG_PCI_RPA_DLPAR=m 59 59 CONFIG_PACKET=y
+1 -1
arch/sh/configs/sh03_defconfig
··· 22 22 CONFIG_CMDLINE_OVERWRITE=y 23 23 CONFIG_CMDLINE="console=ttySC1,115200 mem=64M root=/dev/nfs" 24 24 CONFIG_PCI=y 25 - CONFIG_HOTPLUG_PCI=m 25 + CONFIG_HOTPLUG_PCI=y 26 26 CONFIG_BINFMT_MISC=y 27 27 CONFIG_NET=y 28 28 CONFIG_PACKET=y
+1 -26
drivers/pci/host/pci-mvebu.c
··· 86 86 u16 secondary_status; 87 87 u16 membase; 88 88 u16 memlimit; 89 - u16 prefmembase; 90 - u16 prefmemlimit; 91 - u32 prefbaseupper; 92 - u32 preflimitupper; 93 89 u16 iobaseupper; 94 90 u16 iolimitupper; 95 91 u8 cappointer; ··· 415 419 break; 416 420 417 421 case PCI_PREF_MEMORY_BASE: 418 - *value = (bridge->prefmemlimit << 16 | bridge->prefmembase); 419 - break; 420 - 421 - case PCI_PREF_BASE_UPPER32: 422 - *value = bridge->prefbaseupper; 423 - break; 424 - 425 - case PCI_PREF_LIMIT_UPPER32: 426 - *value = bridge->preflimitupper; 422 + *value = 0; 427 423 break; 428 424 429 425 case PCI_IO_BASE_UPPER16: ··· 487 499 bridge->membase = value & 0xffff; 488 500 bridge->memlimit = value >> 16; 489 501 mvebu_pcie_handle_membase_change(port); 490 - break; 491 - 492 - case PCI_PREF_MEMORY_BASE: 493 - bridge->prefmembase = value & 0xffff; 494 - bridge->prefmemlimit = value >> 16; 495 - break; 496 - 497 - case PCI_PREF_BASE_UPPER32: 498 - bridge->prefbaseupper = value; 499 - break; 500 - 501 - case PCI_PREF_LIMIT_UPPER32: 502 - bridge->preflimitupper = value; 503 502 break; 504 503 505 504 case PCI_IO_BASE_UPPER16:
+1 -4
drivers/pci/hotplug/Kconfig
··· 3 3 # 4 4 5 5 menuconfig HOTPLUG_PCI 6 - tristate "Support for PCI Hotplug" 6 + bool "Support for PCI Hotplug" 7 7 depends on PCI && SYSFS 8 8 ---help--- 9 9 Say Y here if you have a motherboard with a PCI Hotplug controller. 10 10 This allows you to add and remove PCI cards while the machine is 11 11 powered up and running. 12 - 13 - To compile this driver as a module, choose M here: the 14 - module will be called pci_hotplug. 15 12 16 13 When in doubt, say N. 17 14
+8 -1
drivers/pci/hotplug/pciehp_pci.c
··· 92 92 if (ret) 93 93 presence = 0; 94 94 95 - list_for_each_entry_safe(dev, temp, &parent->devices, bus_list) { 95 + /* 96 + * Stopping an SR-IOV PF device removes all the associated VFs, 97 + * which will update the bus->devices list and confuse the 98 + * iterator. Therefore, iterate in reverse so we remove the VFs 99 + * first, then the PF. We do the same in pci_stop_bus_device(). 100 + */ 101 + list_for_each_entry_safe_reverse(dev, temp, &parent->devices, 102 + bus_list) { 96 103 pci_dev_get(dev); 97 104 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && presence) { 98 105 pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
+1 -4
drivers/pci/pcie/Kconfig
··· 14 14 # Include service Kconfig here 15 15 # 16 16 config HOTPLUG_PCI_PCIE 17 - tristate "PCI Express Hotplug driver" 17 + bool "PCI Express Hotplug driver" 18 18 depends on HOTPLUG_PCI && PCIEPORTBUS 19 19 help 20 20 Say Y here if you have a motherboard that supports PCI Express Native 21 21 Hotplug 22 - 23 - To compile this driver as a module, choose M here: the 24 - module will be called pciehp. 25 22 26 23 When in doubt, say N. 27 24
+68 -1
drivers/pci/setup-bus.c
··· 300 300 } 301 301 } 302 302 303 + static unsigned long pci_fail_res_type_mask(struct list_head *fail_head) 304 + { 305 + struct pci_dev_resource *fail_res; 306 + unsigned long mask = 0; 307 + 308 + /* check failed type */ 309 + list_for_each_entry(fail_res, fail_head, list) 310 + mask |= fail_res->flags; 311 + 312 + /* 313 + * one pref failed resource will set IORESOURCE_MEM, 314 + * as we can allocate pref in non-pref range. 315 + * Will release all assigned non-pref sibling resources 316 + * according to that bit. 317 + */ 318 + return mask & (IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH); 319 + } 320 + 321 + static bool pci_need_to_release(unsigned long mask, struct resource *res) 322 + { 323 + if (res->flags & IORESOURCE_IO) 324 + return !!(mask & IORESOURCE_IO); 325 + 326 + /* check pref at first */ 327 + if (res->flags & IORESOURCE_PREFETCH) { 328 + if (mask & IORESOURCE_PREFETCH) 329 + return true; 330 + /* count pref if its parent is non-pref */ 331 + else if ((mask & IORESOURCE_MEM) && 332 + !(res->parent->flags & IORESOURCE_PREFETCH)) 333 + return true; 334 + else 335 + return false; 336 + } 337 + 338 + if (res->flags & IORESOURCE_MEM) 339 + return !!(mask & IORESOURCE_MEM); 340 + 341 + return false; /* should not get here */ 342 + } 343 + 303 344 static void __assign_resources_sorted(struct list_head *head, 304 345 struct list_head *realloc_head, 305 346 struct list_head *fail_head) ··· 353 312 * if could do that, could get out early. 354 313 * if could not do that, we still try to assign requested at first, 355 314 * then try to reassign add_size for some resources. 315 + * 316 + * Separate three resource type checking if we need to release 317 + * assigned resource after requested + add_size try. 318 + * 1. if there is io port assign fail, will release assigned 319 + * io port. 320 + * 2. if there is pref mmio assign fail, release assigned 321 + * pref mmio. 322 + * if assigned pref mmio's parent is non-pref mmio and there 323 + * is non-pref mmio assign fail, will release that assigned 324 + * pref mmio. 325 + * 3. if there is non-pref mmio assign fail or pref mmio 326 + * assigned fail, will release assigned non-pref mmio. 356 327 */ 357 328 LIST_HEAD(save_head); 358 329 LIST_HEAD(local_fail_head); 359 330 struct pci_dev_resource *save_res; 360 - struct pci_dev_resource *dev_res; 331 + struct pci_dev_resource *dev_res, *tmp_res; 332 + unsigned long fail_type; 361 333 362 334 /* Check if optional add_size is there */ 363 335 if (!realloc_head || list_empty(realloc_head)) ··· 401 347 free_list(head); 402 348 return; 403 349 } 350 + 351 + /* check failed type */ 352 + fail_type = pci_fail_res_type_mask(&local_fail_head); 353 + /* remove not need to be released assigned res from head list etc */ 354 + list_for_each_entry_safe(dev_res, tmp_res, head, list) 355 + if (dev_res->res->parent && 356 + !pci_need_to_release(fail_type, dev_res->res)) { 357 + /* remove it from realloc_head list */ 358 + remove_from_list(realloc_head, dev_res->res); 359 + remove_from_list(&save_head, dev_res->res); 360 + list_del(&dev_res->list); 361 + kfree(dev_res); 362 + } 404 363 405 364 free_list(&local_fail_head); 406 365 /* Release assigned resource */