From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932283AbdJYIVg (ORCPT ); Wed, 25 Oct 2017 04:21:36 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:50589 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178AbdJYIVb (ORCPT ); Wed, 25 Oct 2017 04:21:31 -0400 Subject: Re: [PATCH v2] dwc: dra7xx: Print link state to console for debug To: Bjorn Helgaas CC: , , , , References: <1508417009-30869-1-git-send-email-faiz_abbas@ti.com> <20171024195950.GD21840@bhelgaas-glaptop.roam.corp.google.com> From: Faiz Abbas Message-ID: Date: Wed, 25 Oct 2017 13:51:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171024195950.GD21840@bhelgaas-glaptop.roam.corp.google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn, On Wednesday 25 October 2017 01:29 AM, Bjorn Helgaas wrote: > 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 > > 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) > I wanted to send another version with David's suggestions included. Please don't merge. Thanks, Faiz