From patchwork Fri Oct 17 08:53:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 5096191 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8C7FB9F38C for ; Fri, 17 Oct 2014 09:17:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9504201F5 for ; Fri, 17 Oct 2014 09:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C65CB201ED for ; Fri, 17 Oct 2014 09:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbaJQJPF (ORCPT ); Fri, 17 Oct 2014 05:15:05 -0400 Received: from mail-by2on0104.outbound.protection.outlook.com ([207.46.100.104]:38197 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752550AbaJQJPA (ORCPT ); Fri, 17 Oct 2014 05:15:00 -0400 Received: from BN1PR02CA0044.namprd02.prod.outlook.com (10.141.56.44) by BN1PR02MB200.namprd02.prod.outlook.com (10.242.214.156) with Microsoft SMTP Server (TLS) id 15.0.1054.13; Fri, 17 Oct 2014 08:59:25 +0000 Received: from BN1BFFO11FD054.protection.gbl (2a01:111:f400:7c10::1:168) by BN1PR02CA0044.outlook.office365.com (2a01:111:e400:2a::44) with Microsoft SMTP Server (TLS) id 15.0.1054.13 via Frontend Transport; Fri, 17 Oct 2014 08:59:25 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BN1BFFO11FD054.mail.protection.outlook.com (10.58.145.9) with Microsoft SMTP Server id 15.0.1039.16 via Frontend Transport; Fri, 17 Oct 2014 08:59:25 +0000 X-WSS-ID: 0NDKZMY-07-HMT-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2482DCAE620; Fri, 17 Oct 2014 03:59:21 -0500 (CDT) Received: from SATLEXDAG01.amd.com (10.181.40.3) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 17 Oct 2014 03:59:26 -0500 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 17 Oct 2014 04:59:21 -0400 Received: from hr-ub.amd.com (10.237.75.143) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.195.1; Fri, 17 Oct 2014 16:59:20 +0800 From: Huang Rui To: Felipe Balbi , Alan Stern , Bjorn Helgaas , Greg Kroah-Hartman CC: Paul Zimmerman , Heikki Krogerus , Vincent Wan , Tony Li , , , , Huang Rui Subject: [PATCH v2 02/16] pci: quirks: add quirk to avoid AMD NL to bind with xhci Date: Fri, 17 Oct 2014 16:53:27 +0800 Message-ID: <1413536021-4886-3-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413536021-4886-1-git-send-email-ray.huang@amd.com> References: <1413536021-4886-1-git-send-email-ray.huang@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(189002)(199003)(68736004)(105586002)(575784001)(93916002)(229853001)(106466001)(36756003)(4396001)(77096002)(50226001)(87286001)(84676001)(89996001)(87936001)(95666004)(107046002)(102836001)(19580405001)(77156001)(92726001)(64706001)(88136002)(76482002)(2171001)(31966008)(85852003)(20776003)(47776003)(53416004)(15395725005)(15202345003)(19580395003)(104166001)(15975445006)(33646002)(48376002)(50466002)(46102003)(80022003)(120916001)(76176999)(50986999)(99396003)(44976005)(92566001)(62966002)(21056001)(97736003)(85306004)(86362001)(101416001)(6606295002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR02MB200; H:atltwp01.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB200; X-Exchange-Antispam-Report-Test: UriScan:; X-Forefront-PRVS: 0367A50BB1 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Ray.Huang@amd.com; X-OriginatorOrg: amd4.onmicrosoft.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dwc3 controller is the PCI-E device in AMD NL platform, but the class code of PCI header is 0x0c0330, the same with xHC. That's because it needs to meet the windows enviroment. The dwc3 controller acted as only host mode to bind with windows xhci driver. But on linux, sometimes, it would auto-bind with xhci driver as well (class code 0x0c0330) despite it uses Pid/Vid on dwc3 driver. Heikki suggested to use the quirk to fix this issue, and the detailed discussion is at below thread: http://marc.info/?l=linux-usb&m=141197934712824&w=2 Suggested-by: Heikki Krogerus Cc: Bjorn Helgaas Signed-off-by: Huang Rui --- drivers/pci/quirks.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 90acb32..3c911b7 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -378,6 +378,26 @@ static void quirk_ati_exploding_mce(struct pci_dev *dev) } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, quirk_ati_exploding_mce); +/* FIXME should define in */ +#define PCI_DEVICE_ID_AMD_NL 0x7912 + +/* + * AMD NL SoC 7912 PCI device is dwc3 controller, but the class code of PCI + * header is 0x0c0330, the same with xHC. That's because it need to meet the + * windows enviroment. The dwc3 controller acted as only host mode to bind with + * windows xhci driver. But on linux, sometimes, we auto-bind with xhci driver + * as well (class code 0x0c0330) despite we use Pid/Vid on dwc3 driver. So this + * quirk used a dummy class code to avoid to bind with xhci driver at booting + * phase. + */ +static void quirk_amd_nl_class(struct pci_dev *pdev) +{ + /* Use a dummy class value instead of PCI header provided */ + pdev->class = 0x0c03fe; +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL, + quirk_amd_nl_class); + /* * Let's make the southbridge information explicit instead * of having to worry about people probing the ACPI areas,