From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] PCI: populate struct pci_device subsystem_device, subsystem_vendor
Date: Wed, 23 Aug 2023 07:52:58 +0200 [thread overview]
Message-ID: <20230823055258.GC16522@pengutronix.de> (raw)
In-Reply-To: <20230822074832.3905525-1-a.fatoum@pengutronix.de>
On Tue, Aug 22, 2023 at 09:48:31AM +0200, Ahmad Fatoum wrote:
> 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(+)
Applied, thanks
Sascha
>
> 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
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2023-08-23 5:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Sascha Hauer [this message]
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=20230823055258.GC16522@pengutronix.de \
--to=sha@pengutronix.de \
--cc=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