From nobody Mon Feb 9 09:01:06 2026 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 2426B1362 for ; Sun, 26 Jan 2025 05:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737867822; cv=none; b=VLhUEQckaqu0D4W2i6M/CATiSbHys2fxjmm/pSVmn5R69eHF3J5bZ56eXS8BPi6SgJw7bxxzmLmsguUOwMAh6KSmU0B61UMDbAR0IxFVDJhpvRaltqPcMo9dGKTJYdVL1knd4X0w6cs8m2Jwr0LOyEE/t5KHPsotAgdGbsJNlZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737867822; c=relaxed/simple; bh=JfHOYZnFA3KBsT4SK5jYSH18gNxwL2rfOyCoH4zZmt8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YOhmsuS1XDWQDOqRAaxCC7iJGfPkxd5OREyage2qPZEF+y8gcM9DrivDAnztY0XYCzc9A0ObQ3b6pnzFpWcELVzcEFMjYhdP8Kr7XDR/1oQXVMTWMV6z+GBCRaIBEweodV0xc3xyfvNK6aJuQXxR8MfbSGByfAzBmZ5N9e7sp8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RLj/ZRSX; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RLj/ZRSX" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21628b3fe7dso58397515ad.3 for ; Sat, 25 Jan 2025 21:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737867820; x=1738472620; 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=2LmU0AhR1QcRCvDtrftLVzrBgzUIjowOlRVSyrqp0KA=; b=RLj/ZRSXwoIYGdajTmDF1x5Ivb8d1xcR7PA0ghMkyFRYI1VoneCWGQ0t2zXf6aWir4 N4mAimKI7s2auwrghn8XMCsjCmS6S3tE+VqgviDxN/9KSvw0yNdnPuQWdMfD/gFnChj2 anwqDukD7s9p33N0RdvOVYbiZgj3w1cwB5lJHlBT/Ty1K3kk8Xz4ppj7rDGuzsYQ6HGI 1ztdx8vq8r273lNAD/sWWtCSgkuVTHZnf7JP/SllKwFQBI4fJzc4vNEt0xNdlmZdsLtw Zwv6KhZXNDMpbAf/Jrs7CJo191E3+cWbroujEYcfYslayBUrX0jmQQ35wrkNAEzV7Z9S ScZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737867820; x=1738472620; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2LmU0AhR1QcRCvDtrftLVzrBgzUIjowOlRVSyrqp0KA=; b=FTTMOtH7hi5zTiEsSDtvn3SMuUccCGXE+jV5ICV8x4RBmcoqE62T6Lum5RGWRGdzvV J+ve/kHBMP/qUgdBm+GCT9eYrJ4fIGK3G0BbcwOd9QgSJWrz/xT4YdgDMw0IoYdoDVCf 167D4Tymk+WJHgIPaMUROLf/Bao3QfbWK64Trczc1Kg7qqzMX03lVQsxpfddI6o4dGpb s2K9gwodBPDomwLR9Wt6gfnWeVNuLv1AgDxYp89OyX86JiZLMxp1asUA5ZIhQAdLY/s0 OazzeI37FtP2iRDdbKjoIvmLOkGTZnJvsfNKxcJLynPSfdGNprXU20UP6OtCwMWXlwKM J9PQ== X-Forwarded-Encrypted: i=1; AJvYcCU/rSb7Vt2SwRyZicSUePkqgnvycVYY/C3lDHbRAIvJDd44E/Q9w/uNd9JgtqgG4dBGdCm9N/5ZDjN877o=@vger.kernel.org X-Gm-Message-State: AOJu0YwW0uEnr2oxoInFF350Nj11w02w8ri7v8oDFZpiGl7ls6Fe/wi2 SmWbQxqaP3QcSuzvFJfrgqRWFaVNfU1HLnNhO8tQ1v6PQqr5hDQpYr0hH8AKYA== X-Gm-Gg: ASbGncuFNHCfYRImyiiTFjsYafBxNwmlEw7swUgKYfv54QKsdgMG231zlFGCG5pow7w Ab9oXgGKZD9hQlvETDQ4bgBv/irSKBhujbvdZ34wKJywIuE7W9cwB95ugaPcjhMGc1FNH1m5JMD asYAUFo6NMgUIrLlGwjKnUXJZ+DpZnCGBAkndUb4uYzub0fAl9Vt1j3f9VlRFI1aUGa4cnlLlda G5J9HPCF1imQXaChhgRsTz/sFvYAT4TdCh7zr3+k4dH/9/bBL93KnIjrTTOs7WlwIDo80g7ht1x OEYG9IvnkMXgsx1+6fzrkgKOVzHOW4M= X-Google-Smtp-Source: AGHT+IFHEyHxX7irul6vkLjKxGN++SAL9AbT8cYCTv6RzUwpK3beUMVv7CAA6YJTgynH06wxyLRoXQ== X-Received: by 2002:a17:903:11cd:b0:215:b5c6:9ee8 with SMTP id d9443c01a7336-21c351d3065mr477220725ad.7.1737867820274; Sat, 25 Jan 2025 21:03:40 -0800 (PST) Received: from localhost.localdomain ([120.60.50.31]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da3d9c5bfsm40747515ad.37.2025.01.25.21.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2025 21:03:39 -0800 (PST) From: Manivannan Sadhasivam To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, andersson@kernel.org, konradybcio@kernel.org, rafael@kernel.org, ulf.hansson@linaro.org, helgaas@kernel.org, Manivannan Sadhasivam Subject: [PATCH] nvme-pci: Use NVME_QUIRK_SIMPLE_SUSPEND for Qualcomm Snapdragon 8cx Gen 3 platforms Date: Sun, 26 Jan 2025 10:33:09 +0530 Message-Id: <20250126050309.7243-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 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" On these platforms, power to the PCIe bus is not retained if the SoC enters its own deep low power state called, CX power collapse state during system suspend. Once the SoC resumes after going through CX power collapse, all the PCIe bus state will be lost. So the NVMe devices on these platforms won't resume properly, rendering the machines useless until forcefully restarted by the users. To workaround this issue, the PCIe controller driver is keeping a minimal vote on the PCIe-MEM interconnect path in its system suspend callback current currently. While this gives a working system suspend, it also results in increased power consumption during suspend as the SoC never enters its low power state. So with this change, the workaround can finally be removed. Also it should be noted that the actual fix to this issue lies in the PCI/PM core. But currently there is no such fix exist as of now and the consensus to reach it is also taking a lot of time. So use this quirk to allow users to save battery life on these platforms until the PCI/PM core comes up with an API that tells the PCI client drivers when to turn off the devices. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Ulf Hansson --- Hi, I'm sending this patch as there seems to be no consensus so far (as been discussed in this thread [1]) in coming up with a PCI/PM API that tells the client drivers when to safely turn off the devices. Since coming up with th= ese kind of generic APIs are bound to take time (I do intend to pursue), it mak= es sense to allow these platforms to make use of the existing NVME_QUIRK_SIMPLE_SUSPEND quirk in the meantime. Once such API is upstreame= d and used in this driver, this quirk can be reverted. It should be noted that this CX power collapse issue only exist on the plat= forms based on the Qcom Snapdragon 8cx Gen 3 SoC. On other platforms, it is a mor= e of a policy decision to decide whether to shutdown the devices or not. And the= se other platforms can wait for the generic API to be made available by the PC= I/PM core. [1] https://lore.kernel.org/linux-pci/20241118082344.8146-1-manivannan.sadh= asivam@linaro.org drivers/nvme/host/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index e2634f437f33..c52dced952a1 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3162,6 +3162,16 @@ static unsigned long check_vendor_combination_bug(st= ruct pci_dev *pdev) if (dmi_match(DMI_BOARD_NAME, "LXKT-ZXEG-N6")) return NVME_QUIRK_NO_APST; =20 + /* + * Qualcomm Snapdragon 8cx Gen 3 (SC8280XP) platforms doesn't retain + * power to the PCIe bus after entering low power CX power collapse + * state during system suspend. So shutdown the NVMe devices to have a + * working system suspend on these platforms. + */ + if (dmi_match(DMI_PRODUCT_FAMILY, "SCP_MAKENA") || + dmi_match(DMI_PRODUCT_FAMILY, "ThinkPad X13s Gen 1")) + return NVME_QUIRK_SIMPLE_SUSPEND; + return 0; } =20 --=20 2.25.1