Received: by 10.223.164.221 with SMTP id h29csp3914645wrb; Thu, 19 Oct 2017 06:11:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TrjY6hVjYcW80CAtzTI/hCiMZlYat75pqWSm73zQ0YxTVFcYrh3f56XpnT2eTs/wbnM3pr X-Received: by 10.84.128.70 with SMTP id 64mr1511225pla.329.1508418705749; Thu, 19 Oct 2017 06:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508418705; cv=none; d=google.com; s=arc-20160816; b=SbNVS84Rif/4gZI1JuudzsM1yyxs3Tx3YYy9PzP1WJ5UrA2eKL0MErUbLGTK17vF7m Fh7IQgUjs9i27l8txRtFDrV0U04ji7aTcq6imfFKcxnPyJGHY/1Y/dbbXweNmhlJdbep e9UhOXZpRpnWQkrQjxmZk0wHlP5U905uZOt635RsHhxGu9fEy59EkzsxnNpgDd6cryTx 2gSiMCjyksqB2NwVYOxZdege5bi++KucP0Chkr+OpM91HE5r8ESMe7aN35rIgndAhC18 C/lujZ6BfZoBbey9yNhhhC/NC+H8HCkVDK4bVRlge1hBRMF1FuEEUs/xXxVY8kRtnoXY TmWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=WcX0VH8+lmjb6kJs0GpRPBGd5oTVr7oSCqaN1GF7oQQ=; b=T1ve3dhOhcj15Jrc/rXZlzKlqyJW1iLSZ7qJZIg3VxPVqlRbMGJhTKWjFVlGuhe2YI 8dyCLY/QIPI2qee5miLEJSY8qhdsJmyhil9lC1eOXf53v+lmh2x4hlPIatmNP/T4QJ/c ObAtJV+eCd/Wj0+AC88rw+hFCorOhKDGew8VUGlwERvZlZgqYCSBe3JVdKf4Q8zoxJR1 kkV8JNkUzBawCJGH2CV/VyaM79PafbhxDRLLg4xnEhx+bZb1SSFRj55D8agqxuKmnb47 8zasIGHp4Z8JXfHYnXxcqrG0rMkXndfDwwuzF1gqvCN2hjLFirjLHAOQOEFUOPEBYPvS Kj8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yvq59nCZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r124si9320054pfc.423.2017.10.19.06.11.31; Thu, 19 Oct 2017 06:11:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yvq59nCZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800AbdJSNJL (ORCPT + 99 others); Thu, 19 Oct 2017 09:09:11 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:45627 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362AbdJSNJH (ORCPT ); Thu, 19 Oct 2017 09:09:07 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9JD8kdx010850; Thu, 19 Oct 2017 08:08:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1508418526; bh=LfL9lodIa4U7reB00uYNnYLWWugaSUq2BJ7rpCE5IYc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=yvq59nCZDbcGMLzihZ01WEoIADoR5N4ilh2Lazgd5lQtkJzBurYgRAJQ5PPUXSPU1 P0MqAhldib1LDDHvx5/6EoHL/A76bftdKzS0x/M9ixKj44WvKHqixWirmI4VW3tXaL XcbeWTbliW2kGdZzmwp3p13r/BIg7i+D/VCp7+UM= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9JD8fva002859; Thu, 19 Oct 2017 08:08:41 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 19 Oct 2017 08:08:40 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 19 Oct 2017 08:08:40 -0500 Received: from [172.24.190.215] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9JD8cQP004381; Thu, 19 Oct 2017 08:08:39 -0500 Subject: Re: [PATCH v2] dwc: dra7xx: Print link state to console for debug To: CC: , , , References: <1508417009-30869-1-git-send-email-faiz_abbas@ti.com> From: Faiz Abbas Message-ID: <9378c5c9-381d-4c40-3290-f7e3720792ba@ti.com> Date: Thu, 19 Oct 2017 18:38:54 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1508417009-30869-1-git-send-email-faiz_abbas@ti.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 19 October 2017 06:13 PM, Faiz Abbas wrote: > Enable support for printing the LTSSM link state for debugging PCI > when link is down. > > Signed-off-by: Faiz Abbas > --- > v2: > 1. Changed dev_err() to dev_dbg() > 2. Changed static char array to static const char * const > 3. format changes > > drivers/pci/dwc/pci-dra7xx.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > > diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c > index 34427a6..0e70e77 100644 > --- a/drivers/pci/dwc/pci-dra7xx.c > +++ b/drivers/pci/dwc/pci-dra7xx.c > @@ -98,6 +98,45 @@ struct dra7xx_pcie_of_data { > > #define to_dra7xx_pcie(x) dev_get_drvdata((x)->dev) > > +static const char * const state[] = { > + "DETECT_QUIET", > + "DETECT_ACT", > + "POLL_ACTIVE", > + "POLL_COMPLIANCE", > + "POLL_CONFIG", > + "PRE_DETECT_QUIET", > + "DETECT_WAIT", > + "CFG_LINKWD_START", > + "CFG_LINKWD_ACEPT", > + "CFG_LANENUM_WAIT", > + "CFG_LANENUM_ACEPT", > + "CFG_COMPLETE", > + "CFG_IDLE", > + "RCVRY_LOCK", > + "RCVRY_SPEED", > + "RCVRY_RCVRCFG", > + "RCVRY_IDLE", > + "L0", > + "L0S", > + "L123_SEND_EIDLE", > + "L1_IDLE", > + "L2_IDLE", > + "L2_WAKE", > + "DISABLED_ENTRY", > + "DISABLED_IDLE", > + "DISABLED", > + "LPBK_ENTRY", > + "LPBK_ACTIVE", > + "LPBK_EXIT", > + "LPBK_EXIT_TIMEOUT", > + "HOT_RESET_ENTRY", > + "HOT_RESET", > + "RCVRY_EQ0", > + "RCVRY_EQ1", > + "RCVRY_EQ2", > + "RCVRY_EQ3" > +}; > + > static inline u32 dra7xx_pcie_readl(struct dra7xx_pcie *pcie, u32 offset) > { > return readl(pcie->base + offset); > @@ -118,6 +157,15 @@ 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); > + u32 cmd_reg; > + u32 ltssm_state; > + > + if (!(reg & 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); > } > I missed David's comment in v1. Will submit a new version. Please ignore. Thanks, Faiz From 1583951429178262129@xxx Mon Nov 13 11:49:56 +0000 2017 X-GM-THRID: 1583223837737058963 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread