Thread (36 messages) 36 messages, 7 authors, 2023-07-03

Re: [PATCH v7 2/8] PCI/VGA: Deal only with VGA class devices

From: "Maciej W. Rozycki" <macro@orcam.me.uk>
Date: 2023-06-19 03:03:17
Also in: amd-gfx, dri-devel, intel-gfx, kvm, linux-pci, lkml, nouveau

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.
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help