All of lore.kernel.org
 help / color / mirror / Atom feed
From: claudius.heine.ext@siemens.com
To: stable@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Ley Foon Tan <lftan@altera.com>, Claudius Heine <ch@denx.de>
Subject: [PATCH v4.4 1/7] PCI: altera: Fix altera_pcie_link_is_up()
Date: Mon,  7 Jan 2019 11:00:50 +0100	[thread overview]
Message-ID: <20190107100056.12721-2-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190107100056.12721-1-claudius.heine.ext@siemens.com>

From: Ley Foon Tan <lftan@altera.com>

commit eff31f4002c4e25b9b8c39d0a3a551c6c64c77e8 upstream

Originally altera_pcie_link_is_up() decided the link was up if any of the
low four bits of the LTSSM register were set.  But the link is only up if
the LTSSM state is L0, so check for that exact value.

[bhelgaas: changelog]
Signed-off-by: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Claudius Heine <ch@denx.de>
---
 drivers/pci/host/pcie-altera.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 99da549d5d06..dbac6fb3f0bd 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -40,6 +40,7 @@
 #define P2A_INT_ENABLE			0x3070
 #define P2A_INT_ENA_ALL			0xf
 #define RP_LTSSM			0x3c64
+#define RP_LTSSM_MASK			0x1f
 #define LTSSM_L0			0xf
 
 /* TLP configuration type 0 and 1 */
@@ -140,7 +141,7 @@ static void tlp_write_tx(struct altera_pcie *pcie,
 
 static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
 {
-	return !!(cra_readl(pcie, RP_LTSSM) & LTSSM_L0);
+	return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
 }
 
 static bool altera_pcie_valid_config(struct altera_pcie *pcie,
-- 
2.19.2


  reply	other threads:[~2019-01-07 10:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 10:00 [PATCH v4.4 0/7] PCI: altera: survive warm reboot claudius.heine.ext
2019-01-07 10:00 ` claudius.heine.ext [this message]
2019-01-07 10:00 ` [PATCH v4.4 2/7] PCI: altera: Reorder read/write functions claudius.heine.ext
2019-01-07 10:00 ` [PATCH v4.4 3/7] PCI: altera: Check link status before retrain link claudius.heine.ext
2019-01-07 10:00 ` [PATCH v4.4 4/7] PCI: altera: Poll for link up status after retraining the link claudius.heine.ext
2019-01-07 10:00 ` [PATCH v4.4 5/7] PCI: altera: Poll for link training " claudius.heine.ext
2019-01-07 10:00 ` [PATCH v4.4 6/7] PCI: altera: Rework config accessors for use without a struct pci_bus claudius.heine.ext
2019-01-07 10:00 ` [PATCH v4.4 7/7] PCI: altera: Move retrain from fixup to altera_pcie_host_init() claudius.heine.ext
2019-01-10 19:15 ` [PATCH v4.4 0/7] PCI: altera: survive warm reboot Greg KH
2019-01-14  8:24   ` Claudius Heine
2019-01-14 17:40     ` Greg KH
2019-01-15  8:34       ` Claudius Heine

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=20190107100056.12721-2-claudius.heine.ext@siemens.com \
    --to=claudius.heine.ext@siemens.com \
    --cc=bhelgaas@google.com \
    --cc=ch@denx.de \
    --cc=lftan@altera.com \
    --cc=stable@vger.kernel.org \
    /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.