Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1230884lqh; Mon, 6 May 2024 00:38:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhUAIVqQLvnfs0EqyU0Zpde3l4Lb3netZ1JpofMjsIGlGlA/vSSSoHDXn0RJMuuk86GExOS4SewFnNvwdIGIX3hR1okbP6QZKh779twA== X-Google-Smtp-Source: AGHT+IHOFnSzrOuyP7Q5rP8gXRg7XMK4pQZ0dgWilJD2U31GteH/WoqlnhpNUao30IzBiy5t9yrH X-Received: by 2002:a05:6a00:c84:b0:6f3:ecdc:220e with SMTP id a4-20020a056a000c8400b006f3ecdc220emr10019647pfv.24.1714981095151; Mon, 06 May 2024 00:38:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714981095; cv=pass; d=google.com; s=arc-20160816; b=aIvyOYxYozAbn9Ve2daBX8FgKotdw47hYYNRo+vQoL8RHzWz6pqsy+EykgEUxYjz4R cIUsn9uDrAoQZWc5J+o2ePUJMSEF30h6ANvnajzheAS3eqlgc/rf1GjQpso9hGCm02yn e1a4jBtT9LWBEJ9IuXw3wRcz90PHSh8w+hJLwEOirLqLEzWRLDVt1weEZXAUrI1VAlyo gX6BBmDX/BrNM8JSm32v4Duajecct61BDYOrSfQIlcMY+ytbp0TabHdfscVJD1OvSdac FvGNYtqExd/kkXLdBXfenplp52KmX1jGHLrh3p/ayBrC4xm7w38WB7j0prBEHAsj52vJ DoJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=6+TeggFIWTSxq0F/41mjmr91JOuCv+jZq1HPMNhfWNw=; fh=nGjmk/dTQqrN1C0iciC0NLFHhWYR+PgQELyAHtYmoKI=; b=JP/EmdZ1iyaZ1J9JJuVhbgon/iPgd92EIUoT/P/8L13qjr5nVoG0GyYFn7mY+2CqQc 10VETtrivNi1+T8m1UeQeh9UphshRkXqfetI65nTzy5DWyigrOhAWJXC/a+9qKaylyyd ai3QOfj41tWfUiSt2rqsTyqBNWZqM2w2M6O8ym9CNP0TX4UxbhqL3Tf/fQ3LkUBfFNK9 FEwjIpq5v0qneWgu2C7t+sWhqOoGY7JcXfPKgqEUx0aaT3hnL3VZL3lmU8tT8V3FSTs7 AIPpMQr1jGUAxfaJV6euiDS4JgO5k2vEYBql2RwOmyVlmNuqZsC+7dt7jQTFd/z0b6YM G9hA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-169423-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169423-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h190-20020a636cc7000000b005fd818edc65si7485923pgc.538.2024.05.06.00.38.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 00:38:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169423-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-169423-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169423-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 94FA328131F for ; Mon, 6 May 2024 07:38:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C295013C8E8; Mon, 6 May 2024 07:38:08 +0000 (UTC) Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF8ED18EA5; Mon, 6 May 2024 07:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.242.62 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714981088; cv=none; b=TD7e6TIv1r/0Dg9wkQ1NauuPUebXJPCfRexN104wItjJJQ2cirNG437kqyr96wl8VIBTlrzO+D3RbjQ/pBHwHiMtGJGpCHH27tIPhSXYlaf5QRBdvbk6QNiPhmacRwGrY8zRI6OWWj/QEPhpvbcEogD1bahyJainif6dS5d+Ndg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714981088; c=relaxed/simple; bh=R3LC5Ph+l1MAs++SI3snWMs2ree0ccbWLYXlPJJxWhE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OzBJeZ4aNiRLUvfe5dver/0G78S0k7yGS6Pjbd9XHFztZBQn4gZ0tN4eOhyPUz+xhXlqiGjUuoyOD41ySHyBPW2Ub7Wrtv6ZIg72u6qxzplTY7xLJIegg51ml/ozFb6riwdqo4ypmkXlhQxxF7WuIWCCRg+0YBZ3He3BkIvxCtM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=176.9.242.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id D2BB6101E6801; Mon, 6 May 2024 09:29:20 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 7D7191F80AA; Mon, 6 May 2024 09:29:20 +0200 (CEST) Date: Mon, 6 May 2024 09:29:20 +0200 From: Lukas Wunner To: Smita Koralahalli Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Mahesh J Salgaonkar , Yazen Ghannam , Ilpo Jarvinen , Bowman Terry , Hagan Billy , Simon Guinot , "Maciej W . Rozycki" , Kuppuswamy Sathyanarayanan Subject: Re: [PATCH] PCI: pciehp: Clear LBMS on hot-remove to prevent link speed reduction Message-ID: References: <20240424033339.250385-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240424033339.250385-1-Smita.KoralahalliChannabasappa@amd.com> On Wed, Apr 24, 2024 at 03:33:39AM +0000, Smita Koralahalli wrote: > Clear Link Bandwidth Management Status (LBMS) if set, on a hot-remove event. > > The hot-remove event could result in target link speed reduction if LBMS > is set, due to a delay in Presence Detect State Change (PDSC) happening > after a Data Link Layer State Change event (DLLSC). > > In reality, PDSC and DLLSC events rarely come in simultaneously. Delay in > PDSC can sometimes be too late and the slot could have already been > powered down just by a DLLSC event. And the delayed PDSC could falsely be > interpreted as an interrupt raised to turn the slot on. This false process > of powering the slot on, without a link forces the kernel to retrain the > link if LBMS is set, to a lower speed to restablish the link thereby > bringing down the link speeds [2]. > > According to PCIe r6.2 sec 7.5.3.8 [1], it is derived that, LBMS cannot > be set for an unconnected link and if set, it serves the purpose of > indicating that there is actually a device down an inactive link. > However, hardware could have already set LBMS when the device was > connected to the port i.e when the state was DL_Up or DL_Active. Some > hardwares would have even attempted retrain going into recovery mode, > just before transitioning to DL_Down. > > Thus the set LBMS is never cleared and might force software to cause link > speed drops when there is no link [2]. Is this an issue introduced by commit a89c82249c37 ("PCI: Work around PCIe link training failures")? If so, could you add a Fixes tag? I might be mistaken but my impression is that we're seeing a lot of fallout as a result of that commit. Thanks, Lukas