Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 807D5C433F5 for ; Tue, 2 Nov 2021 10:50:19 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2C8B60EE9 for ; Tue, 2 Nov 2021 10:50:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F2C8B60EE9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5A04835D4; Tue, 2 Nov 2021 11:50:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635850217; bh=Intc3PTTvS95ZRkX2s1VBYRM0gQlznhtRjFz77cAPyA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bPTW5iUkUj9l/IC7wJFn8nMSJqrvVmnFQm/qGVLUaQrbgR+oPMx8IBDkF8Y3tDX8F aHu3WkLxGaqiZqhKQShbFtCS7SG3wy8S/khMnrVTjN7gSVngGgALPk/8FxlbPajgx3 Ll42INLUxRAXZ3Efr9jAQWktQDErsGvw+ESL8J9WkrYhmcoDhtheTxxLjp73bAGyRZ t4D+RRiVk4AYsJZ6kVePH9EOOxa0CLyJDHi2q4fUl58US5BNMylhHpovlPpvMrjwdU q7H6f1Q5fd1HUKMH9KBAGCa7DpZx+O9eVuWuemIzx8XxH7+WowzhUlGEp06c5VhLa6 OSIPy1YrluqQQ== Received: by phobos.denx.de (Postfix, from userid 109) id 9901183383; Tue, 2 Nov 2021 11:50:14 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 89C768119C for ; Tue, 2 Nov 2021 11:50:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (unknown [91.198.250.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Hk69q3Ft6zQjcJ; Tue, 2 Nov 2021 11:50:07 +0100 (CET) Subject: Re: [PATCH 5/8] pci: pci_mvebu: Fix place of link up detection To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de References: <20211022142215.26484-1-pali@kernel.org> <20211022142215.26484-6-pali@kernel.org> From: Stefan Roese Message-ID: Date: Tue, 2 Nov 2021 11:50:03 +0100 MIME-Version: 1.0 In-Reply-To: <20211022142215.26484-6-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 640C51841 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 22.10.21 16:22, Pali Rohár wrote: > PCI Bridge is always accessible also when link is down. So move detection > of link up from mvebu_pcie_of_to_plat() function to mvebu_pcie_valid_addr() > function which is used when accessing PCI config space. > > Signed-off-by: Pali Rohár > Reviewed-by: Marek Behún Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/pci/pci_mvebu.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c > index 4b8e56f22dfa..40b8a57bbe1e 100644 > --- a/drivers/pci/pci_mvebu.c > +++ b/drivers/pci/pci_mvebu.c > @@ -138,6 +138,10 @@ static bool mvebu_pcie_valid_addr(struct mvebu_pcie *pcie, > if (busno == pcie->first_busno && (dev != 0 || func != 0)) > return false; > > + /* Access to other buses is possible when link is up */ > + if (busno != pcie->first_busno && !mvebu_pcie_link_up(pcie)) > + return false; > + > /* On secondary bus can be only one PCIe device */ > if (busno == pcie->sec_busno && dev != 0) > return false; > @@ -369,9 +373,6 @@ static int mvebu_pcie_probe(struct udevice *dev) > struct pci_controller *hose = dev_get_uclass_priv(ctlr); > u32 reg; > > - debug("%s: PCIe %d.%d - up, base %08x\n", __func__, > - pcie->port, pcie->lane, (u32)pcie->base); > - > /* > * Change Class Code of PCI Bridge device to PCI Bridge (0x600400) > * because default value is Memory controller (0x508000) which > @@ -603,13 +604,6 @@ static int mvebu_pcie_of_to_plat(struct udevice *dev) > if (ret < 0) > goto err; > > - /* Check link and skip ports that have no link */ > - if (!mvebu_pcie_link_up(pcie)) { > - debug("%s: %s - down\n", __func__, pcie->name); > - ret = -ENODEV; > - goto err; > - } > - > return 0; > > err: > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de