From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FAKE_REPLY_C,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 695AFC43331 for ; Thu, 26 Mar 2020 15:12:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EDB8206F8 for ; Thu, 26 Mar 2020 15:12:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SmiZd+Ga"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="HswQ9GU3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EDB8206F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=jl183LDn9oB2ydjC5/+B0d64TcBHF3wafe217O7X7gM=; b=SmiZd+GapE9N0q zIV/To2cPI84KlSRm9icsmobds6qsUXbtRcgoU6ComUVGFJuiGLK48Nf7ZisWog1VcnNMI1kqj1cV 730KyMe6j801kD7pyamJ4h2/ys3CEeNE7LfMjLmt4alAqsapmCeD9yd4ZUNxxr+IckmTBB1Dhz/lE Bdx3tHsIUgX+VsWy3Cx7abtcqh3qRdHM7tTlNgoHFCv6FTZNfWIkew9CRbbxNxwiCFGouPrXHpSog cJ5r8XeHafk4P7VX+1Ucg49FwN5r9JuOqT8QsKdWRaLZMmeT2Dx+LIQTiEJfRF+Sql5yzEI4NeZbJ n4KWWQgqAW1jC4Iz4INg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHUB1-0006U8-JT; Thu, 26 Mar 2020 15:12:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHUAy-0006TY-GT for linux-arm-kernel@lists.infradead.org; Thu, 26 Mar 2020 15:12:09 +0000 Received: from localhost (mobile-166-175-186-165.mycingular.net [166.175.186.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9991E206F8; Thu, 26 Mar 2020 15:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585235528; bh=gNmb1UwpI1bot54AGT9LmV+Ay1kJtk9PvnEvdt7OJfc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=HswQ9GU3pelOso6U3R+842+f+BEsJtKi+asi1ius/Kpn2ivVMGAkMxQdfx4AdmRWL OXIpK3kwBDOOPY60j6YQgGoDi/R1l/B3W2qIVR2ZIZhJqacpgQuvx/Hur4AJIK+DoY froEyzgClLoLaQL8Y/qmAtHqp2GIHJ1KQZMKnUFw= Date: Thu, 26 Mar 2020 10:12:05 -0500 From: Bjorn Helgaas To: Srinath Mannam Subject: Re: [PATCH 3/3] PCI: iproc: Display PCIe Link information Message-ID: <20200326151205.GA6837@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1585206447-1363-4-git-send-email-srinath.mannam@broadcom.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200326_081208_563790_90EA2461 X-CRM114-Status: GOOD ( 15.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , bcm-kernel-feedback-list@broadcom.com, Ray Jui , Andrew Murray , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 26, 2020 at 12:37:27PM +0530, Srinath Mannam wrote: > Add more comprehensive information to show PCIe link speed and link > width to the console. > > Signed-off-by: Srinath Mannam > --- > drivers/pci/controller/pcie-iproc.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c > index e7f0d58..ed41357 100644 > --- a/drivers/pci/controller/pcie-iproc.c > +++ b/drivers/pci/controller/pcie-iproc.c > @@ -823,6 +823,8 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie) > #define PCI_TARGET_LINK_SPEED_MASK 0xf > #define PCI_TARGET_LINK_SPEED_GEN2 0x2 > #define PCI_TARGET_LINK_SPEED_GEN1 0x1 > +#define PCI_TARGET_LINK_WIDTH_MASK 0x3f > +#define PCI_TARGET_LINK_WIDTH_OFFSET 0x4 > iproc_pci_raw_config_read32(pcie, 0, > IPROC_PCI_EXP_CAP + PCI_EXP_LNKCTL2, > 4, &link_ctrl); > @@ -843,7 +845,14 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie) > } > } > > - dev_info(dev, "link: %s\n", link_is_active ? "UP" : "DOWN"); > + if (link_is_active) { > + dev_info(dev, "link UP @ Speed Gen-%d and width-x%d\n", > + link_status & PCI_TARGET_LINK_SPEED_MASK, > + (link_status >> PCI_TARGET_LINK_WIDTH_OFFSET) & > + PCI_TARGET_LINK_WIDTH_MASK); Can you use pcie_print_link_status() or some variant here instead of rolling your own? > + } else { > + dev_info(dev, "link DOWN\n"); > + } > > return link_is_active ? 0 : -ENODEV; > } > -- > 2.7.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel