Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp746708imm; Thu, 31 May 2018 08:42:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJD96ZSpDT2DiHlSfusCBJuLMKmeJcN4/4AJk2+SiXZrQ7dBeHYsANiHuVIwDgO+jq+SOay X-Received: by 2002:a63:a00a:: with SMTP id r10-v6mr6014938pge.222.1527781339971; Thu, 31 May 2018 08:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527781339; cv=none; d=google.com; s=arc-20160816; b=RZ7yAvhDGmPJVwKDUXMm8pzjvxPv0bTvZVOkefozSAofou0NaxSURcxzjvzCFUwOix eZqv97fAcFeVlYiLRn4LFE6tOefKHSTZgiT0ltzKXGdMyCi+OieS4e3X+O48yu5mnKOD ReTC2fkZzDPSZ3FQFJIKkYzaniNT3Fl3ejFfeLm24cet9OIslTf238YBHpuC1AZoLORC ndOQvDjWNP3FZFRjBmpCn3h3J8DA55ZgFv/Le12NTItkuJAp0KCsM6axHmbviXhwVRU6 BtHxQibmz2x/nitsDYUvNy7iV9KvFWL54T5lnQIiSP/9EZZe5PSeYMW75L+Q2VzKyY3k E+ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:to:from:cc:dkim-signature :arc-authentication-results; bh=IBu1zueLNmzb1IPABi+HoyxDhmHike2nfhypVJ1sRE4=; b=iNTYp2Wx7Ie9WDbbSM3xeZaI/aTleqzYf+6kQrygWnrB7DZMdXOz8F82g5YmRcFLVl ss0TaoMZ9XZ+n6IaNqHnD+lEtslRcWKGNUkAfkh/Mo9hlR8KAfcqspvcCQElhIhnjQFD wXRsGJ2THXZBPP/ZMtg4dyeykH8f5WD5PNMEja77xFSRH60di4q6W0+9/ExGtZxwu/a/ KQ1UQM+hQBuMMxjeknby0klFeqpNofTtmn5QeflJ1PkMCypsge1KlNMM8A74jy/qL1SS oJmAaBpYbZWcvNAor5xrwEbP2kbVZ0ObBy8R+zjb8ahE0tOXV1x6nZOfvWSXG4cGY5fr H0Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dellteam.com header.s=smtpout header.b=Mgj9CtTO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13-v6si407194plm.99.2018.05.31.08.42.05; Thu, 31 May 2018 08:42:19 -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=fail header.i=@dellteam.com header.s=smtpout header.b=Mgj9CtTO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932720AbeEaPkn (ORCPT + 99 others); Thu, 31 May 2018 11:40:43 -0400 Received: from esa5.dell-outbound.iphmx.com ([68.232.153.95]:46056 "EHLO esa5.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932703AbeEaPkm (ORCPT ); Thu, 31 May 2018 11:40:42 -0400 X-Greylist: delayed 676 seconds by postgrey-1.27 at vger.kernel.org; Thu, 31 May 2018 11:40:42 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dellteam.com; i=@dellteam.com; q=dns/txt; s=smtpout; t=1527780929; x=1559316929; h=cc:from:to:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=06je8GhaJ/wEOM1Wm7UiS5fQxjl4VW5QMfxgv8QRHHQ=; b=Mgj9CtTOwEQDT9rdxbS4Bs7iVfa7DA3/Mcbomuikp2UEgpLYi6h9y2lx 3GaLaWQ/zRDJXbdfDHykuOeqcsZ+iZjxbGrttWA8vQ+g4A8pNsbFDW+wm qrDFQ0x5BTTKGJNob9URiNHQIxdxeXE3Ir58Jei9bYfMZFsHEtmOFUnag s=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GyAAAqFBBbmMmZ6ERcGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYQYgQ0ymFWBeYEPkzyBeAuEbIIHITUXAQIBAQEBAQECAQECEAEBAQE?= =?us-ascii?q?BBg0LBigvgjUiglQBBTo/EAIBCBgeEFcCBAEagxqCAaoCiEOBaIhBghOEHIRzh?= =?us-ascii?q?VQCmGkJBY5UjRuRFYFDAYIIcIMUgh8OCY4XjzeBGQEB?= X-IPAS-Result: =?us-ascii?q?A2GyAAAqFBBbmMmZ6ERcGgEBAQEBAgEBAQEIAQEBAYQYgQ0?= =?us-ascii?q?ymFWBeYEPkzyBeAuEbIIHITUXAQIBAQEBAQECAQECEAEBAQEBBg0LBigvgjUig?= =?us-ascii?q?lQBBTo/EAIBCBgeEFcCBAEagxqCAaoCiEOBaIhBghOEHIRzhVQCmGkJBY5UjRu?= =?us-ascii?q?RFYFDAYIIcIMUgh8OCY4XjzeBGQEB?= Received: from esa1.dell-outbound2.iphmx.com ([68.232.153.201]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 10:25:54 -0500 Cc: , , , , Received: from ausxippc101.us.dell.com ([143.166.85.207]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2018 21:21:30 +0600 X-LoopCount0: from 10.166.134.83 X-IronPort-AV: E=Sophos;i="5.49,463,1520917200"; d="scan'208";a="1092923899" X-DLP: DLP_GlobalPCIDSS From: To: , , Subject: Re: [PATCH] PCI: Check for PCIe downtraining conditions Thread-Topic: [PATCH] PCI: Check for PCIe downtraining conditions Thread-Index: AQHT+PFV3WgrlSaJlEW4KNPXuIvKGw== Date: Thu, 31 May 2018 15:29:23 +0000 Message-ID: <4e0611c872054e768daa96b302651db3@ausx13mps321.AMER.DELL.COM> References: <20180531150535.9684-1-mr.nuke.me@gmail.com> <28004506-24f0-6d10-2d1e-074e0483d2f9@codeaurora.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.178.128.191] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/31/2018 10:28 AM, Sinan Kaya wrote:=0A= > On 5/31/2018 11:05 AM, Alexandru Gagniuc wrote:=0A= >> +static void pcie_max_link_cap(struct pci_dev *dev, enum pci_bus_speed *= speed,=0A= >> + enum pcie_link_width *width)=0A= >> +{=0A= >> + uint32_t lnkcap;=0A= >> +=0A= >> + pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap);=0A= >> +=0A= >> + *speed =3D pcie_link_speed[lnkcap & PCI_EXP_LNKCAP_SLS];=0A= >> + *width =3D (lnkcap & PCI_EXP_LNKCAP_MLW) >> PCI_EXP_LNKCAP_MLW_SHIFT;= =0A= >> +}=0A= >> +=0A= >> +static void pcie_cur_link_sta(struct pci_dev *dev, enum pci_bus_speed *= speed,=0A= >> + enum pcie_link_width *width)=0A= >> +{=0A= >> + uint16_t lnksta;=0A= >> +=0A= >> + pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnksta);=0A= >> + *speed =3D pcie_link_speed[lnksta & PCI_EXP_LNKSTA_CLS];=0A= >> + *width =3D (lnksta & PCI_EXP_LNKSTA_NLW) >> PCI_EXP_LNKSTA_NLW_SHIFT;= =0A= >> +}=0A= >> +=0A= >> +static const char *pcie_bus_speed_name(enum pci_bus_speed speed)=0A= >> +{=0A= >> + switch (speed) {=0A= >> + case PCIE_SPEED_2_5GT:=0A= >> + return "2.5 GT/s";=0A= >> + case PCIE_SPEED_5_0GT:=0A= >> + return "5.0 GT/s";=0A= >> + case PCIE_SPEED_8_0GT:=0A= >> + return "8.0 GT/s";=0A= >> + default:=0A= >> + return "unknown";=0A= >> + }=0A= >> +}=0A= > =0A= > I thought Bjorn added some functions to retrieve this now.=0A= =0A= Hmm. I couldn't find them.=0A= =0A= Alex=0A= =0A=