kernel/0001-add-pci_hw_vendor_stat...

97 lines
3.0 KiB
Diff
Raw Normal View History

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 da6510af1221..2ec02cbfda72 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
kernel-5.8.0-0.rc0.20200610git84fc461db99b.1 * Wed Jun 10 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.8.0-0.rc0.20200610git84fc461db99b.1] - 84fc461db99b rebase - Fix PATCHLEVEL for merge window ("Justin M. Forbes") - PCI: tegra: Revert raw_violation_fixup for tegra124 (Nicolas Chauvet) - Change ark CONFIG_COMMON_CLK to yes, it is selected already by other options ("Justin M. Forbes") - More module filtering for Fedora ("Justin M. Forbes") - Update filters for rnbd in Fedora ("Justin M. Forbes") - Fix up module filtering for 5.8 ("Justin M. Forbes") - More Fedora config work ("Justin M. Forbes") - RTW88BE and CE have been extracted to their own modules ("Justin M. Forbes") - Set CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK for Fedora ("Justin M. Forbes") - Arm64 Use Branch Target Identification for kernel ("Justin M. Forbes") - Fedora config updates ("Justin M. Forbes") - Change value of CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE ("Justin M. Forbes") - Fix configs for Fedora ("Justin M. Forbes") - Fix update_scripts.sh unselective pattern sub (David Howells) - Updated changelog for the release based on b0c3ba31be3e ("CKI@GitLab") - Drop the static path configuration for the Sphinx docs (Jeremy Cline) - Sign off generated configuration patches (Jeremy Cline) - Use __make macro instead of make (Tom Stellard) - redhat/configs: Enable CONFIG_SMC91X and disable CONFIG_SMC911X (Prarit Bhargava) [http://bugzilla.redhat.com/1722136] Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-06-10 22:01:45 +00:00
index c79d83304e52..695efeea48f0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1406,6 +1406,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.25.4