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

Pull PCI fixes from Bjorn Helgaas:

- check MSI affinity vs. number of vectors to avoid memory corruption

- drop runtime power management for PCIe hotplug ports for now to avoid
regressing hotplug via sysfs

* tag 'pci-v4.10-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
Revert "PCI: pciehp: Add runtime PM support for PCIe hotplug ports"
PCI/MSI: Don't apply affinity if there aren't enough vectors left

+16 -12
-6
drivers/pci/hotplug/pciehp_ctrl.c
··· 31 31 #include <linux/kernel.h> 32 32 #include <linux/types.h> 33 33 #include <linux/slab.h> 34 - #include <linux/pm_runtime.h> 35 34 #include <linux/pci.h> 36 35 #include "../pci.h" 37 36 #include "pciehp.h" ··· 98 99 pciehp_green_led_blink(p_slot); 99 100 100 101 /* Check link training status */ 101 - pm_runtime_get_sync(&ctrl->pcie->port->dev); 102 102 retval = pciehp_check_link_status(ctrl); 103 103 if (retval) { 104 104 ctrl_err(ctrl, "Failed to check link status\n"); ··· 118 120 if (retval != -EEXIST) 119 121 goto err_exit; 120 122 } 121 - pm_runtime_put(&ctrl->pcie->port->dev); 122 123 123 124 pciehp_green_led_on(p_slot); 124 125 pciehp_set_attention_status(p_slot, 0); 125 126 return 0; 126 127 127 128 err_exit: 128 - pm_runtime_put(&ctrl->pcie->port->dev); 129 129 set_slot_off(ctrl, p_slot); 130 130 return retval; 131 131 } ··· 137 141 int retval; 138 142 struct controller *ctrl = p_slot->ctrl; 139 143 140 - pm_runtime_get_sync(&ctrl->pcie->port->dev); 141 144 retval = pciehp_unconfigure_device(p_slot); 142 - pm_runtime_put(&ctrl->pcie->port->dev); 143 145 if (retval) 144 146 return retval; 145 147
+10
drivers/pci/msi.c
··· 1206 1206 if (flags & PCI_IRQ_AFFINITY) { 1207 1207 if (!affd) 1208 1208 affd = &msi_default_affd; 1209 + 1210 + if (affd->pre_vectors + affd->post_vectors > min_vecs) 1211 + return -EINVAL; 1212 + 1213 + /* 1214 + * If there aren't any vectors left after applying the pre/post 1215 + * vectors don't bother with assigning affinity. 1216 + */ 1217 + if (affd->pre_vectors + affd->post_vectors == min_vecs) 1218 + affd = NULL; 1209 1219 } else { 1210 1220 if (WARN_ON(affd)) 1211 1221 affd = NULL;
+6 -6
drivers/pci/pci.c
··· 2241 2241 return false; 2242 2242 2243 2243 /* 2244 - * Hotplug ports handled by firmware in System Management Mode 2244 + * Hotplug interrupts cannot be delivered if the link is down, 2245 + * so parents of a hotplug port must stay awake. In addition, 2246 + * hotplug ports handled by firmware in System Management Mode 2245 2247 * may not be put into D3 by the OS (Thunderbolt on non-Macs). 2248 + * For simplicity, disallow in general for now. 2246 2249 */ 2247 - if (bridge->is_hotplug_bridge && !pciehp_is_native(bridge)) 2250 + if (bridge->is_hotplug_bridge) 2248 2251 return false; 2249 2252 2250 2253 if (pci_bridge_d3_force) ··· 2279 2276 !pci_pme_capable(dev, PCI_D3cold)) || 2280 2277 2281 2278 /* If it is a bridge it must be allowed to go to D3. */ 2282 - !pci_power_manageable(dev) || 2283 - 2284 - /* Hotplug interrupts cannot be delivered if the link is down. */ 2285 - dev->is_hotplug_bridge) 2279 + !pci_power_manageable(dev)) 2286 2280 2287 2281 *d3cold_ok = false; 2288 2282