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

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

Pull PCI fixes from Bjorn Helgaas:

- Defer VPD sizing until we actually need the contents; fixes a
boot-time slowdown reported by Dave Jones (Bjorn Helgaas)

- Stop clobbering OF fwnodes when we look for an ACPI fwnode; fixes a
virtio-iommu boot regression (Jean-Philippe Brucker)

- Add AMD GPU multi-function power dependencies; fixes runtime power
management, including GPU resume and temp and fan sensor issues (Evan
Quan)

- Update VMD maintainer to Nirmal Patel (Jon Derrick)

* tag 'pci-v5.15-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
MAINTAINERS: Add Nirmal Patel as VMD maintainer
PCI: Add AMD GPU multi-function power dependencies
PCI/ACPI: Don't reset a fwnode set by OF
PCI/VPD: Defer VPD sizing until first access

+36 -14
+2 -1
MAINTAINERS
··· 14342 14342 F: drivers/pci/controller/pci-ixp4xx.c 14343 14343 14344 14344 PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD) 14345 - M: Jonathan Derrick <jonathan.derrick@intel.com> 14345 + M: Nirmal Patel <nirmal.patel@linux.intel.com> 14346 + R: Jonathan Derrick <jonathan.derrick@linux.dev> 14346 14347 L: linux-pci@vger.kernel.org 14347 14348 S: Supported 14348 14349 F: drivers/pci/controller/vmd.c
+1 -1
drivers/pci/pci-acpi.c
··· 937 937 938 938 void pci_set_acpi_fwnode(struct pci_dev *dev) 939 939 { 940 - if (!ACPI_COMPANION(&dev->dev) && !pci_dev_is_added(dev)) 940 + if (!dev_fwnode(&dev->dev) && !pci_dev_is_added(dev)) 941 941 ACPI_COMPANION_SET(&dev->dev, 942 942 acpi_pci_find_companion(&dev->dev)); 943 943 }
+7 -2
drivers/pci/quirks.c
··· 5435 5435 PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda); 5436 5436 5437 5437 /* 5438 - * Create device link for NVIDIA GPU with integrated USB xHCI Host 5438 + * Create device link for GPUs with integrated USB xHCI Host 5439 5439 * controller to VGA. 5440 5440 */ 5441 5441 static void quirk_gpu_usb(struct pci_dev *usb) ··· 5444 5444 } 5445 5445 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, 5446 5446 PCI_CLASS_SERIAL_USB, 8, quirk_gpu_usb); 5447 + DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID, 5448 + PCI_CLASS_SERIAL_USB, 8, quirk_gpu_usb); 5447 5449 5448 5450 /* 5449 - * Create device link for NVIDIA GPU with integrated Type-C UCSI controller 5451 + * Create device link for GPUs with integrated Type-C UCSI controller 5450 5452 * to VGA. Currently there is no class code defined for UCSI device over PCI 5451 5453 * so using UNKNOWN class for now and it will be updated when UCSI 5452 5454 * over PCI gets a class code. ··· 5459 5457 pci_create_device_link(ucsi, 3, 0, PCI_BASE_CLASS_DISPLAY, 16); 5460 5458 } 5461 5459 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, 5460 + PCI_CLASS_SERIAL_UNKNOWN, 8, 5461 + quirk_gpu_usb_typec_ucsi); 5462 + DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID, 5462 5463 PCI_CLASS_SERIAL_UNKNOWN, 8, 5463 5464 quirk_gpu_usb_typec_ucsi); 5464 5465
+26 -10
drivers/pci/vpd.c
··· 99 99 return off ?: PCI_VPD_SZ_INVALID; 100 100 } 101 101 102 + static bool pci_vpd_available(struct pci_dev *dev) 103 + { 104 + struct pci_vpd *vpd = &dev->vpd; 105 + 106 + if (!vpd->cap) 107 + return false; 108 + 109 + if (vpd->len == 0) { 110 + vpd->len = pci_vpd_size(dev); 111 + if (vpd->len == PCI_VPD_SZ_INVALID) { 112 + vpd->cap = 0; 113 + return false; 114 + } 115 + } 116 + 117 + return true; 118 + } 119 + 102 120 /* 103 121 * Wait for last operation to complete. 104 122 * This code has to spin since there is no other notification from the PCI ··· 163 145 loff_t end = pos + count; 164 146 u8 *buf = arg; 165 147 166 - if (!vpd->cap) 148 + if (!pci_vpd_available(dev)) 167 149 return -ENODEV; 168 150 169 151 if (pos < 0) ··· 224 206 loff_t end = pos + count; 225 207 int ret = 0; 226 208 227 - if (!vpd->cap) 209 + if (!pci_vpd_available(dev)) 228 210 return -ENODEV; 229 211 230 212 if (pos < 0 || (pos & 3) || (count & 3)) ··· 260 242 261 243 void pci_vpd_init(struct pci_dev *dev) 262 244 { 245 + if (dev->vpd.len == PCI_VPD_SZ_INVALID) 246 + return; 247 + 263 248 dev->vpd.cap = pci_find_capability(dev, PCI_CAP_ID_VPD); 264 249 mutex_init(&dev->vpd.lock); 265 - 266 - if (!dev->vpd.len) 267 - dev->vpd.len = pci_vpd_size(dev); 268 - 269 - if (dev->vpd.len == PCI_VPD_SZ_INVALID) 270 - dev->vpd.cap = 0; 271 250 } 272 251 273 252 static ssize_t vpd_read(struct file *filp, struct kobject *kobj, ··· 309 294 310 295 void *pci_vpd_alloc(struct pci_dev *dev, unsigned int *size) 311 296 { 312 - unsigned int len = dev->vpd.len; 297 + unsigned int len; 313 298 void *buf; 314 299 int cnt; 315 300 316 - if (!dev->vpd.cap) 301 + if (!pci_vpd_available(dev)) 317 302 return ERR_PTR(-ENODEV); 318 303 304 + len = dev->vpd.len; 319 305 buf = kmalloc(len, GFP_KERNEL); 320 306 if (!buf) 321 307 return ERR_PTR(-ENOMEM);