Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Faiz Abbas <faiz_abbas@ti.com>
Cc: kishon@ti.com, bhelgaas@google.com, linux-omap@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dwc: dra7xx: Print link state to console for debug
Date: Tue, 24 Oct 2017 14:59:50 -0500	[thread overview]
Message-ID: <20171024195950.GD21840@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <1508417009-30869-1-git-send-email-faiz_abbas@ti.com>

On Thu, Oct 19, 2017 at 06:13:29PM +0530, Faiz Abbas wrote:
> Enable support for printing the LTSSM link state for debugging PCI
> when link is down.
> 
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>

Applied with Kishon's ack to pci/host-dra7xx for v4.15, thanks!

I tweaked the "link up" testing as follows (what I suggested before):


@@ -118,8 +157,18 @@ static int dra7xx_pcie_link_up(struct dw_pcie *pci)
 {
 	struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
 	u32 reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_PHY_CS);
+	int link_up = !!(reg & LINK_UP);
+	u32 cmd_reg;
+	u32 ltssm_state;
+
+	if (!link_up) {
+		cmd_reg = dra7xx_pcie_readl(dra7xx,
+					    PCIECTRL_DRA7XX_CONF_DEVICE_CMD);
+		ltssm_state = (cmd_reg & GENMASK(7, 2)) >> 2;
+		dev_dbg(pci->dev, "Link state: %s\n", state[ltssm_state]);
+	}
 
-	return !!(reg & LINK_UP);
+	return link_up;
 }
 
 static void dra7xx_pcie_stop_link(struct dw_pcie *pci)

  parent reply	other threads:[~2017-10-24 19:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 12:43 [PATCH v2] dwc: dra7xx: Print link state to console for debug Faiz Abbas
2017-10-19 13:08 ` Faiz Abbas
2017-10-19 13:26   ` David Laight
2017-10-26  7:59     ` Faiz Abbas
2017-10-30  8:48       ` Faiz Abbas
2017-11-06  2:56         ` Faiz Abbas
2017-10-20 23:09 ` Bjorn Helgaas
2017-10-23 10:29   ` Faiz Abbas
2017-10-23 14:04     ` Bjorn Helgaas
2017-10-24  6:18       ` Kishon Vijay Abraham I
2017-10-24 19:59 ` Bjorn Helgaas [this message]
2017-10-25  8:21   ` Faiz Abbas
2017-10-25 13:23     ` Bjorn Helgaas

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=20171024195950.GD21840@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=faiz_abbas@ti.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pci@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox