From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] PCI: populate struct pci_device subsystem_device, subsystem_vendor
Date: Tue, 22 Aug 2023 09:48:31 +0200 [thread overview]
Message-ID: <20230822074832.3905525-1-a.fatoum@pengutronix.de> (raw)
pci_device::subsystem_device and pci_device::subsystem_vendor have been
there since the beginning, but they were never populated. This went
unnoticed so far, because they are compared against PCI_ANY_ID
everywhere, except for some NS16550-over-PCI quirks.
We should either drop the members or populate them unconditionally.
Let's do as Linux does and populate them for devices[1].
[1]: https://elixir.bootlin.com/linux/v6.5-rc7/source/drivers/pci/probe.c#L1915
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/pci/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d1b7549d7100..638af9722efc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -434,6 +434,9 @@ static unsigned int pci_scan_bus(struct pci_bus *bus)
goto bad;
setup_device(dev, 6);
+
+ pci_read_config_word(dev, PCI_SUBSYSTEM_ID, &dev->subsystem_device);
+ pci_read_config_word(dev, PCI_SUBSYSTEM_VENDOR_ID, &dev->subsystem_vendor);
break;
case PCI_HEADER_TYPE_BRIDGE:
child_bus = pci_alloc_bus();
--
2.39.2
next reply other threads:[~2023-08-22 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 7:48 Ahmad Fatoum [this message]
2023-08-22 7:48 ` [PATCH 2/2] virtio: pci: add support for transitional devices Ahmad Fatoum
2023-08-23 5:52 ` [PATCH 1/2] PCI: populate struct pci_device subsystem_device, subsystem_vendor Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230822074832.3905525-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox