Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp544635ybv; Wed, 19 Feb 2020 04:40:59 -0800 (PST) X-Google-Smtp-Source: APXvYqy2G5NTkjBgumgJMHJH5dJK7rLJpa6PSF48THei7gUUTr/h6wisoU/lrVVTPX/m96aQwLuf X-Received: by 2002:aca:c507:: with SMTP id v7mr4514606oif.157.1582116059547; Wed, 19 Feb 2020 04:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582116059; cv=none; d=google.com; s=arc-20160816; b=Fv07Erd6vK7Rz8LA84P4aFTJtfBbid/bRjQagsn1dVijrt3O3TSDD7w6CVXYtaV5Zm iLMlfyZw+xTKoKdjJAUF1DQwUTAj/fXoSGZSxssw05mxle8RVgMTAeznJdo+wS8jJX0/ v4sJcfuZL7WRkkQbggADbcPiyE8sRlx+Hz6z7YgW/LZdA5aptDmNIFonCx+GWdYArFaX UWms692o4p1oqIk5FJd3hN605Ac4mNe6Hk8UotZ/f97EVxKwmCMsF5Mps9TnsJd7R0zV a3R7xh5rL01OXIfo5CO1lgGV4kFq4yCbG4vBIiZtGhuxFTTOl8bS7CZlb1W8WskFhwCT /wnQ== 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=Dw2/Rj/k6usj+TjZdt8mY5X6VPPw3J1tU0EE4WyUSsM=; b=QAK9Fb7QDWsIoXy9g4AdKBmmh9SjUTD22MDZy7HJgI2NTOlyE8q17GmzT8sy8CKAFN CqA6q6Hvr6+k5LdGg1e2IG6tDYEDs0WlNpoiRO5RrDDzp36AylMXkbZlZptWGRbYwwV1 gFZbp8kIIQ0XSXVuJDyUg80WE5UMihscec1Wbq+6xuUYmkYk92oRkBau4I0anAxpe9Zd 9LtNuWwQS24EDOliUTX2MLj61YAqSd60gQNgpT2KbGwJOKPflOmcv3+/QjLBegkNyxur pg4vAy1RUFP4vuXtkOiQzhu2M0wnHTz+iSNpmJTF9SyOzDptKwcXBqKyrnIyIXe6mDDv tklQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u63si1650900oif.88.2020.02.19.04.40.47; Wed, 19 Feb 2020 04:40:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727762AbgBSMj6 (ORCPT + 99 others); Wed, 19 Feb 2020 07:39:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:52870 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgBSMjq (ORCPT ); Wed, 19 Feb 2020 07:39:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 69A2CB9C6; Wed, 19 Feb 2020 12:39:44 +0000 (UTC) From: Nicolas Saenz Julienne To: linux-kernel@vger.kernel.org, Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne , Lorenzo Pieralisi , Andrew Murray Cc: linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, wahrenst@gmx.net, Bjorn Helgaas Subject: [PATCH v2 3/4] PCI: brcmstb: Wait for Raspberry Pi's firmware when present Date: Wed, 19 Feb 2020 13:39:32 +0100 Message-Id: <20200219123933.2792-4-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200219123933.2792-1-nsaenzjulienne@suse.de> References: <20200219123933.2792-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 xHCI's PCI fixup, run at the end of pcie-brcmstb's probe, depends on RPi4's VideoCore firmware interface to be up and running. It's possible for both initializations to race, so make sure it's available prior starting. Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/controller/pcie-brcmstb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index d20aabc26273..9600052f768c 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -28,6 +28,8 @@ #include #include +#include + #include "../pci.h" /* BRCM_PCIE_CAP_REGS - Offset for the mandatory capability config regs */ @@ -917,11 +919,24 @@ static int brcm_pcie_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node, *msi_np; struct pci_host_bridge *bridge; + struct device_node *fw_np; struct brcm_pcie *pcie; struct pci_bus *child; struct resource *res; int ret; + /* + * We have to wait for the Raspberry Pi's firmware interface to be up + * as some PCI fixups depend on it. + */ + fw_np = of_find_compatible_node(NULL, NULL, + "raspberrypi,bcm2835-firmware"); + if (fw_np && !rpi_firmware_get(fw_np)) { + of_node_put(fw_np); + return -EPROBE_DEFER; + } + of_node_put(fw_np); + bridge = devm_pci_alloc_host_bridge(&pdev->dev, sizeof(*pcie)); if (!bridge) return -ENOMEM; -- 2.25.0