diff options
author | Justin M. Forbes <jforbes@fedoraproject.org> | 2020-06-10 17:15:58 -0500 |
---|---|---|
committer | Justin M. Forbes <jforbes@fedoraproject.org> | 2020-06-10 17:15:58 -0500 |
commit | 614b7d7d7b10d8e3f146bed311215f818be5accd (patch) | |
tree | ff92323ae8547b034624753824df4568b1079918 /0001-add-pci_hw_vendor_status.patch | |
parent | f74d84eda2966af5c10fcae2ef90a940f96943a0 (diff) | |
download | kernel-614b7d7d7b10d8e3f146bed311215f818be5accd.tar.gz kernel-614b7d7d7b10d8e3f146bed311215f818be5accd.tar.xz kernel-614b7d7d7b10d8e3f146bed311215f818be5accd.zip |
Initial 5.7.2 rebase
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
Diffstat (limited to '0001-add-pci_hw_vendor_status.patch')
-rw-r--r-- | 0001-add-pci_hw_vendor_status.patch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/0001-add-pci_hw_vendor_status.patch b/0001-add-pci_hw_vendor_status.patch new file mode 100644 index 000000000..ebd330296 --- /dev/null +++ b/0001-add-pci_hw_vendor_status.patch @@ -0,0 +1,96 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi <mlombard@redhat.com> +Date: Mon, 18 Jun 2018 12:51:25 -0400 +Subject: [PATCH] add pci_hw_vendor_status() + +Message-id: <1529326285-28560-1-git-send-email-mlombard@redhat.com> +Patchwork-id: 222337 +O-Subject: [RHEL8 PATCH] pci: add pci_hw_vendor_status() +Bugzilla: 1590829 +RH-Acked-by: Tomas Henzl <thenzl@redhat.com> +RH-Acked-by: Prarit Bhargava <prarit@redhat.com> + +This patch adds pci_hw_vendor_status() like in RHEL7 which should be called +during the driver's probe to identify deprecated devices. + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1590829 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=16761315 + +See RHEL7 commits e0dddd9a63403ec82077ed410074fc6485873d4b and +3fcddde5ddf4b190c84ce9d83d56a75137513bd7 + +RHEL_only. + +Upstream Status: RHEL only +Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> +Signed-off-by: Herton R. Krzesinski <herton@redhat.com> +--- + drivers/pci/pci-driver.c | 29 +++++++++++++++++++++++++++++ + include/linux/pci.h | 4 ++++ + 2 files changed, 33 insertions(+) + +diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c +index 0454ca0e4e3f..5cc490b821be 100644 +--- a/drivers/pci/pci-driver.c ++++ b/drivers/pci/pci-driver.c +@@ -18,6 +18,7 @@ + #include <linux/kexec.h> + #include <linux/of_device.h> + #include <linux/acpi.h> ++#include <linux/kernel.h> + #include "pci.h" + #include "pcie/portdrv.h" + +@@ -278,6 +279,34 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv, + return found_id; + } + ++/** ++ * pci_hw_vendor_status - Tell if a PCI device is supported by the HW vendor ++ * @ids: array of PCI device id structures to search in ++ * @dev: the PCI device structure to match against ++ * ++ * Used by a driver to check whether this device is in its list of unsupported ++ * devices. Returns the matching pci_device_id structure or %NULL if there is ++ * no match. ++ * ++ * Reserved for Internal Red Hat use only. ++ */ ++const struct pci_device_id *pci_hw_vendor_status( ++ const struct pci_device_id *ids, ++ struct pci_dev *dev) ++{ ++ char devinfo[64]; ++ const struct pci_device_id *ret = pci_match_id(ids, dev); ++ ++ if (ret) { ++ snprintf(devinfo, sizeof(devinfo), "%s %s", ++ dev_driver_string(&dev->dev), dev_name(&dev->dev)); ++ mark_hardware_deprecated(devinfo); ++ } ++ ++ return ret; ++} ++EXPORT_SYMBOL(pci_hw_vendor_status); ++ + struct drv_dev_and_id { + struct pci_driver *drv; + struct pci_dev *dev; +diff --git a/include/linux/pci.h b/include/linux/pci.h +index 83ce1cdf5676..88397dd562d9 100644 +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -1397,6 +1397,10 @@ int pci_add_dynid(struct pci_driver *drv, + unsigned long driver_data); + const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, + struct pci_dev *dev); ++/* Reserved for Internal Red Hat use only */ ++const struct pci_device_id *pci_hw_vendor_status( ++ const struct pci_device_id *ids, ++ struct pci_dev *dev); + int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, + int pass); + +-- +2.26.2 + |