All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org
Cc: "Mathias Nyman" <mathias.nyman@intel.com>,
	x86@kernel.org, "Felipe Balbi" <balbi@ti.com>,
	"Yu Zhao" <yu.zhao@intel.com>, "Huang Rui" <ray.huang@amd.com>,
	"Krzysztof Hałasa" <khalasa@piap.pl>,
	"Matthew Wilcox" <willy@linux.intel.com>,
	"Jason Chang" <jason.chang@amd.com>
Subject: [PATCH v2 1/5] PCI: Use PCI_CLASS_SERIAL_USB instead of bare number
Date: Tue, 14 Jul 2015 14:34:36 -0500	[thread overview]
Message-ID: <20150714193436.13224.8558.stgit@bhelgaas-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <20150714193153.13224.40528.stgit@bhelgaas-glaptop2.roam.corp.google.com>

be6646bfbaec ("PCI: Prevent xHCI driver from claiming AMD Nolan USB3 DRD
device") added a quirk to override the PCI class code of the AMD Nolan
device.

Use PCI_CLASS_SERIAL_USB instead of a bare number to improve greppability.
Also add a log message about what we're doing.

No functional change except the new message.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Huang Rui <ray.huang@amd.com>
CC: Jason Chang <jason.chang@amd.com>
CC: Felipe Balbi <balbi@ti.com>
---
 drivers/pci/quirks.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 1b9fc4e..ecaad8f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -424,10 +424,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI,	PCI_DEVICE_ID_ATI_RS100,   quirk_ati_
  */
 static void quirk_amd_nl_class(struct pci_dev *pdev)
 {
-	/*
-	 * Use 'USB Device' (0x0c03fe) instead of PCI header provided
-	 */
-	pdev->class = 0x0c03fe;
+	u32 class = pdev->class;
+
+	/* Use "USB Device (not host controller)" class */
+	pdev->class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe;
+	dev_info(&pdev->dev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
+		 class, pdev->class);
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
 		quirk_amd_nl_class);


  reply	other threads:[~2015-07-14 19:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 19:34 [PATCH v2 0/5] PCI: Fix class code usage Bjorn Helgaas
2015-07-14 19:34 ` Bjorn Helgaas [this message]
2015-07-14 19:34 ` [PATCH v2 2/5] PCI: Fix generic NCR 53c810 class code quirk Bjorn Helgaas
2015-07-14 19:34 ` [PATCH v2 3/5] PCI: Fix TI816X " Bjorn Helgaas
2015-07-14 19:35 ` [PATCH v2 4/5] PCI: Revert aeb30016fec3 ("PCI: add Intel USB specific reset method") Bjorn Helgaas
2015-07-14 19:35 ` [PATCH v2 5/5] PCI: Shift PCI_CLASS_NOT_DEFINED consistently with other classes Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150714193436.13224.8558.stgit@bhelgaas-glaptop2.roam.corp.google.com \
    --to=bhelgaas@google.com \
    --cc=balbi@ti.com \
    --cc=jason.chang@amd.com \
    --cc=khalasa@piap.pl \
    --cc=linux-pci@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=ray.huang@amd.com \
    --cc=willy@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=yu.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.