Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5650145ima; Tue, 5 Feb 2019 15:55:52 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib+tw9mM7REch6lMp79XdON9sfdFhcz6mP3jsS4dTOSaT9CWTWbKWyHU9VZuSt17nixQSqU X-Received: by 2002:aa7:8555:: with SMTP id y21mr118620pfn.103.1549410952345; Tue, 05 Feb 2019 15:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549410952; cv=none; d=google.com; s=arc-20160816; b=vpWKgbC+ZaeWG9Zad0bLUXxEUneLXgYtCwaR0B68UJn8LR0TQ7+hcR/a2M+caiJq2o Fx7IVUL93rSkAvVor3x/G3rBJGdKAl6i4TxLpy8VjDSISRjl/a0iV2r/FRBgikFwM3im 98nM5p+AOWohJireaWd1224RzKx5aVop7vseFZNorGDs3jswZuchEoN6tuhHSYpJVhY8 pD/qN9Ve/N1WUZnYFfq5GWKh0ACzOKAhEIpSnIcWJ8T/rvDMLDap+5YVwtkiJi6F/FBV Db0U+JxXhO2LXYSirQVDb4jnv0GtZWa+h2H+JdbT77iC7ZS6pmbi0soHiKdqWLHJF6rV xtGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lc6vb0JUR5hRa0CNLnowgspUgB9Q4YYGwZuPurtcQPM=; b=iC0X/4SA1X2byiZA39llzrCoucD51z6MED3VuydXIqoH56ipfEVAIMpLOLoIwh/nZQ gSMUPC4dXtA+nEvSBAqkbtkN9SgUAUtmHQDToPTSgnJlge7VxU3XYPqTtbU9apjHxKa6 n9FPtKUxD4gw+dZYnV+uarSVm43cHwF7+y7Sqt0fxRG8uAtLnHS46huCqNZQo8qOWbCs tUGzsg2sBR29h2ILSPNEkTwk6C3LMQA2Oz0FQTY2qht3/dbk85Ffj2dc3liVlsITrYA8 Jo4dD1NRKZryKVlIWipqOQqh80Nsq6acC5qiV/VA4stGPz3GI/XBzGvR2Ew+y90TiY05 ZFmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PXBH7U9+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p32si4299164pgm.413.2019.02.05.15.55.35; Tue, 05 Feb 2019 15:55:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PXBH7U9+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726722AbfBEXcD (ORCPT + 99 others); Tue, 5 Feb 2019 18:32:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:44106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725967AbfBEXcC (ORCPT ); Tue, 5 Feb 2019 18:32:02 -0500 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98FDF2175B; Tue, 5 Feb 2019 23:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549409521; bh=Z8Hgo9sluoGqY5nBn5CIcBhL8pveCFzcBJwLbc4VLtA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PXBH7U9++RTP1IDOi1ZiR0EFGHSl20LZE4Wfqp3UIUPKmuvFhX1+zlgRgkdTx6CmW xOi29scrbcPzh5YO8/a0+NZLsm38Qfa8gcESE1GaWFnlnXnPht0PlrtdBbFfFO9e2J gRes7bwuJlTlJ2CMlQIMM+xWczuaz3CTtRc97rvE= Date: Tue, 5 Feb 2019 17:31:59 -0600 From: Bjorn Helgaas To: Thinh Nguyen Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, "Lukas F. Hartmann" , Trent Piepho , John Youn , Richard Zhu , Lucas Stach Subject: Re: [PATCH RESEND] PCI: Check for USB xHCI class for HAPS platform Message-ID: <20190205233159.GC7268@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Richard, Lucas] On Tue, Feb 05, 2019 at 01:04:28PM -0800, Thinh Nguyen wrote: > The Synopsys HAPS USB controller has a VID PID (16c3,abcd) that matches > to an existing PCIe controller. This quirk is intended for USB HAPS > devices only. To fix this, check for the PCI class USB xHCI to prevent > matching the PCIe controllers. So there are at least three different parts with the same Vendor & Device ID ([16c3:abcd]): 1) Synopsys HAPS USB3 controller 2) Synopsys PCIe IP in the NXP i.MX6QP (reported by Lukas) 3) Synopsys PCIe IP in the NXP i.MX7D (reported by Trent) I don't know if Synopsys is to blame for 2 & 3, or if NXP was expected to change the Vendor ID when incorporating the Synopsys IP into the i.MX designs. But even leaving the default Device ID of the PCIe IP the same as another Synopsys device was probably a bad idea. dwc3-haps claims by Vendor & Device ID; it doesn't look at the Class Code. What happens when it tries to claim the PCIe IP in i.MX? lspci also doesn't look at the Class Code when it looks up the text name of devices, so it will print the same name for both. Of course, the Linux PCI ID database at https://pci-ids.ucw.cz/read/PC/16c3 shows basically no information for the 0x16c3 Vendor ID, so it won't print anything useful no matter what. You could add some things there :) > Fixes: 03e6742584af ("PCI: Override Synopsys USB 3.x HAPS device class") > Signed-off-by: Thinh Nguyen > --- > drivers/pci/quirks.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index b0a413f3f7ca..e2a879e93d86 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -639,8 +639,9 @@ static void quirk_synopsys_haps(struct pci_dev *pdev) > break; > } > } > -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID, > - quirk_synopsys_haps); > +DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID, > + PCI_CLASS_SERIAL_USB_XHCI, 0, > + quirk_synopsys_haps); > > /* > * Let's make the southbridge information explicit instead of having to > -- > 2.11.0 >