From patchwork Mon Dec 10 22:07:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10722603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F4E96C5 for ; Mon, 10 Dec 2018 22:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2075D2853E for ; Mon, 10 Dec 2018 22:08:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 141B429AF3; Mon, 10 Dec 2018 22:08:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BECE42853E for ; Mon, 10 Dec 2018 22:07:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728375AbeLJWH5 (ORCPT ); Mon, 10 Dec 2018 17:07:57 -0500 Received: from smtprelay2.synopsys.com ([198.182.60.111]:37450 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727405AbeLJWH4 (ORCPT ); Mon, 10 Dec 2018 17:07:56 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 534E710C0DAB; Mon, 10 Dec 2018 14:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1544479676; bh=guDOEPbWIUj/mVlWhuR4e7Pw6PEF44vrZfTUxzPhAOo=; h=Date:From:Subject:To:CC:From; b=WtwsE6Qmp9xHj56yJu4n2ulw6l0CLmpLG7NsCH07gKB2BYs72kMCFzPn/FrMrPQgu lb3gGXBEUt05EKAORl+4WnmnuW6f5Zp//bqqehepgU9X+7iiTq4Tq8yNBN3nAMz5Uz 47aPH6KxR9YDuaH5LmLoXJdmnOQHUvIZuAKSJJHu8/LPtriNJcrHWWWu63aIWpgknE HQJ2cVg06Wi6oOgcAxe4knyig0ErVRdFu5kridc0tKlQ2jmBuM+JHuByvkAE6LV+tv dZpdcYEQvOBsJQMFliBfWNa1hmzFnlDBcqbUHkDd9DPSkS70L0xmqFlOUkC6bdQU7/ 2HoFAhqdBmwHQ== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 255B33D6B; Mon, 10 Dec 2018 14:07:56 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (10.12.239.237) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 14:07:55 -0800 Received: from te-lab16 (10.13.184.20) by US01WEHTC2.internal.synopsys.com (10.12.239.238) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 14:07:54 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Mon, 10 Dec 2018 14:07:54 -0800 Date: Mon, 10 Dec 2018 14:07:54 -0800 Message-ID: <3aa06c4e54bf98a59e510d7a833934fce4b0083b.1544478969.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH v2 1/2] PCI: Move Synopsys HAPS platform device IDs To: Felipe Balbi , Greg Kroah-Hartman , , , Bjorn Helgaas CC: John Youn MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move Synopsys HAPS platform device IDs to pci_ids.h so that both drivers/pci/quirks.c and dwc3-haps driver can reference these IDs. Signed-off-by: Thinh Nguyen Acked-by: Felipe Balbi --- Change in v2: - Revise title to fit PCI patches' convention - Revise commit message to include the change purpose drivers/usb/dwc3/dwc3-haps.c | 4 ---- include/linux/pci_ids.h | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c index c9cc33881bef..02d57d98ef9b 100644 --- a/drivers/usb/dwc3/dwc3-haps.c +++ b/drivers/usb/dwc3/dwc3-haps.c @@ -15,10 +15,6 @@ #include #include -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI 0xabce -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31 0xabcf - /** * struct dwc3_haps - Driver private structure * @dwc3: child dwc3 platform_device diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 69f0abe1ba1a..25db0c1586ea 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2358,6 +2358,9 @@ #define PCI_DEVICE_ID_CENATEK_IDE 0x0001 #define PCI_VENDOR_ID_SYNOPSYS 0x16c3 +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI 0xabce +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31 0xabcf #define PCI_VENDOR_ID_VITESSE 0x1725 #define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174 From patchwork Mon Dec 10 22:08:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10722607 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FDB26C5 for ; Mon, 10 Dec 2018 22:08:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 518F22853E for ; Mon, 10 Dec 2018 22:08:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45DA629AF3; Mon, 10 Dec 2018 22:08:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF362853E for ; Mon, 10 Dec 2018 22:08:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbeLJWIF (ORCPT ); Mon, 10 Dec 2018 17:08:05 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:40160 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727405AbeLJWIF (ORCPT ); Mon, 10 Dec 2018 17:08:05 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id BE0C424E00CA; Mon, 10 Dec 2018 14:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1544479684; bh=cXIKGvlQhfQVAE+Ow9Yinuk2QOC8OnJ7yl7c95eFIpA=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=i4SAyggzgYiPWb9Fi87L6fxpI5+yCrOf7Kf770z6ahQrkd7KI5l/JxEtUNb0LVxYr ubdIqbB8uHpprprAaEuw4/6uFAYX+Hsczfrp+Y6Ix3Tajf2A5iP9/caWkYpFTcYWpC 2wMBmx+2fq22wm+sASz44VP9OS4qxOE1o0hOUNdwTRNAX/nAgDR/1CZK4EmMgLNGlN T3sX0wnXTnGWtNtQK/UYOJrY8qE1Nfk5khjqynooultBX0idp8+/pzVNIKzL2AVBaN RfNLdHWmAEn2Zz1G3NBEvK2v5zHVzivTm1FHHTEO7VwT27Kn/gNX0DL9Y0ubz3G4r1 xudUwyVmokHnw== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id A2DED545D; Mon, 10 Dec 2018 14:08:04 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (10.12.239.237) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 14:08:04 -0800 Received: from te-lab16 (10.13.184.20) by US01WEHTC2.internal.synopsys.com (10.12.239.238) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 14:08:01 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Mon, 10 Dec 2018 14:08:01 -0800 Date: Mon, 10 Dec 2018 14:08:01 -0800 Message-ID: <8994fd7d7ee2bf5c1b32ce5bca25be4beb4405b5.1544478969.git.thinhn@synopsys.com> In-Reply-To: <3aa06c4e54bf98a59e510d7a833934fce4b0083b.1544478969.git.thinhn@synopsys.com> References: <3aa06c4e54bf98a59e510d7a833934fce4b0083b.1544478969.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH v2 2/2] PCI: Override Synopsys USB 3.x HAPS device class To: , Bjorn Helgaas , CC: John Youn MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Synopsys USB 3.x host HAPS platform has a class code of PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these devices should use dwc3-haps driver. Change these devices' class code to PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming them. Signed-off-by: Thinh Nguyen --- Change in v2: - Revise title to fit PCI patches' convention - Override pci class instead of driver drivers/pci/quirks.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 4700d24e5d55..c84f81c42a1f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -618,6 +618,32 @@ static void quirk_amd_nl_class(struct pci_dev *pdev) DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB, quirk_amd_nl_class); +/* + * Synopsys USB 3.x host HAPS platform has a class code of + * PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these + * devices should use dwc3-haps driver. Change these devices' class code to + * PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming + * them. + */ +static void quirk_synopsys_haps(struct pci_dev *pdev) +{ + u32 class = pdev->class; + + switch (pdev->device) { + case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3: + case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI: + case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31: + pdev->class = PCI_CLASS_SERIAL_USB_DEVICE; + pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n", + class, pdev->class); + break; + default: + return; + } +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID, + quirk_synopsys_haps); + /* * Let's make the southbridge information explicit instead of having to * worry about people probing the ACPI areas, for example.. (Yes, it