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

Pull PCI fixes from Bjorn Helgaas:

- fix CONFIG_PCI=n build error (introduced in v4.14-rc1) (Geert
Uytterhoeven)

- fix a race in sysfs driver_override store/show (Nicolai Stange)

* tag 'pci-v4.14-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: Fix race condition with driver_override
PCI: Add dummy pci_acs_enabled() for CONFIG_PCI=n build

+11 -2
+9 -2
drivers/pci/pci-sysfs.c
··· 686 686 const char *buf, size_t count) 687 687 { 688 688 struct pci_dev *pdev = to_pci_dev(dev); 689 - char *driver_override, *old = pdev->driver_override, *cp; 689 + char *driver_override, *old, *cp; 690 690 691 691 /* We need to keep extra room for a newline */ 692 692 if (count >= (PAGE_SIZE - 1)) ··· 700 700 if (cp) 701 701 *cp = '\0'; 702 702 703 + device_lock(dev); 704 + old = pdev->driver_override; 703 705 if (strlen(driver_override)) { 704 706 pdev->driver_override = driver_override; 705 707 } else { 706 708 kfree(driver_override); 707 709 pdev->driver_override = NULL; 708 710 } 711 + device_unlock(dev); 709 712 710 713 kfree(old); 711 714 ··· 719 716 struct device_attribute *attr, char *buf) 720 717 { 721 718 struct pci_dev *pdev = to_pci_dev(dev); 719 + ssize_t len; 722 720 723 - return snprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override); 721 + device_lock(dev); 722 + len = snprintf(buf, PAGE_SIZE, "%s\n", pdev->driver_override); 723 + device_unlock(dev); 724 + return len; 724 725 } 725 726 static DEVICE_ATTR_RW(driver_override); 726 727
+2
include/linux/pci.h
··· 1685 1685 1686 1686 #define dev_is_pci(d) (false) 1687 1687 #define dev_is_pf(d) (false) 1688 + static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) 1689 + { return false; } 1688 1690 #endif /* CONFIG_PCI */ 1689 1691 1690 1692 /* Include architecture-dependent settings and functions */