From: Bjorn Helgaas Date: Fri, 19 Jun 2015 20:58:24 +0000 (-0500) Subject: PCI: Fix TI816X class code quirk X-Git-Tag: v3.2.72~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94bd776756d122719536033a7629b3afa52a284c;p=thirdparty%2Fkernel%2Fstable.git PCI: Fix TI816X class code quirk commit d1541dc977d376406f4584d8eb055488655c98ec upstream. In fixup_ti816x_class(), we assigned "class = PCI_CLASS_MULTIMEDIA_VIDEO". But PCI_CLASS_MULTIMEDIA_VIDEO is only the two-byte base class/sub-class and needs to be shifted to make space for the low-order interface byte. Shift PCI_CLASS_MULTIMEDIA_VIDEO to set the correct class code. Fixes: 63c4408074cb ("PCI: Add quirk for setting valid class for TI816X Endpoint") Signed-off-by: Bjorn Helgaas CC: Hemant Pedanekar [bwh: Backported to 3.2: the class check is done in this function as there is no DECLARE_PCI_FIXUP_CLASS_EARLY()] Signed-off-by: Ben Hutchings --- diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 481b184ee5e8a..0def0b1e5414a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2875,8 +2875,9 @@ static void __devinit fixup_ti816x_class(struct pci_dev* dev) { /* TI 816x devices do not have class code set when in PCIe boot mode */ if (dev->class == PCI_CLASS_NOT_DEFINED) { - dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n"); - dev->class = PCI_CLASS_MULTIMEDIA_VIDEO; + dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8; + dev_info(&dev->dev, "PCI class overridden (%#08x -> %#08x)\n", + PCI_CLASS_NOT_DEFINED, dev->class); } } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_TI, 0xb800, fixup_ti816x_class);