From nobody Sun May 24 19:33:16 2026 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 292A9387594 for ; Sat, 23 May 2026 11:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779536766; cv=none; b=Z2sDdigtf/6ir5HLHHYQj7PmqcJUXRw+hKjTvp1Cut5Qn1BY964nD6AZFNqcICwppS3P1UIewIw1YE4xZJIVVulHiXsLHUwava9ublsR+z4xEYC97mJPQYTn86F8FGh2pZKlmsH8uqpohISL9FXtfxHHY9PAP9GyaFOy3ssiqi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779536766; c=relaxed/simple; bh=yBON9tWIQBEpWZ0U6+Tr/ldzLucIgp1lWhe3D1SSvkk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bwh7Q4JtG8p4dUgXF4dOgobA/7A5IQmlcKJOky/BBkcUF9Ym5Ec5kAivUWpA2Ygi+jJi4udAecuO1vICUQf0l6zjHaTh/i6wk8atthnVuBwHjdBmZmi1vI+brP095tzU96MyBkd/SPh3SFqcBU3ZKRNAB46R2nk+nZqO/XQn7ew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=tHgaj6lV; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tHgaj6lV" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-911449d9d03so953653185a.1 for ; Sat, 23 May 2026 04:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779536764; x=1780141564; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mwL5MV6S1AMPCz9BF2d2Kabj5bce+BBSzVoHTJ5nQQw=; b=tHgaj6lVR12cZX2BOP4qeXls4escVrucHhMoOBdohL6aDQGTaUdq03vgP6eAJ/4CXv JzIjGS1z9KWnhDMFS2LmngwttYZgXWSpopHRZHfSxy/QLqOVbBpjqY4ku3RXPxyguo2N NumtohuDg7IxgrjZ1H5gpCalqYXzPrN4fE136OzXXhD/mECfa5uWx4J4T3YBYnvVDkhS 03qeQbMCOTzTDwhEqVijRUixDJpH3Sn9tMpp1iOwRvoXKELNE0tMfz7xJNyUg+XL0C0J wrLodO+zgGtGvbmOROJpMsvgl5J//5TSP5yQ/10JJrb9X7IyN1UhAMcEehCMRI8H6+04 o/Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779536764; x=1780141564; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mwL5MV6S1AMPCz9BF2d2Kabj5bce+BBSzVoHTJ5nQQw=; b=fVuP5AkSmVZhvHkrAda4s2yu4zGx4z3IzHlrZHqSG+OvYaqxNYj9Ii0ARvnr2WPTX0 luUQE23hO8Wk4oB64vyFmtXrlMcxnr77utLrgClfr01sW4UdNKsKRjItjtDxxoDluF7s Q2riAY8sZ+LdUV2biqSOTBaytiHXRE7Uw37oyWd+4L3i/BxAaFGki8rMS+719LCs2jyr /b2iPIeVb/ZrpPJp3QmTGPfU8Aa051nZM1WIyytQfsptqw7T4HUyJN+fzWNj+22G0xeR g5kez83xGuLsBpkFhEXCuLpXdNH0+E1ksMdZCN6F+sHEO3C6SpwxGGU/k8j5P3J1Twt+ peyA== X-Forwarded-Encrypted: i=1; AFNElJ+pj8H5yP5EShrFZPhqSDmyHKVVsxp8ZRF7wGYOsv5t7Su0NUqOILUubtgf9mslHnm0MBFU3nkPYixgbVo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9FMTo+YZYjyr+mSpQ06CES22+JdMZWvccl5r9W7ElQL/Enbie H3SVF2NleOyK1Rn+5Ch/xfejlDpmajvU9qJKFeS+GZ2bo3z2wr1KjTz8 X-Gm-Gg: Acq92OG/PQHytm8AOdtIRqidk1vCdw8zQ0nGTFpREKgfTcAdnabgSyoMrsbx4YEQv+K n6zDqCLmInuptuJ+XxOrqRiPa9365kTHBXh7o2yDwipwbUWt89+Bdkcid3Rry3NAm0tmTMjRBBJ Bu6wAoU9gj87MJnNK/G+PD4Dz4Q/BlkuU3sBdp0n/nOMq6VgMeeD6SYlVomyLHwXS7meMENYX6o nN+g9kns0NpBJkg0SCyeFsCBFyRJEeE5BkxxyklwJxVj5SI5C20SrYEgwxLaqvpIB4ix3SnuYi8 X9kbeEUTKLbrFtD4roQ2cfXNZjWKNTw3EBaFO7gWJAG3HJMhsy+ChZ4WNhPWgPIo/CrRE1rf7Np r55qIskUVS3GT/Tgz2xJNsQand8noJkQpLTQeEuR0UHyeD3kRd9tcHOqy9Qwtf3xkOpp0bKqhKv r1HnjS9LL2i7kAMLjC7Dz5N/cQ+l7rGMmvLjwsTP1sJOIULBZO5EFnP9mLAuxpxfat046RO7TTa RL2mc9i1urWjjWvPSG5 X-Received: by 2002:a05:620a:630f:20b0:910:bb22:d426 with SMTP id af79cd13be357-914b49a0b5dmr791369485a.33.1779536763899; Sat, 23 May 2026 04:46:03 -0700 (PDT) Received: from mobile5 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-914bba1b49csm376914985a.44.2026.05.23.04.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 May 2026 04:46:03 -0700 (PDT) From: Mike Bommarito To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme: log when APST skips a state due to latency cap Date: Sat, 23 May 2026 07:45:52 -0400 Message-ID: <20260523114552.101452-1-michael.bommarito@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nvme_configure_apst() silently skips any non-operational power state whose exit_lat exceeds ctrl->ps_max_latency_us (set from the default_ps_max_latency_us module parameter, default 100,000 us). When the kernel skips a drive's deepest non-op state for this reason, the user gets no signal that anything happened. This is a frequent gotcha on Intel platforms that depend on the drive reaching its deepest power state to allow the PCIe root port to enter L1.x and the PCH Southport to power-gate, which in turn is a prerequisite for the platform reaching S0ix during s2idle suspend. Add a dev_info_once() at the skip site that names the state, prints the actual exit_lat versus the current cap, and points the user at the module parameter to raise it. Using _once keeps the line to a single instance per controller; users that want to see every probe event can still enable dev_dbg. Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Mike Bommarito --- Build- and boot-tested on Framework Laptop 13 (Intel Core Ultra 5 125H) running Linux 7.1-rc4 with this patch applied, across multiple boots over three days. No regressions observed in NVMe probe or APST configuration with the installed WD Black SN850X (15b7:5030). Design context: the conservative default cap and the per-device-quirk mitigation were discussed in 2017 at https://lore.kernel.org/all/20170606095454.GA13569@infradead.org/ and retained. This patch only adds observability for the silent-skip case; behavior is unchanged. drivers/nvme/host/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c3032d6ad6b1..220e844e852c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2943,8 +2943,13 @@ static int nvme_configure_apst(struct nvme_ctrl *ctr= l) continue; =20 exit_latency_us =3D (u64)le32_to_cpu(ctrl->psd[state].exit_lat); - if (exit_latency_us > ctrl->ps_max_latency_us) + if (exit_latency_us > ctrl->ps_max_latency_us) { + dev_info_once(ctrl->device, + "APST: skipping non-op PS%d (exit_lat %llu us > cap %llu us); ra= ise nvme_core.default_ps_max_latency_us to enable\n", + state, exit_latency_us, + ctrl->ps_max_latency_us); continue; + } =20 total_latency_us =3D exit_latency_us + le32_to_cpu(ctrl->psd[state].entry_lat); --=20 2.53.0