[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2306190339590.14084@angie.orcam.me.uk>
Date: Mon, 19 Jun 2023 04:02:48 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: Sui Jingfeng <15330273260@....cn>
cc: Bjorn Helgaas <bhelgaas@...gle.com>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
intel-gfx@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
linux-pci@...r.kernel.org, kvm@...r.kernel.org,
linux-fbdev@...r.kernel.org, Sui Jingfeng <suijingfeng@...ngson.cn>
Subject: Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices
On Tue, 13 Jun 2023, Sui Jingfeng wrote:
> Deal only with the VGA devcie(pdev->class == 0x0300), so replace the
Typo here: s/devcie/device/.
> pci_get_subsys() function with pci_get_class(). Filter the non-PCI display
> device(pdev->class != 0x0300) out. There no need to process the non-display
> PCI device.
I've only come across this patch series now. Without diving into what
this code actually does I have just one question as a matter of interest.
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index c1bc6c983932..22a505e877dc 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -1500,7 +1496,9 @@ static int pci_notify(struct notifier_block *nb, unsigned long action,
> struct pci_dev *pdev = to_pci_dev(dev);
> bool notify = false;
>
> - vgaarb_dbg(dev, "%s\n", __func__);
> + /* Only deal with VGA class devices */
> + if (pdev->class != PCI_CLASS_DISPLAY_VGA << 8)
> + return 0;
Hmm, shouldn't this also handle PCI_CLASS_NOT_DEFINED_VGA? As far as I
know it is the equivalent of PCI_CLASS_DISPLAY_VGA for PCI <= 2.0 devices
that were implemented before the idea of PCI device classes has developed
into its current form. I may have such a VGA device somewhere.
Maciej
Powered by blists - more mailing lists