Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3001907ybt; Mon, 29 Jun 2020 12:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybcxV3CTWgPIa+uK8Uwj7tBgg6qyFUUHwtoby7QHo2KftqEXj6cDyW6l0nsa8LVvdIvzVU X-Received: by 2002:a17:906:a84d:: with SMTP id dx13mr9790413ejb.246.1593459324349; Mon, 29 Jun 2020 12:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593459324; cv=none; d=google.com; s=arc-20160816; b=S9MhGrBG6obbn+usNth8CHRpueaKMAeDmkF23FAqyxR68axr9wTX6OLdqasBGHeDRU FyU9xM4Uo7ZZ/YkBeDOpw5uCFGgeaULhmriLrlBlIaHRbsZFn8DUEVLPhVA1XsAuEeYx YX9RB9bM8SE1xbCGNZFzolF3CrSXBMcOO8FHR24SGsAEb27k/GZ1nXMZJamMcVWZh2ru +sOAJ+Dv9ZnMoNxEFicy8rjKSZWrij95XkzthAO9QoRBZwmUNQTN06NpITTQMxu7g8yu K0H0ZJrACZS3UAN65hH7Exs+wZ1HuPcDGwU5/R/tGO+1kwrltbQY/35Ndv1yjLtfk2G3 Of5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kYfLUmUFbWpgnyHh4BXpAPCXj8O0zh9gKiayS8foZFk=; b=L/cVgqVccbjtGCmvdum9sJ+BCkaXRpMaceyJux0Eokw7q/tCfwQ34TuCpCX81Xdgmo aQYYGFmaAK8F/T9V3MM+3qlg1gUhWSm7ozXPPFN0+9x6fuL2qt6xW2I9OfAwTPQTR6VX y3Oeqwc629wIti5BBO72rwc6dtE6UZw04izhS3N+8D2GjF109f7uz1chVJXNadvies0n k8ShFo0Z9CZ93ehj3piRo2IbUERfH1ZI37MaSjlJK4eb9f665BHD9tCXaMdyTvjewbc3 ceK0hJgP7bakEEZA9Chp8MMYkoppFdiKnMhDMFwY8jiGUIy/2Md8rKGcPdUcyd4Eurvj NbGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si201551eds.283.2020.06.29.12.35.01; Mon, 29 Jun 2020 12:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733153AbgF2Ter (ORCPT + 99 others); Mon, 29 Jun 2020 15:34:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:36628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733146AbgF2Tb0 (ORCPT ); Mon, 29 Jun 2020 15:31:26 -0400 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 10D73AE78; Mon, 29 Jun 2020 16:19:00 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, robh@kernel.org, wahrenst@gmx.net, p.zabel@pengutronix.de, andy.shevchenko@gmail.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, helgaas@kernel.org, mathias.nyman@linux.intel.com, lorenzo.pieralisi@arm.com, Nicolas Saenz Julienne Subject: [PATCH v5 7/9] usb: host: pci-quirks: Bypass xHCI quirks for Raspberry Pi 4 Date: Mon, 29 Jun 2020 18:18:43 +0200 Message-Id: <20200629161845.6021-8-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629161845.6021-1-nsaenzjulienne@suse.de> References: <20200629161845.6021-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 358015328391..977d0b6d7577 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "pci-quirks.h" #include "xhci-ext-caps.h" @@ -1244,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 && -- 2.27.0