mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: populate struct pci_device subsystem_device, subsystem_vendor
@ 2023-08-22  7:48 Ahmad Fatoum
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-08-22  7:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-23  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22  7:48 [PATCH 1/2] PCI: populate struct pci_device subsystem_device, subsystem_vendor Ahmad Fatoum
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox