Re: [-next 1/5] PCI: Add the pci_is_vga() helper

From: Maciej W. Rozycki
Date: Fri Oct 06 2023 - 08:10:53 EST


On Fri, 6 Oct 2023, Sui Jingfeng wrote:

> > I think this makes sense per the spec, but there's always a risk of
> > breaking something, so it's nice if the change actually *fixes*
> > something to make that risk worthwhile.
>
>
> Maciej mentioned that PCI_CLASS_NOT_DEFINED_VGA device should also be handled
> in the past.
> see [1]. But if no one interested in PCI_CLASS_NOT_DEFINED_VGA nowaday, then I
> guess
> the gains of this patch may not deserve the time and risk. But I don't mind if
> someone
> would like pick it up for other purpose.

Well, if we need to determine for whatever purpose whether a PCI/e device
presents a VGA programming interface, then I think we ought to do this in
a complete manner. I'm not sure offhand what could possibly break if we
write our code according to specs and include PCI_CLASS_NOT_DEFINED_VGA
devices in the class.

Yes, I'm aware they won't be the latest and greatest, but they may still
be there out there in service. For one I continue using my 30 years old
Trident 8900C ISA VGA adapter with the most recent Linux kernel. The card
serves its purpose, mostly as a glass TTY, so why should I replace it?

Of course there are broken devices out there regardless, which won't work
as we expect without special handling or sometimes at all even. It does
not mean we should refrain from making the best effort for good compliant
devices and assume in advance that something will break even if we write
our code according to the relevant specs. I'd say do write according to
specs and only try to sort out the situation somehow if something actually
does break.

In any case if we actually do choose to ignore PCI_CLASS_NOT_DEFINED_VGA
devices, then I wanted to make sure we do it deliberately rather than from
the lack of awareness of the existence of such devices.

Maciej