From patchwork Wed Feb 6 18:49:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10799937 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 CA66013B4 for ; Wed, 6 Feb 2019 18:55:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B899625EA6 for ; Wed, 6 Feb 2019 18:55:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB47A2C636; Wed, 6 Feb 2019 18:55:04 +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=ham 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 346B425EA6 for ; Wed, 6 Feb 2019 18:55:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbfBFSzC (ORCPT ); Wed, 6 Feb 2019 13:55:02 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:60944 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbfBFSt2 (ORCPT ); Wed, 6 Feb 2019 13:49:28 -0500 Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 0428724E06AE; Wed, 6 Feb 2019 10:49:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1549478968; bh=saCM6HKGn9NfOi/g1htvfkD+uS4hCblAh5o4s4xNAo4=; h=Date:From:Subject:To:CC:From; b=XcZT2olESpZcs1/m05vv8ae36yKy/58tV3do6+fcRGXGu5ZAtjB8JCJ9ggWiSLrSZ LiALqYPNfTt7YpSMgpp+c90qfyxvhqADWPGNMUwVc/UQPOEi3BeehRYbp/NRrKJYm9 b7dKqeRNNsGkqGLjkQv6qdTk4rxD+prBi+K+6OYt2+wYv+9PDdhl285dHeH7+WYsDt h8G23/ux6IK5C2Iy4qJkjylnx8dWK+Bi6/ruLd7XQ0szx9gOK3nm3RdQZE9iLm7za4 sB4g3hvHkhLQSpqJWh+qcZBmtM3YXG/rv7ddQW0PP5Pyimh3jWmx/FctfH4q/VFxcO Tc8KnjsOor23A== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id E55CEA005A; Wed, 6 Feb 2019 18:49:27 +0000 (UTC) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 6 Feb 2019 10:49:27 -0800 Received: from te-lab16 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 6 Feb 2019 10:49:26 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 06 Feb 2019 10:49:26 -0800 Date: Wed, 6 Feb 2019 10:49:26 -0800 Message-ID: <49d5ec1bcbfaef665ed166e7225ffa3b96133e1d.1549477664.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH] usb: dwc3: haps: Workaround matching VID PID To: Felipe Balbi , CC: John Youn , Thinh Nguyen , Bjorn Helgaas 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 i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and PID as this USB controller. The system may incorrectly match this driver to that PCIe controller. To workaround this, specifically use class type USB with PCI device ID to prevent incorrect driver matching. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-haps.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c index 02d57d98ef9b..3cecbf169452 100644 --- a/drivers/usb/dwc3/dwc3-haps.c +++ b/drivers/usb/dwc3/dwc3-haps.c @@ -106,6 +106,15 @@ static const struct pci_device_id dwc3_haps_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3), + /* + * i.MX6QP and i.MX7D platform use a PCIe controller with the + * same VID and PID as this USB controller. The system may + * incorrectly match this driver to that PCIe controller. To + * workaround this, specifically use class type USB to prevent + * incorrect driver matching. + */ + .class = (PCI_CLASS_SERIAL_USB << 8), + .class_mask = 0xffff00, }, { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,