ACK: [PATCH] pci: maxreadreq: skip Intel video devices
Alex Hung
alex.hung at canonical.com
Mon Nov 30 20:46:07 UTC 2020
On Mon, Nov 30, 2020 at 12:04 PM Colin Ian King <colin.king at canonical.com>
wrote:
> On 30/11/2020 18:37, Alex Hung wrote:
> > Intel usually, if not always, makes this register read-only.
> >
> > Signed-off-by: Alex Hung <alex.hung at canonical.com>
> > ---
> > src/lib/include/fwts_pci.h | 2 ++
> > src/pci/maxreadreq/maxreadreq.c | 7 +++++++
> > 2 files changed, 9 insertions(+)
> >
> > diff --git a/src/lib/include/fwts_pci.h b/src/lib/include/fwts_pci.h
> > index 8aaa2b66..799c150a 100644
> > --- a/src/lib/include/fwts_pci.h
> > +++ b/src/lib/include/fwts_pci.h
> > @@ -151,6 +151,8 @@
> > #define FWTS_PCI_SUBCLASS_CODE_OTHER_SYSTEM_PERIPHERAL (0x80)
> > #define FWTS_PCI_SUBCLASS_CODE_AUDIO_DEVICE (0x03)
> >
> > +/* PCI Vendor IDs */
> > +#define FWTS_PCI_INTEL_VENDOR_ID (0x8086)
> >
> > /*
> > * PCI Express Capability Structure is defined in Section 7.8
> > diff --git a/src/pci/maxreadreq/maxreadreq.c
> b/src/pci/maxreadreq/maxreadreq.c
> > index a54a343f..9115c947 100644
> > --- a/src/pci/maxreadreq/maxreadreq.c
> > +++ b/src/pci/maxreadreq/maxreadreq.c
> > @@ -63,6 +63,7 @@ static int maxreadreq_test1(fwts_framework *fw)
> > int fd;
> > ssize_t n;
> > uint8_t offset = 0;
> > + uint16_t vendor_id;
> >
> > if (entry->d_name[0] == '.')
> > continue;
> > @@ -97,6 +98,12 @@ static int maxreadreq_test1(fwts_framework *fw)
> > (config[FWTS_PCI_CONFIG_SUBCLASS] ==
> FWTS_PCI_SUBCLASS_CODE_AUDIO_DEVICE))
> > continue;
> >
> > + /* Ignore Intel's Video Device */
> > + vendor_id = config[FWTS_PCI_CONFIG_VENDOR_ID] +
> ((config[FWTS_PCI_CONFIG_VENDOR_ID + 1]) << 8);
> > + if ((config[FWTS_PCI_CONFIG_CLASS_CODE] ==
> FWTS_PCI_CLASS_CODE_DISPLAY_CONTROLLER) &&
> > + (vendor_id == FWTS_PCI_INTEL_VENDOR_ID))
> > + continue;
> > +
> > /* config region too small, do next */
> > if (n < FWTS_PCI_CONFIG_TYPE0_CAPABILITIES_POINTER)
> > continue;
> >
>
> OK, I have a bad feeling this may be one of many more such workarounds :-)
>
I would guess so too.
Fortunately I just tried AMD & Nvidia's VGA and they don't have the same
problem. We will just need to watch out for other classes.
>
> Acked-by: Colin Ian King <colin.king at canonical.com>
>
--
Cheers,
Alex Hung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20201130/af2a76c1/attachment.html>
More information about the fwts-devel
mailing list