From mboxrd@z Thu Jan 1 00:00:00 1970 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 AA1ABC433EF for ; Sat, 25 Sep 2021 22:55:40 +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 C822E60FDC for ; Sat, 25 Sep 2021 22:55:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C822E60FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 16238834E3; Sun, 26 Sep 2021 00:55:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="EyeZP82A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 528DB835A2; Sun, 26 Sep 2021 00:55:05 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C866D83578 for ; Sun, 26 Sep 2021 00:54:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id AF6D06108C; Sat, 25 Sep 2021 22:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632610491; bh=R8v7AGDFIUpSg/BhgP85aS9A8aRWr4RLvlTXiqXMSek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EyeZP82A/7jz8EBsZZ+LoPU4YZmtEJCJXfnIo239b5T/73GKR0WRphvfR7uwFB3no xSpC/ZkXWO02TZnLb8vki0FaKtqGG/Gq2niNQXo1jZMETDQOBjmMEadjguGLNIJr4S 6RIk0ZyFwHVsU0wrxjKc8PuTlruLZIEsF6E/wJNc6F/QyQlDWoRVTyHMv7C+g/9u2p ozKWgwlky+d+OLsvvfu62SRh3h0WJy2NEh+9YjRj8KFCVN+0GpldrzGjlbqhHzAUax XSpsBhoFDwTTnlxNjfVR7WpEpXYuW0vGVyY49BfqtxhpxMh/4YPbFbMn2Rnd0NPe4j +Tb7LrTzuSGQA== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, pali@kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell v2 1/6] arm: a37xx: pci: Fix pcie_advk_link_up() Date: Sun, 26 Sep 2021 00:54:41 +0200 Message-Id: <20210925225446.1872-2-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210925225446.1872-1-kabel@kernel.org> References: <20210925225446.1872-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Pali Rohár Aardvark reports Disabled and Hot Reset LTSSM states as values >= 0x20. Link is not up in these states, so fix pcie_advk_link_up() function. Signed-off-by: Pali Rohár Reviewed-by: Marek Behún --- drivers/pci/pci-aardvark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c index cf6e30f936..741e0431e1 100644 --- a/drivers/pci/pci-aardvark.c +++ b/drivers/pci/pci-aardvark.c @@ -145,6 +145,7 @@ #define LTSSM_SHIFT 24 #define LTSSM_MASK 0x3f #define LTSSM_L0 0x10 +#define LTSSM_DISABLED 0x20 #define VENDOR_ID_REG (LMI_BASE_ADDR + 0x44) /* PCIe core controller registers */ @@ -569,7 +570,7 @@ static int pcie_advk_link_up(struct pcie_advk *pcie) val = advk_readl(pcie, CFG_REG); ltssm_state = (val >> LTSSM_SHIFT) & LTSSM_MASK; - return ltssm_state >= LTSSM_L0; + return ltssm_state >= LTSSM_L0 && ltssm_state < LTSSM_DISABLED; } /** -- 2.32.0