Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp1292667rbe; Fri, 1 Mar 2024 09:36:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpVSQxJQxQDFUWzG+kW2SW0i7irGnmDnf/Id36nGUrIt/iYay+wn4/iF40AZYhj67GLcYC2c722dvu7JIW6JRSZg68NG4lbmYs2JPrUw== X-Google-Smtp-Source: AGHT+IGsHMIXd+ZFPyLjO7gA29pEyr0RWd1EiVhXRbmRO/HOE2tyoZXn79Y816WbPdCbmgyNyHh0 X-Received: by 2002:a17:906:4f0e:b0:a3f:357b:d995 with SMTP id t14-20020a1709064f0e00b00a3f357bd995mr1659914eju.1.1709314604254; Fri, 01 Mar 2024 09:36:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709314604; cv=pass; d=google.com; s=arc-20160816; b=nxzPSoBhXPojHYC+P/DFeZmDGKtW9f53nSeB+mK+Sfl2f121DIzDo5e4f0wD7XOg2m qCkS1e2E5lcKQFkDRFWsVV2PoFIMSxRc4qQFUeuOd1806J0u5TtsbKmjx8evqJVeEEsq cDLudSpEPNDFQZJpTOHHiV9HpTPPCh5fi85yADXGQm6UDklBtBOa2+kdWBVHcTWmYuH7 p0zQgRqhkTErUdvqFIZlwBj92wxqpxRLFD+CoSeCwPaJr8f9njOwvBnV8C/gZ+tI6sNi TckemqOhVcOM1aQzBsfuZ1Ylv/KEhnDlM4v7fdbCSohlfFxNCRFdKTNy3nehQSzsWLt9 Kdyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=n9KogBdCDX8wlzQ94ly7DW/8V3/z32QF9GKWD3vHJ6c=; fh=P59FCMouOCp6CMNGkFsCDI2QbWiTgzS/afWZDHIiE8U=; b=LoBCUpHO1pLZmrWWhxztF9WYRGHhEO4Rq5aZ/lofL3tdYX3URWM2nLoAMscRtHInki VPSrzd5yDW0BTXCRdgKRKzIjBWCe9sQ+R7jTAeey7GxrYn1Z4/e4B0lKZwWZdNcAqe8C FCEe3uTZ408p3kMiR+QAdmfAin3YYKAIhLRO8gx+q/pMe2R1WJZ9VuF83PF/tMz1wXeQ yt6EtGsyja9QkbVs0O1z/Ua5Ebc6cjNUHyc33WDHi7sbI77kjTLYGz5UhPnuPyXtvLMV HAcTJdTUOkqepAIGZBk2cTZZmmBzFbcBFAZ/4dT4UjQuibfZaj91K///Mm4AVbpdE9Q7 p46A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJS1yyVt; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i20-20020a170906265400b00a4430d3ccd8si1602795ejc.400.2024.03.01.09.36.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:36:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJS1yyVt; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-88602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8B0971F22798 for ; Fri, 1 Mar 2024 15:07:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 035B76A8C3; Fri, 1 Mar 2024 15:06:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GJS1yyVt" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 9DD543987B; Fri, 1 Mar 2024 15:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709305616; cv=none; b=jZlAZoeKBqOtLwS7HwYdi/j3VF7Zh05J7Roz/qRu+aJDNG9x1VjfAoveZtRzrC/8FGeGS8QvagAQiA9yPV01oorwjdL12w0CT9ViurZbrn2qdney7wnM3dW8VcuM01WjNVp6sFuUK0tCPiXFkoF/oSf3qDCFwgVC7MFDDWGyawE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709305616; c=relaxed/simple; bh=klUhEQf+5iLq5itvvFsd/lwIyvrv5Jo42w7y/66wJTE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=deL0wUW9IAUW6II5xwnSxYftEf4AbAbLbeejihdcPtxdOMqPL5DTQRzA+tKq3dbm/G5V/Dln4iDvp1A6dEjeSUm3Gs29oScQjOf6IAOwiEgMebh+sZhvWFXg5UIAd90BqVILBgAbyBy6nt55TCH6m+hppjiDx0X4jrgi+WtKKWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GJS1yyVt; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709305615; x=1740841615; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=klUhEQf+5iLq5itvvFsd/lwIyvrv5Jo42w7y/66wJTE=; b=GJS1yyVtCuZjQOntjEmzmoBQRtwG8TSYApn9cRqAEm8xIdsV+Ec9K1C7 ngm+aKpIfkTFw4r5+QekX1yqOkOEX4Xut+Mt6fBU8XaWJqkFqQ/AxaEgS 2GvX198Fo9ShLT8N+nlr6ouP1Qfw1p75ewgzzvWeHPOS/3Q6CdUgg760T aTLDENhsrtBmhhdyNbwItLxUdSbvldxahfMXHTtebBNpY7KpKcnFFFNIR aeT/WDxkchMSB0j2ZgMRrj8xzqVJoIJ5TxcHh7snaKzdkYVljyTLkCuwe wO+dpegsBoKftJT3ihE+fSC0bp5LExqtw3xF5K9+1DdMLY968gCkGeTOy g==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="7659659" X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="7659659" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 07:06:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="8279225" Received: from ybaron-mobl.ger.corp.intel.com (HELO localhost) ([10.94.249.66]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 07:06:51 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: "Maciej W . Rozycki" , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 1/1] PCI: Use the correct bit in Link Training not active check Date: Fri, 1 Mar 2024 17:06:41 +0200 Message-Id: <20240301150641.4037-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 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=UTF-8 Content-Transfer-Encoding: 8bit Besides Link Training bit, pcie_retrain_link() can also be asked to wait for Data Link Layer Link Active bit (PCIe r6.1 sec 7.5.3.8) using 'use_lt' parameter since the merge commit 1abb47390350 ("Merge branch 'pci/enumeration'"). pcie_retrain_link() first tries to ensure Link Training is not currently active (see Implementation Note in PCIe r6.1 sec 7.5.3.7) which must always check Link Training bit regardless of 'use_lt'. Correct the pcie_wait_for_link_status() parameters to only wait for the correct bit to ensure there is no ongoing Link Training. Since waiting for Data Link Layer Link Active bit is only used for the Target Speed quirk, this only impacts the case when the quirk attempts to restore speed to higher than 2.5 GT/s (The link is Up at that point so pcie_retrain_link() will fail). Fixes: 1abb47390350 ("Merge branch 'pci/enumeration'") Signed-off-by: Ilpo Järvinen --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d8f11a078924..251a0c66c8cb 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5016,7 +5016,7 @@ int pcie_retrain_link(struct pci_dev *pdev, bool use_lt) * avoid LTSSM race as recommended in Implementation Note at the * end of PCIe r6.0.1 sec 7.5.3.7. */ - rc = pcie_wait_for_link_status(pdev, use_lt, !use_lt); + rc = pcie_wait_for_link_status(pdev, true, false); if (rc) return rc; -- 2.39.2