Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp851752imm; Thu, 31 May 2018 10:28:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIbZA4X30ep1REKH8UrCnUyTmTfPrXmr5Y/+4zt16pybWJojSwuELjGdsB0DY+kKPQgcHN4 X-Received: by 2002:a17:902:bb93:: with SMTP id m19-v6mr7903000pls.123.1527787682498; Thu, 31 May 2018 10:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527787682; cv=none; d=google.com; s=arc-20160816; b=x5X3ZzNx0X5oYEx7MsNvqhJgVDE0GokkEta4zX78yO+D76N63h7JMw3WRXWs3ZTEeZ F7UUr53cdUHQcANITZCt0agm3e/t92nvTl4i/3QtCqlxWRXRG8LBZI0WUmIv4g+J7DLp mEAf8PYNPAKOesICGx7khyjFaVZHozlcFpIIbBq6QhOB/zduBEcqC/aEpovjDPLh/z8i 1JtoeOKYuCtkLr+AIC5c33ryVJc4OhoVxdznSmR/O4/sTdpnt8q95iACXB4rddVGkZTp xgcRj89Tc8rOuksDvIjU6XuPCdDcI0qqqW3OC/QXUt4MoLWanuQgaFJYbMi4/NkE7+E6 1Maw== 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=zlqdfQn1kfDQnaUAGOzIRmazSo5LNr+9iyd0Gc7hUEY=; b=OdIsPPf0FqMqCYmhusgjz9x+8Cq1mCSXC/oSOqi3wAK9QjVTJqy4Eaoo2TEifKAJLh pkeg9b9X5Xts1ZcZyvRND3eIo0Z2gYABOe0CcFtukLv0YPVHm9Y0z/586gEFcv+bFH2r tiz+G66uAWg3P/EXZBTlTPvmUk61eA83gResruXsVkyzFkY7/KzHFtI81RB54Q8rdbpd EC+wkZ84x1HcRygU0x1IVZ0ORSMOVB7hPrBjCo+4Yv4gYsX/QcmcQthwK9oeXLn34Wyz ShMqXOtliIW8bsNSMSV9xWvi3DXas0nFKJXJ+jdVojLr9jeccjiUfBRYlGg3NOeF+2vk 0T8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LAhmizoi; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v73-v6si8570058pfi.22.2018.05.31.10.27.48; Thu, 31 May 2018 10:28:02 -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=@gmail.com header.s=20161025 header.b=LAhmizoi; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755878AbeEaR1Z (ORCPT + 99 others); Thu, 31 May 2018 13:27:25 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:42854 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755768AbeEaR1X (ORCPT ); Thu, 31 May 2018 13:27:23 -0400 Received: by mail-oi0-f68.google.com with SMTP id k190-v6so2641425oib.9; Thu, 31 May 2018 10:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zlqdfQn1kfDQnaUAGOzIRmazSo5LNr+9iyd0Gc7hUEY=; b=LAhmizoiUQ8SrusiacXdTSz32Y8n5guMt+Dn8c+E6xXd17I2tRwhneFmHSB32j6WKi Ugbk9Oo8dxDY0f4tTAMGUGiVa6b91uoo/c5Qv27K+PwyLyCtFeTZIfsY04t5b7Ri/Qso iHB41r71ut+mFO6f4BeYzxbD3y7SUoxIa0c8imFjfkEm0PArDkgtfvPcwulKf2dbmJo0 sLBk83KMjriwb6zr/Xb4oR2rbbIs3u/s0rOwPJOIxgirlJgtNLD43Q9lYM0RbgIVCUTQ NXlIQMrVqNJ0r42gkRzl9sw/D5CWJSx4ukNRAw3H+nXx5YxEJz3Wo0iXGIE4XOFYaVfT mSTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zlqdfQn1kfDQnaUAGOzIRmazSo5LNr+9iyd0Gc7hUEY=; b=UA7Fei0pZ0+mPprRYg1oNQn4HzDzu6qUYb1Z+mbTCCMXq/uQjZq7kNlXlGDQSoM8e8 M6GfaPJJ9NqepYRM8sNDQobWZ6Na3AYwX2HNkScyuEqyhWaWN9vK8yfssSQMnksx9IVI QoO2BAcRHGiTRGhKEmETb/n5WFQGMNsU7IiEqPwuBnLfoQ8wZzYsS6T+EXgVBjp9+aMC VUtuQqpE+HkQMJQ27Wl41TJlgLqQiA5+9MGT1omfUjqt0nd58vvXexbVNL+VAHL3Nt0u J7OU+W/TCgNHDKlylZL6/f47Yfwy+DtqE48lir8BzvKuXt5jLj+IJgh56EcyWj5au24A qNqQ== X-Gm-Message-State: ALKqPwdfYp2QjEFPdKcTeYct3/EwjzuUvx8PXTA1TqAP7gO+HIIrxkdF 1zus1ADHeJ+/RSYw/jZHiOfYSQpmmUc= X-Received: by 2002:aca:f141:: with SMTP id p62-v6mr4659754oih.80.1527787642229; Thu, 31 May 2018 10:27:22 -0700 (PDT) Received: from nuclearis2_1.gtech (c-98-201-114-184.hsd1.tx.comcast.net. [98.201.114.184]) by smtp.gmail.com with ESMTPSA id u16-v6sm29697775otd.63.2018.05.31.10.27.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 10:27:21 -0700 (PDT) Subject: Re: [PATCH] PCI: Check for PCIe downtraining conditions To: Sinan Kaya , Alex_Gagniuc@Dellteam.com, bhelgaas@google.com Cc: Austin.Bolen@dell.com, Shyam.Iyer@dell.com, keith.busch@intel.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180531150535.9684-1-mr.nuke.me@gmail.com> <28004506-24f0-6d10-2d1e-074e0483d2f9@codeaurora.org> <4e0611c872054e768daa96b302651db3@ausx13mps321.AMER.DELL.COM> <3b8a895b-3080-7ddb-cbfd-5aa972e9bf65@gmail.com> <35563ce3-e235-096c-4b9b-5f3664d67d0f@codeaurora.org> <093b2789-39a1-db9e-5783-b0488b3c9ccd@gmail.com> <32d58835-2f35-0b80-38d0-b9ff603619dd@codeaurora.org> <54071f83-5d0d-04a0-d448-0c99ec0ffc4f@gmail.com> <29ad2bf5-b5af-35be-3bef-2d0652aa2e33@codeaurora.org> From: "Alex G." Message-ID: <954892f0-196d-b11c-c2a0-e4a0e4be4b8c@gmail.com> Date: Thu, 31 May 2018 12:27:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <29ad2bf5-b5af-35be-3bef-2d0652aa2e33@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/31/2018 12:11 PM, Sinan Kaya wrote: > On 5/31/2018 12:49 PM, Alex G. wrote: >>> bw_cap = pcie_bandwidth_capable(dev, &speed_cap, &width_cap); >>> bw_avail = pcie_bandwidth_available(dev, &limiting_dev, &speed, &width, *parent*); >> That's confusing. I'd expect _capable() and _available() to be >> symmetrical. They either both look at one link only, or both go down to >> the root port. Though it seems _capable() is link-local, and >> _available() is down to root port. >> > > As you know, link speed is a qualification of two devices speed capability. > Both speed and width parameters get negotiated by two devices during TS1 and TS2 > ordered set exchange. > > You need to see what your link partner can support in available function() vs. > what this device can do in bandwidth() function. I see. I'm not sure I can use pcie_print_link_status() without some major refactoring. I need to look at capability of device and it downstream port. There's no point complaining that an x16 device is running at x4 when the port is only x4 capable. Let me think some more on this. Alex