2020-05-08 14:52:40 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-04-23 20:47:21 +00:00
|
|
|
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
|
2020-08-13 17:44:32 +00:00
|
|
|
index 449466f71040..f5678ed743bf 100644
|
2020-04-23 20:47:21 +00:00
|
|
|
--- a/drivers/pci/pci-driver.c
|
|
|
|
+++ b/drivers/pci/pci-driver.c
|
2020-08-13 17:44:32 +00:00
|
|
|
@@ -19,6 +19,7 @@
|
2020-04-23 20:47:21 +00:00
|
|
|
#include <linux/kexec.h>
|
|
|
|
#include <linux/of_device.h>
|
|
|
|
#include <linux/acpi.h>
|
|
|
|
+#include <linux/kernel.h>
|
|
|
|
#include "pci.h"
|
|
|
|
#include "pcie/portdrv.h"
|
2020-06-30 14:24:22 +00:00
|
|
|
|
2020-08-13 17:44:32 +00:00
|
|
|
@@ -279,6 +280,34 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
|
2020-04-23 20:47:21 +00:00
|
|
|
return found_id;
|
|
|
|
}
|
2020-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
+/**
|
|
|
|
+ * 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
|
2020-08-13 17:44:32 +00:00
|
|
|
index 835530605c0d..1a5afb3b706f 100644
|
2020-04-23 20:47:21 +00:00
|
|
|
--- a/include/linux/pci.h
|
|
|
|
+++ b/include/linux/pci.h
|
2020-06-08 15:07:17 +00:00
|
|
|
@@ -1406,6 +1406,10 @@ int pci_add_dynid(struct pci_driver *drv,
|
2020-04-23 20:47:21 +00:00
|
|
|
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);
|
2020-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
--
|
2020-06-30 14:24:22 +00:00
|
|
|
2.26.2
|
2020-04-23 20:47:21 +00:00
|
|
|
|