Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1436472pxk; Mon, 31 Aug 2020 20:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVue9yhzgNEFsfjOeVtFydi/S3eBjBJpitXqqDPMQTRuZZGrE5oEl40x7RLkOxLD6B9MUc X-Received: by 2002:a17:906:fa01:: with SMTP id lo1mr3910254ejb.394.1598932115165; Mon, 31 Aug 2020 20:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598932115; cv=none; d=google.com; s=arc-20160816; b=DP1qchmHTtCZcUYGknRQfLfOE8mrzMQPhsYe/vRpvP8dFfA+Z1zBtks6o4lv5KiVGH OurFGm5SJEe4Npve24lslmK6M3BMPb6H/Y+tAEQZzP1CQh7WKWofiIms+GEa3xOGBuyx WMl/h0QU0XMKSL3RgMy+bKVetM8Lo+64BzYZ+L1d28sNJeibc8tCpJ5D1NylJlqqAy5X LcgiE+GsbZ6Za4nCNjTI8IlTwCdBeJ/P/GjhEiUeoG88EiAGUMZtDCtTrgL346E7an44 V3msARZKLy+A/KfsbwvaF1jaoxKuY1s8y3Xv9HKrRpxFcdqsCEylqLpMceO5yQcxT0F+ jk6g== 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:subject:cc:to:from:date :dkim-signature; bh=Sb15qLWva7b5eccs+rAtHW207dq5g5GxXtdLjsQxg3E=; b=PCrv0kUkyLaPF5D5iOXpvGX14WTcF6bKGr5mX9FZ+FRjNz+uzSBtEP6d8wVrSclXlG KrtGMS4g9kOOlwXaVAG5BhLyUU+VSwPuBOs28qq8HJ5mrF1EVu0vVfA9p6s6OwLptcO+ pPIwYLiyeAsTtkEepA/TEzz7DZH3gQHfcBFkqml8C0pDGaw6rEwXV9CZeNBKL4MUbufg yt3u0lCRhnxIy6lt4TdFj6UrHsDZ+x1vLM0uRgCEsFCMp/r38c+1yPKjI1d9V2q0X0vS eqgL9Ad/mCy0h8aclsYrZGAGKI+fckiGBncSZASVAfuNs4FrM1Mr6WkJ9q+LUcmnEF/C 5TmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dionne-riel-com.20150623.gappssmtp.com header.s=20150623 header.b=p+DLtz7W; 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 c27si6101318edx.64.2020.08.31.20.48.11; Mon, 31 Aug 2020 20:48:35 -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; dkim=pass header.i=@dionne-riel-com.20150623.gappssmtp.com header.s=20150623 header.b=p+DLtz7W; 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 S1726107AbgIADpt (ORCPT + 99 others); Mon, 31 Aug 2020 23:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgIADps (ORCPT ); Mon, 31 Aug 2020 23:45:48 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3733C0612FE for ; Mon, 31 Aug 2020 20:45:46 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id 92so6448790qtb.6 for ; Mon, 31 Aug 2020 20:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dionne-riel-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sb15qLWva7b5eccs+rAtHW207dq5g5GxXtdLjsQxg3E=; b=p+DLtz7WvZ7g/1FEoh9amfFpz7eFYZxiSbjhiDaOyDTkIowmmAKSmS4KeP9Z+9hxTo ROWSFXHQgVaVpnjkJXvwngQ9y35iINpSi6zTbx0lORgmnBlPMYh2pyEidc2tsX9m0tME RXB5+GRrqz5uVE3ZpDX2uC242n2ycolauL/vA1HqDsFfwwgvB5RP39jj15E9K0l2dlYi 3Lle9LoWLxdXrNRrgl/aUEBIgdvpmfwnUH1+KiEokL7pMR1yzJ82wmuOtc7mqtShLVRM wvRKH0JiBw02cynF9aPycAVhonAaTK2OrlttLMUY/eRYRS+tazmzR+KSWsGG74gMcWtg wJRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sb15qLWva7b5eccs+rAtHW207dq5g5GxXtdLjsQxg3E=; b=Tke+stG8RlpNvqlrZajMBNrrG4sXCFEjoY5xGUdDbL2ADrJF8eXaYUNwDsrYpEMYZH iT1/M5/xywh2DuULGuLTaht7trdJssokkMIqLWN0Y24j9EPSXFbPjnqTY4gNhGyz+nz7 73ltXvuZQG21/maFfyge04b4DrAS45/U/9B8KZ7aFZXa+nh8NUdp3KjOvo0VaYvZ09Py fZrXUElk8Sojj8Iem2ynqwrS8mapZGr0qiL9kzgajUwn7npAx09vZDN4eNbTJCDiLyBG f3Zz8pV7YEKzMdS+aNbfScplAnIUFdIrdFPKIFSCageCAQAa07drJYuz8cMC2gdO6PR0 L44A== X-Gm-Message-State: AOAM5321gLYBQvtPgs8x9JMY0sdgLWGCrX/osUFd0JZ9YuyrIzfMk22y GfT7DN6rWXd+SHAibRTEv/CPzQ== X-Received: by 2002:ac8:ec7:: with SMTP id w7mr4676763qti.118.1598931945770; Mon, 31 Aug 2020 20:45:45 -0700 (PDT) Received: from DUFFMAN (135-23-195-85.cpe.pppoe.ca. [135.23.195.85]) by smtp.gmail.com with ESMTPSA id s17sm13489048qte.50.2020.08.31.20.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 20:45:45 -0700 (PDT) Date: Mon, 31 Aug 2020 23:45:42 -0400 From: Samuel Dionne-Riel To: Marc Zyngier Cc: Rob Herring , devicetree@vger.kernel.org, Frank Rowand , linux-kernel@vger.kernel.org Subject: Re: Boot failure on gru-scarlet-inx with 5.9-rc2 Message-ID: <20200831234542.295b1275@DUFFMAN> In-Reply-To: <90731ebb54fe03003dce03bc7ec4872e@kernel.org> References: <20200829164920.7d28e01a@DUFFMAN> <65d88bdd0888a69849327501a2aad186@kernel.org> <20200831031838.2d6d76d9@DUFFMAN> <90731ebb54fe03003dce03bc7ec4872e@kernel.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 Aug 2020 10:27:37 +0100 Marc Zyngier wrote: > > Ah, so actually anything that *enables pcie* kills your system. > Great investigative work! > > > > > And backed by a further bisection with this that points to > > d84c572de1a360501d2e439ac632126f5facf59d being the actual change > > that causes the tablet to fail to boot, as long as the pcie0 node is > > identified as pci properly. > > > > I am unsure if I should add as a Cc everyone involved in that change > > set, though the author (coincidentally) is already in the original > > list of recipients. > > I've deliberately moved Rob from Cc to To... ;-) Thanks, I don't actually know who to write to exactly. > > Any additional thoughts from this additional information? > > What you could do is to start looking at which of the > pci_is_root_bus() changes breaks PCIe on this system. The fact that > it breaks on your system and not on mine is a bit puzzling. Let me show you, on top of v5.9-rc3 I can successfully boot using this partial revert / adaptation of d84c572d. In addition, it also allows the Wi-Fi to work again, compared to how it didn't in 5.9-rc1 or 5.9-rc[23] with the dumb revert of your fix. So, if we number each pci_is_root_bus by order appearance, it is only the second use, in rockchip_pcie_valid_device, which seem to cause scarlet not to boot. The patch (not actually a patch submission) reverts only that instance of pci_is_root_bus, while also doing some leg work to put back some functionally equivalent code that was refactored away since. If there's anything else you want me to try, don't hesitate. --- drivers/pci/controller/pcie-rockchip-host.c | 8 +++++++- drivers/pci/controller/pcie-rockchip.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 0bb2fb3e8a0b..5a27fa833fbd 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -79,7 +79,7 @@ static int rockchip_pcie_valid_device(struct rockchip_pcie *rockchip, * do not read more than one device on the bus directly attached * to RC's downstream side. */ - if (pci_is_root_bus(bus->parent) && dev > 0) + if (bus->primary == rockchip->root_bus_nr && dev > 0) return 0; return 1; @@ -944,6 +944,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev) struct rockchip_pcie *rockchip; struct device *dev = &pdev->dev; struct pci_host_bridge *bridge; + struct resource *bus_res; int err; if (!dev->of_node) @@ -983,6 +984,11 @@ static int rockchip_pcie_probe(struct platform_device *pdev) if (err < 0) goto err_deinit_port; + /* HACK; ~equiv to last param of pci_parse_request_of_pci_ranges */ + bus_res = (resource_list_first_type(&bridge->windows, IORESOURCE_MEM))->res; + + rockchip->root_bus_nr = bus_res->start; + err = rockchip_pcie_cfg_atu(rockchip); if (err) goto err_remove_irq_domain; diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h index c7d0178fc8c2..0952fec7e34d 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -298,6 +298,7 @@ struct rockchip_pcie { struct gpio_desc *ep_gpio; u32 lanes; u8 lanes_map; + u8 root_bus_nr; int link_gen; struct device *dev; struct irq_domain *irq_domain; -- 2.25.4 Thanks again! -- Samuel Dionne-Riel