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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9B7BDC433EF for ; Wed, 16 Feb 2022 08:58:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0278683A35; Wed, 16 Feb 2022 09:58:57 +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=1645001937; bh=F+mQArC2d0+ODgPpmo9XHdq0ZPH9aK8gTgAQUZXvzeo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rKf/1kNjwJHY6fKsAg9qMsex/nH36IBQTCA1AHJxWV76jGtl6JRd/o2e6m84ZcXrO zBd86XRWdoZPu/tliaHeYzX1Ym7jewksqVbEk7cXi0WriUIjV6h878irlE1cb0ReKU Gy/A0wJ7Kj+Xjku6uZFI1HWG/F7t7IniVJXoh0CjHs7mTQ6hVPTcUi4uwdPk4LTnw6 ifQ8j1KR6o2VYZBt6pGeepf1bAuSbyJrbAdBw4GuR4ampV35+c5elEH6UGwl27ya3S ogUN3RhhMPDYXEEZCAfAc1g2ryaKhshIRN5mmxzDX1MVDHcknaD1Ef0EYGfa+68COo stxH/wbK1wwpA== Received: by phobos.denx.de (Postfix, from userid 109) id 5D6BA83A35; Wed, 16 Feb 2022 09:58:55 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (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 F0F8B839E8 for ; Wed, 16 Feb 2022 09:58:51 +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 smtp1.mailbox.org (unknown [91.198.250.123]) (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-107.mailbox.org (Postfix) with ESMTPS id 4JzBhW47fwz9sTk; Wed, 16 Feb 2022 09:58:51 +0100 (CET) Message-ID: <65543df1-3593-826a-83ab-681d52ecf18f@denx.de> Date: Wed, 16 Feb 2022 09:58:47 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-marvell 2/3] arm: a37xx: pci: Register controller also when no PCIe card is connected Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de References: <20220215102337.18426-1-pali@kernel.org> <20220215102337.18426-2-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220215102337.18426-2-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean On 2/15/22 11:23, Pali Rohár wrote: > Allow access to config space of PCIe Root Port (which is always present on > the root bus) even when PCIe link is down or no card is connected. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/pci/pci-aardvark.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c > index ccaeecaca8e3..c795ef10b884 100644 > --- a/drivers/pci/pci-aardvark.c > +++ b/drivers/pci/pci-aardvark.c > @@ -645,11 +645,8 @@ retry: > * @pcie: The PCI device to access > * > * Wait up to 1 second for link training to be accomplished. > - * > - * Return 1 (true) if link training ends up with link up success. > - * Return 0 (false) if link training ends up with link up failure. > */ > -static int pcie_advk_wait_for_link(struct pcie_advk *pcie) > +static void pcie_advk_wait_for_link(struct pcie_advk *pcie) > { > int retries; > > @@ -657,15 +654,13 @@ static int pcie_advk_wait_for_link(struct pcie_advk *pcie) > for (retries = 0; retries < LINK_MAX_RETRIES; retries++) { > if (pcie_advk_link_up(pcie)) { > printf("PCIe: Link up\n"); > - return 0; > + return; > } > > udelay(LINK_WAIT_TIMEOUT); > } > > printf("PCIe: Link down\n"); > - > - return -ETIMEDOUT; > } > > /* > @@ -898,8 +893,7 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie) > return -EINVAL; > > /* Wait for PCIe link up */ > - if (pcie_advk_wait_for_link(pcie)) > - return -ENXIO; > + pcie_advk_wait_for_link(pcie); > > return 0; > } Viele Grüße, Stefan Roese -- 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