Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp838484imm; Thu, 31 May 2018 10:14:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuyCQqE9j/4y+N/Rx0kzL4q3ht8uD9Ve075jkp4RrvQj3kwQFcWHUwP/R3JKutlniJhcXS X-Received: by 2002:a63:735e:: with SMTP id d30-v6mr6360229pgn.257.1527786840316; Thu, 31 May 2018 10:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527786840; cv=none; d=google.com; s=arc-20160816; b=WIak7aLGVsNJKabeVQMrITBj3YSp/YYKslfrhwUP0iUfveJfMOtXaEjZJfhau/vl9P E9ZYFfibSJ2KCov8it8CoNmXNxRYLW1EpitM2OwCKhBmrSInEgQ8P/cOO7wkcTR/LTmE 1zA/bePR9iioOj9FNHRutMv4GZv0CA6Ov3rM47eKS2wvyWScTEBmgEMjr6V2xBi7j7Fv 1jAgAunbk1CQ0g+NjqvUArYghA5151Z4vQBWV+SguHw53zeAV86S25HM3cwPkPMxSgeS gl89INCi5FWyEsM8oHDiGLgpD4+Hh6+iIrM+WtYf4PyeQzOupZ0Uh3Zp/FkJE5tRW4lx rlog== 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:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=jRgBsG4aRIsyUtixs1NMjMSTxDXuhveytrBkvkwt0/I=; b=SHmZifab5qYar5vzpkhGnCBvfTDyms1noXf0mWFNCGBzW8tyFWp+Dow+BjTzBYcEyB izRDyuSgvc2S95W9jCCRtq6nypuCS+lLmgRYkeyHbN7wTI6qsDfU0h6m9oF7jsby5iRs fzHZYXH2+1xTtCvacSS7r4CwbICSlJoSgszXkG4vyR57UcPcnZDJwlRrB5j8OvbciTCO 8I2uaes2VE8rzFGByHbSKKxb19AqfMYx9Zvn3gPX3cjCwNyxg0Oxx2k7g9Q06xH2/kE3 OgtZaMcN8S8uB2HYpu/xqo0/inzI58tpWXh6+Ine0WVZaYuXm8/2KrbVd1+5aGJ4rBSL drmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QK7RwThD; dkim=pass header.i=@codeaurora.org header.s=default header.b=QK7RwThD; 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 q2-v6si36401600pfb.1.2018.05.31.10.13.46; Thu, 31 May 2018 10:14:00 -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=@codeaurora.org header.s=default header.b=QK7RwThD; dkim=pass header.i=@codeaurora.org header.s=default header.b=QK7RwThD; 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 S1755807AbeEaRL1 (ORCPT + 99 others); Thu, 31 May 2018 13:11:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45372 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755556AbeEaRLY (ORCPT ); Thu, 31 May 2018 13:11:24 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A836160646; Thu, 31 May 2018 17:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527786683; bh=MIMoCFp5AUlf/BCnGttcZ3oZ6m8QJaY87T6ERwDk6lQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QK7RwThDEf+dEa6cEtXqEE2fwq/6s08QMYJ+VyKmD8Q2FepYaDATYYOsdpePCvv7k mHbx4Kuk7KyEWMuBBf9tRNbZCDl5FMnThOR+ON7cEjmXPhc2ySgzo0zBjDSHWW3/0N llvlZCrF2lpqAaReVxaNBELN2SGkwrH/42pmlbJw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.235.228.150] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5A31F60452; Thu, 31 May 2018 17:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527786683; bh=MIMoCFp5AUlf/BCnGttcZ3oZ6m8QJaY87T6ERwDk6lQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QK7RwThDEf+dEa6cEtXqEE2fwq/6s08QMYJ+VyKmD8Q2FepYaDATYYOsdpePCvv7k mHbx4Kuk7KyEWMuBBf9tRNbZCDl5FMnThOR+ON7cEjmXPhc2ySgzo0zBjDSHWW3/0N llvlZCrF2lpqAaReVxaNBELN2SGkwrH/42pmlbJw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5A31F60452 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH] PCI: Check for PCIe downtraining conditions To: "Alex G." , 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> From: Sinan Kaya Message-ID: <29ad2bf5-b5af-35be-3bef-2d0652aa2e33@codeaurora.org> Date: Thu, 31 May 2018 13:11:21 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <54071f83-5d0d-04a0-d448-0c99ec0ffc4f@gmail.com> 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 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. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.