From patchwork Mon Jun 22 10:38:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11617937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72A0313A0 for ; Mon, 22 Jun 2020 14:28:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BFCC2075A for ; Mon, 22 Jun 2020 14:28:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JQ+DXNaF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="a1Lr510M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BFCC2075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ro+OAjswc/66d8xkDGfPdqHfuTCOgbTlSAhxd+xLQfA=; b=JQ+DXNaFCId2pmHNusemAPiY/ WpcV/CgLQiTHnh/Jyv+IN0g9LxA+bkXPLnIL25KDuEUztCtYfCouiVzCf89nzO9qEFUjSzrAiF5yy 5cSThTdBmBt7AHADogVR3gzYz+4Bk4A1aOtwH93gztPESbyutDXYqqO/J2I5b+mIJvBwf5/OkrVhG q+VwUbYkCL1VZbFQYoTnWeWgE1+v8/5oa6Le1LXisZoOEKZeo7jl5CVqESCHfiXXkHB1e1FCf21Ux cOHiJE9rXNVOb/x8W3CrqmVzsuxnsH9mjly+KPrQUpbsTayp4ctVX0CyyP+eXeuzgL8q2gXNVkwOu RW/5/4SvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnNP1-0002zW-3J; Mon, 22 Jun 2020 14:26:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnNOz-0002zB-Lp; Mon, 22 Jun 2020 14:26:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jZLhDSs/EhCtnDfC0/o90M9/FS+9kQTh7eZFkq/NhXk=; b=a1Lr510MxXSM+hmKA572RfsHKm B/0UvVzTxrUKljF7mbd62N7D1IKwrgxxmKz/YSPIS7pnIFbmetDcTBcmH6ILEtJFfHBDvpdeueaT6 czM/ofJ/UGqbNRNEfj1vc+ajlCBihymY+Y34wOffz+QBwMBp5VR3ViQ287kzgRt/WwZyDGTDqMkcz poXKyBo2vsEzh95efdC3JS9al/WYapVgLwsyUtN7S42Z32XgLf/cxoc4ygEBLhxbGV/e6Sh8IiGfv 4eVT/uoxGLOe1l2QXjwuzI5a2yrHqloaypS1RUyPVzgDVZ157FXWKr1mDNglhS1Rz8NBlkul940fi gFwy/yeg==; Received: from mx2.suse.de ([195.135.220.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnNOu-0008Hd-U7; Mon, 22 Jun 2020 14:26:24 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 259D9C1C1; Mon, 22 Jun 2020 14:26:13 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, robh@kernel.org, wahrenst@gmx.net, p.zabel@pengutronix.de Subject: [PATCH v4 7/9] usb: host: pci-quirks: Bypass xHCI quirks for Raspberry Pi 4 Date: Mon, 22 Jun 2020 12:38:16 +0200 Message-Id: <20200622103817.476-8-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622103817.476-1-nsaenzjulienne@suse.de> References: <20200622103817.476-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_152621_278540_39C758E1 X-CRM114-Status: GOOD ( 11.26 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.6 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tim.gover@raspberrypi.org, mathias.nyman@linux.intel.com, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , andy.shevchenko@gmail.com, lorenzo.pieralisi@arm.com, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, helgaas@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The board doesn't need the quirks to be run, and takes care of its own initialization through a reset controller device. So let's bypass them. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Florian Fainelli --- Changes since v2: - Correct reference counting on parent device node Changes since v1: - Correct typos drivers/usb/host/pci-quirks.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 92150ecdb036..977d0b6d7577 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -16,6 +16,8 @@ #include #include #include +#include + #include "pci-quirks.h" #include "xhci-ext-caps.h" @@ -1243,11 +1245,27 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev) static void quirk_usb_early_handoff(struct pci_dev *pdev) { + struct device_node *parent; + bool is_rpi; + /* Skip Netlogic mips SoC's internal PCI USB controller. * This device does not need/support EHCI/OHCI handoff */ if (pdev->vendor == 0x184e) /* vendor Netlogic */ return; + + /* + * Bypass the Raspberry Pi 4 controller xHCI controller, things are + * taken care of by the board's co-processor. + */ + if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { + parent = of_get_parent(pdev->bus->dev.of_node); + is_rpi = of_device_is_compatible(parent, "brcm,bcm2711-pcie"); + of_node_put(parent); + if (is_rpi) + return; + } + if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI && pdev->class != PCI_CLASS_SERIAL_USB_OHCI && pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&