All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: u-boot@lists.denx.de, pali@kernel.org,
	"Marek Behún" <marek.behun@nic.cz>
Subject: [PATCH u-boot-marvell 1/6] arm: a37xx: pci: Fix pcie_advk_link_up()
Date: Sat, 25 Sep 2021 22:37:01 +0200	[thread overview]
Message-ID: <20210925203706.20322-2-kabel@kernel.org> (raw)
In-Reply-To: <20210925203706.20322-1-kabel@kernel.org>

From: Pali Rohár <pali@kernel.org>

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 <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
---
 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


  reply	other threads:[~2021-09-25 20:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 20:37 [PATCH u-boot-marvell 0/6] A3720 PCIe enhancements Marek Behún
2021-09-25 20:37 ` Marek Behún [this message]
2021-09-25 20:37 ` [PATCH u-boot-marvell 2/6] arm: a37xx: pci: Add support for accessing PCI Bridge on root bus Marek Behún
2021-09-25 20:37 ` [PATCH u-boot-marvell 3/6] arm: a37xx: pci: Do not automatically enable bus mastering on PCI Bridge Marek Behún
2021-09-25 20:37 ` [PATCH u-boot-marvell 4/6] arm: a37xx: pci: Handle propagation of CRSSVE bit from PCIe Root Port Marek Behún
2021-09-25 20:37 ` [PATCH u-boot-marvell 5/6] arm: a37xx: pci: Cosmetic change Marek Behún
2021-09-25 20:37 ` [PATCH u-boot-marvell 6/6] arm: a37xx: pci: Update private structure documentation Marek Behún
2021-09-25 21:50   ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210925203706.20322-2-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.