From nobody Mon Sep 28 13:17:46 2026 Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69377472528 for ; Fri, 21 Aug 2026 10:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787308351; cv=none; b=ZxRqYFBy1N5Tvpy7lOYKYAdDchy3LiK4K6uqy5Rgv7DJOBZnLjXoTm/LJi5VAsBy1IG3zMiRd/BqIMK4tUe1h3TIntP/AF+Scv2Kp6YXVGq1TSM3kyyD17tyCSvZ351spEoip+8YOmZ9sMNq6diiv7D+PP6AyICjyuCyLwyj7SU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787308351; c=relaxed/simple; bh=DEtnr+b9HaHk7PxBKBvVrNRgKvE2vE7tn4UqesELAjU=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=MOTmjp/TusARQDxuDWJv03vQ9K5Y+jzzCxUH4h79XkwnMjwpx7Py5hlXnOUe4jkhCGKR9bJdhEkdEupIbR0CnJtpPfB6QwhiT9PE+lA2S787j1lINrqCRc1ZJUzV4xLILlapNueSypcAVfueCpkal9zwYdVR4TD/lMx6yx1kiOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aniketmaurya.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gWua+S9W; arc=none smtp.client-ip=209.85.210.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aniketmaurya.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gWua+S9W" Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-84c4cd31b51so2329675b3a.0 for ; Fri, 21 Aug 2026 03:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787308342; x=1787913142; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3dhvNT9qqCp6MpIDTd8WAvQoo9257Xa/PWTZDK4wnb8=; b=gWua+S9WgIqBvoSntp/MeEDbMpoaATMy1hSQMwrtCJNr6NgG8AD7QsYR9At4i5qKso 0tGLS9OsVTd12PYWSTVCScu+3THuaGr9ZsI9QQi2ERLA78EJvjWSHlthKHAk8MLjZkv/ 2T3BureSCukEsYz5S1SgTm2x7cP2ZcY/FQgmb8seaTfVyybp115OlezL1JZuKgv7tlQQ S9oe2D6GDKqy8UQijDwhA3n/mQ8L6HEYYNKNbR/KCYwKl+DALcL3HovuyhMNANtzKNve SSopkYpv3S17Nj0bphPSrNberUWi1JSyLCnvA0PylDyqDp7eymdBgXnBYdYF6v3pCV8q lqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787308342; x=1787913142; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3dhvNT9qqCp6MpIDTd8WAvQoo9257Xa/PWTZDK4wnb8=; b=QWD8mF9/VqA+QKh3tkRbzkkIj1GVDH03icRY80XTc0TQJm36YTvlOSGKbPxBZAALwt z3ITqzJZIS1bD2ewpKcW2ftOMfUzzRLa+5cDZD9MOfUQunSUNwh8uPnhorOm539ExroG Z/lYoZo8ta0s9IOF7ySghkohqr2l/JwFiC1iLaff0ynG/k9YG5S5UWxDSj8J5odG7zX6 4ao9+/671g2/8vEABXJh0KoHksPMPdQScEZ842MfULo1Wj0m5Q6KTQmfOIymCTqfs3yo 5u+dWH/sLiG9jo3tC05C9Bb98bF+ZeXn7ugKlwrsfq27D0FVfUOvSCozaJDBfczNnYfm G2Tg== X-Forwarded-Encrypted: i=1; AHgh+Rq1J6ma5lZsg+xAMsirUBEixu2lIw0SJkYeKMIwkbcGhRFIufm09KTtN1I9SLMiFC2KmHnylq4jzYtUpaU=@vger.kernel.org X-Gm-Message-State: AOJu0YyQXaJhCgPtQwZgnZrNT11bF0ZGke0UPdAtBciLTPOj9hYzACPm Am/ZuW3N49fC8qmTknuhfgWoSDcouSu0XP/Oq0Rb+O2Ey7T0HW9mUIxxiJcl/YOYt36C7VtHXbe CBbTfDt4aPeM7kSbF6xO1+pmT6GTAqg== X-Received: from pgnb1.prod.google.com ([2002:a63:7141:0:b0:cc1:58f8:d2e7]) (user=aniketmaurya job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d49a:b0:3c3:750f:3cf9 with SMTP id adf61e73a8af0-3cd14f226bamr18992470637.11.1787308342414; Fri, 21 Aug 2026 03:32:22 -0700 (PDT) Date: Fri, 21 Aug 2026 10:32:14 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.766.g2966f0265a-goog Message-ID: <20260821103214.2049218-1-aniketmaurya@google.com> Subject: [PATCH] PCI/ASPM: Clear L1SS capability when L1 latency is unacceptable From: Aniket To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Wunner , "=?UTF-8?q?Ilpo=20J=C3=A4rvinen?=" , Manivannan Sadhasivam , Krishna Chaitanya Chundru , Manu Gautam , Ajay Agarwal , Aniket Maurya Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Aniket Maurya pcie_aspm_cap_init() initializes link->aspm_capable from link->aspm_support, which includes PCIE_LINK_STATE_L1SS (L1.1, L1.2, etc.) if supported by both ends of the link. pcie_aspm_check_latency() then evaluates whether the exit latency of the link exceeds the acceptable L1 latency advertised by downstream endpoints. If the latency is unacceptable, it clears PCIE_LINK_STATE_L1 from link->aspm_capable. However, it does not clear PCIE_LINK_STATE_L1SS. L1 PM Substates are substates of L1 and require L1 to be supported and enabled. If L1 is not capable due to unacceptable exit latency, L1 PM Substates cannot be supported either. Leaving PCIE_LINK_STATE_L1SS set in link->aspm_capable when L1 is not capable causes: 1) aspm_ctrl_attrs_are_visible() to expose L1SS sysfs control files (e.g., l1_1_aspm, l1_2_aspm) even though the link cannot use L1/L1SS. 2) pcie_config_aspm_link() to unnecessarily invoke pcie_config_aspm_l1ss() during ASPM configuration. Clear PCIE_LINK_STATE_L1SS along with PCIE_LINK_STATE_L1 from link->aspm_capable when L1 exit latency is unacceptable. Signed-off-by: Aniket --- drivers/pci/pcie/aspm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 172783e7f519..38eb7b1e2377 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -666,7 +666,8 @@ static void pcie_aspm_check_latency(struct pci_dev *end= point) latency =3D max_t(u32, latency_up_l1, latency_dw_l1); if ((link->aspm_capable & PCIE_LINK_STATE_L1) && (latency + l1_switch_latency > acceptable_l1)) - link->aspm_capable &=3D ~PCIE_LINK_STATE_L1; + link->aspm_capable &=3D ~(PCIE_LINK_STATE_L1 | + PCIE_LINK_STATE_L1SS); l1_switch_latency +=3D NSEC_PER_USEC; =20 link =3D link->parent; --=20 2.55.0.766.g2966f0265a-goog