Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4518668ybl; Mon, 3 Feb 2020 20:39:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxLZ5gSD0ewYslC29fmc4ASpjPNLndRcdDxoBMATupReSHRgw2RpUTtKtcTWMkI/IZbTSu/ X-Received: by 2002:a9d:23b5:: with SMTP id t50mr19969628otb.122.1580791171201; Mon, 03 Feb 2020 20:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580791171; cv=none; d=google.com; s=arc-20160816; b=awYKhWtz3bmk9Lh/NGA+sFUufEvaP6gx1AMyI3HWpswMk/LIjLtcQFTILJvE9KlTtf av+NBixRTAt/w0fI0uMCOIZ8jrnI++On9Q5SgSKuGWziH06A0g70joQs7bkzT8fYV2U5 PYMN201rQpZ/vAOtPieIT9ajfslJTxqaRptvo0dTfyQFyz25ytRyrRR/N+SBe3DYKpmn w42qMcMat2UQJ20IYfQqxqGDY9P6k9XXNh61vS0TBWZufDCmoY0Ep4MBCh14/D3JpH+8 8YTsDCbP4Z/qQFzviPpkmp41SvjAcEGB3rtWTS0YGaEUniXosDzx68pnHlgQxnjutabK rlAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kwEAau+rsMDhI/rTkj8WWkutk7+hEAfhsQ4kT1zhWIU=; b=eYz/H9FFjD0dY9Ta53n5wX6SdFZtkqlWBvBUmW8QUk6jz/xGZgz7Y6L2KjWXvgtIB6 lfbSqSDfsSZyzyadg4rA4xgAg6yv91EdUuGuJgPxSTq+C3+56ENU8NTk9C45SrjNKWG9 lIesNxEMX+/jGwGCyDEkpayvJoLwhCJ52Wqd7f8sL2sq2odQB1D8bjWgSTlDgns4mDzq yOhzO0uxk8cQPb/bEN7LBPEOZHEsX36TCSc0rafeHFJOSryH5Tk3kQijXMkIHm5Jqb9W W7DAOZKoV9J3NT4ikUfqqqYtD3RXc24xsPh2R/t/2UDuMQJJhVu+BIShhORt0ZPkQQ0u X+5g== ARC-Authentication-Results: i=1; mx.google.com; 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 x26si10526261otk.325.2020.02.03.20.39.19; Mon, 03 Feb 2020 20:39:31 -0800 (PST) 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; 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 S1727192AbgBDEia (ORCPT + 99 others); Mon, 3 Feb 2020 23:38:30 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:52629 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbgBDEi3 (ORCPT ); Mon, 3 Feb 2020 23:38:29 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id D0B35101C051A; Tue, 4 Feb 2020 05:38:25 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 7C426DFAA5; Tue, 4 Feb 2020 05:38:25 +0100 (CET) Date: Tue, 4 Feb 2020 05:38:25 +0100 From: Lukas Wunner To: Alex Deucher Cc: Dave Airlie , Lucas Stach , Ben Skeggs , Karol Herbst , "Alex G." , Bjorn Helgaas , Alexandru Gagniuc , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , David Airlie , Daniel Vetter , Jan Vesely , Alex Williamson , Austin Bolen , Shyam Iyer , Sinan Kaya , Linux PCI , LKML Subject: Re: Issues with "PCI/LINK: Report degraded links via link bandwidth notification" Message-ID: <20200204043825.thpbqpz3ao7zqvlh@wunner.de> References: <20200120023326.GA149019@google.com> <8409fd7ad6b83da75c914a71accf522953a460a0.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 03, 2020 at 04:16:36PM -0500, Alex Deucher wrote: > AMD has had a micro-controller on the GPU handling pcie link speeds > and widths dynamically (in addition to GPU clocks and voltages) for > about 12 years or so at this point to save power when the GPU is idle > and improve performance when it's required. The micro-controller > changes the link parameters dynamically based on load independent of > the driver. The driver can tweak the heuristics, or even disable the > dynamic changes, but by default it's enabled when the driver loads. > The ucode for this micro-controller is loaded by the driver so you'll > see fixed clocks and widths prior to the driver loading. We'd need > some sort of opt out I suppose for periods when the driver has enabled > dynamic pcie power management in the micro-controller. Note that there are *two* bits in the Link Status Register: * Link Autonomous Bandwidth Status "This bit is Set by hardware to indicate that hardware has autonomously changed Link speed or width, without the Port transitioning through DL_Down status, for reasons other than to attempt to correct unreliable Link operation. This bit must be set if the Physical Layer reports a speed or width change was initiated by the Downstream component that was indicated as an autonomous change." * Link Bandwidth Management Status "This bit is Set by hardware to indicate that either of the following has occurred without the Port transitioning through DL_Down status. [...] Hardware has changed Link speed or width to attempt to correct unreliable Link operation, either through an LTSSM timeout or a higher level process." See PCIe Base Spec 4.0 sec 7.8.8, 7.8.7, 4.2.6.3.3.1. The two bits generate *separate* interrupts. We only enable the interrupt for the latter. If AMD GPUs generate a Link Bandwidth Management Interrupt upon autonomously changing bandwidth for power management reasons (instead of to correct unreliability issues), that would be a spec violation. So the question is, do your GPUs violate the spec in this regard? Thanks, Lukas