{"id":2223167,"url":"http://patchwork.ozlabs.org/api/patches/2223167/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260414-l1ss-fix-v1-2-adbb4555b5ab@oss.qualcomm.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260414-l1ss-fix-v1-2-adbb4555b5ab@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-14T15:59:40","name":"[2/4] PCI: Indicate context lost if L1ss exit is broken during resume from system suspend","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"19f44eb8386e9be17cd80cbad61d6be3d2b892ab","submitter":{"id":91277,"url":"http://patchwork.ozlabs.org/api/people/91277/?format=json","name":"Manivannan Sadhasivam via B4 Relay","email":"devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260414-l1ss-fix-v1-2-adbb4555b5ab@oss.qualcomm.com/mbox/","series":[{"id":499863,"url":"http://patchwork.ozlabs.org/api/series/499863/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=499863","date":"2026-04-14T15:59:38","name":"PCI: Introduce pci_dev_suspend_retention_supported() API","version":1,"mbox":"http://patchwork.ozlabs.org/series/499863/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223167/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223167/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-52508-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=AkS2pQfu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-52508-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"AkS2pQfu\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw8Dg4LT2z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 02:02:27 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 9C16E3076DF3\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 16:00:14 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7F2093ED126;\n\tTue, 14 Apr 2026 16:00:12 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 54D9C3ED11A;\n\tTue, 14 Apr 2026 16:00:12 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPS id 334C1C2BCB8;\n\tTue, 14 Apr 2026 16:00:12 +0000 (UTC)","from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n (localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id 25C80F9D0D3;\n\tTue, 14 Apr 2026 16:00:12 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776182412; cv=none;\n b=lXRREoyBEg+p+N/d7BLnmggYBKpn7Kxsxxw27QwPJFnV4/HvVt02NAW0HnMmUn2b9/CKjdaePwelxOCNR9hcYKNubMJ78AU77LW5IkXVflNFDg6Hb77S6POsdZQDpuz1MF7nKISVCelSFHLH9DCCRuK5n2qXC071RQ8SNsWeXMI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776182412; c=relaxed/simple;\n\tbh=HWMbqwedOoMw8lw/15aldB8uIf8M+iftPYa/bgkZ12o=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=TxwdHNfvqdcn6cbF4PHq8UDWo9AU86xDDy6DhlESt//ik9RwHPe7n82fXs81IF4mveRV7v3jnarXjjZAMzoolKeppplJsfXFf6XvxB/SbebrkemoGaX9nee/18jokboZ8/ExBlOfonz4gDPVdeeDOVgReASHA8mUBTgZdxEshhU=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=AkS2pQfu; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1776182412;\n\tbh=HWMbqwedOoMw8lw/15aldB8uIf8M+iftPYa/bgkZ12o=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n\tb=AkS2pQfuVfK9IaoAzE3tAiWiZ57wZP3rJXnVYe7dQ5Yojf5adoXNCU5xnXgnTwy5L\n\t D7UDBJyXFVqcyAmWaLgSIMkaICr+Qm8mFKy8Fk5NuLUq0j/ZEaIJaMvITkqsxhW1wz\n\t 58590VHwI1AqGHgMm5shcPzo8u4axLZwou6yL26RRQ8pYAQUrW3e7yaLOE5bapapgj\n\t yphgvcIQKO5flR6JNasMcq67OOpR8gqikhus6PTlUoDHqlCZ6L3QU3smArEkfx0Rsb\n\t luhAX+M8cY5zwukxca11Fm2j1keVNTX+RGGzc0fWvkfBrjCn26tJJQCxubUgZyj/Uw\n\t DVnFUIXZbYW4w==","From":"Manivannan Sadhasivam via B4 Relay\n <devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org>","Date":"Tue, 14 Apr 2026 21:29:40 +0530","Subject":"[PATCH 2/4] PCI: Indicate context lost if L1ss exit is broken\n during resume from system suspend","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260414-l1ss-fix-v1-2-adbb4555b5ab@oss.qualcomm.com>","References":"<20260414-l1ss-fix-v1-0-adbb4555b5ab@oss.qualcomm.com>","In-Reply-To":"<20260414-l1ss-fix-v1-0-adbb4555b5ab@oss.qualcomm.com>","To":"Bjorn Helgaas <bhelgaas@google.com>,\n  Manivannan Sadhasivam <mani@kernel.org>,\n  Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy?=\n\t=?utf-8?q?=C5=84ski?= <kwilczynski@kernel.org>,\n  Rob Herring <robh@kernel.org>, Keith Busch <kbusch@kernel.org>,\n  Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,\n  Sagi Grimberg <sagi@grimberg.me>","Cc":"linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-arm-msm@vger.kernel.org, linux-nvme@lists.infradead.org,\n Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>","X-Mailer":"b4 0.15.0","X-Developer-Signature":"v=1; a=openpgp-sha256; l=3305;\n i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id;\n bh=LyQjngZpjyM7atFii62PC/2oWcdYdOsG7s31euB1g4g=;\n b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBp3mSJmlZhEN3RfjDf/GEGFtsvDX0Ll8oF+/ind\n omQnGB3tZqJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCad5kiQAKCRBVnxHm/pHO\n 9ZQPB/0TFauDo1bNl4OhfXKRCke7aoRExVdAT6cGff+51gC9NlEDUehXTYuzKL5aDTHYH3ze3Ev\n ff8UzBeyFVUlIkHbaYlWYXMsWfgsT9c+cFuKXMqflurzV6GJZWp6wfJGoEl91gbonS6TDmLwITa\n Auq6bnsaVRZULioqu2rI37EFXRDXcAZLL6CGooAg7SHcTBHs+08DXbUHuneegTd82hf+KOD81uY\n CoGr1SLR5WAn4VwxhvlFNQTPH5oPDwNj9kbNQrNtT/tLV1wUrSNbhtArNOVdkPJDGtFuRx35Muz\n OoYeVIpwIXc6uVTS5uNg88zL70+ulUzFTKjvoG118XKUHMag","X-Developer-Key":"i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp;\n fpr=C668AEC3C3188E4C611465E7488550E901166008","X-Endpoint-Received":"by B4 Relay for\n manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461","X-Original-From":"Manivannan Sadhasivam\n <manivannan.sadhasivam@oss.qualcomm.com>","Reply-To":"manivannan.sadhasivam@oss.qualcomm.com"},"content":"From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>\n\nThe PCIe spec v7.0, sec 5.5.3.3.1, states that for exiting L1.2 due to an\nendpoint asserting CLKREQ# signal, the refclk must be turned on no earlier\nthan TL10_REFCLK_ON, and within the latency advertised in the LTR message.\nThis same behavior applies to L1.1 as well.\n\nOn some platforms like Qcom, these requirements are satisfied during OS\nruntime, but not while resuming from the system suspend. This happens\nbecause the PCIe RC driver may remove all resource votes and turns off the\nPHY during suspend to maximize power savings while keeping the link in\nL1ss.\n\nConsequently, when the endpoint asserts CLKREQ# to wake up, the OS must\nfirst resume and the RC driver must restore the PHY and enable the refclk.\nThis recovery process exceeds the L1ss exit latency time. And this latency\nviolation results in an L1ss exit timeout, followed by Link Down (LDn). If\nthe endpoint device is used to host the RootFS, it will result in an OS\ncrash. For other endpoints, it may result in a complete device\nreset/recovery.\n\nSo to indicate this platform limitation to the client drivers, introduce a\nnew flag 'pci_host_bridge::broken_l1ss_resume' and check it in the\npci_dev_suspend_retention_supported() API. If the flag is set by the RC\ndriver, the API will return 'false' indicating the client drivers that the\ndevice context may not be retained and the drivers must be prepared for\ncontext loss.\n\nSigned-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>\n---\n drivers/pci/pci.c   | 11 +++++++++++\n include/linux/pci.h |  2 ++\n 2 files changed, 13 insertions(+)","diff":"diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c\nindex 211616467a77..e871cccf24ae 100644\n--- a/drivers/pci/pci.c\n+++ b/drivers/pci/pci.c\n@@ -2911,6 +2911,8 @@ void pci_config_pm_runtime_put(struct pci_dev *pdev)\n  */\n bool pci_dev_suspend_retention_supported(struct pci_dev *pdev)\n {\n+\tstruct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus);\n+\n \t/*\n \t * If the platform firmware (like ACPI) is involved at the end of system\n \t * suspend, device context may not be retained.\n@@ -2918,6 +2920,15 @@ bool pci_dev_suspend_retention_supported(struct pci_dev *pdev)\n \tif (pm_suspend_via_firmware())\n \t\treturn false;\n \n+\t/*\n+\t * Some host bridges power off the PHY to enter deep low-power modes\n+\t * during system suspend. Exiting L1 PM Substates from this condition\n+\t * violates strict timing requirements and results in Link Down (LDn).\n+\t * On such platforms, the endpoint must be prepared for context loss.\n+\t */\n+\tif (bridge && bridge->broken_l1ss_resume)\n+\t\treturn false;\n+\n \t/* Assume that the context is retained by default */\n \treturn true;\n }\ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex d9bc7ad4eaa4..860d8a774b51 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -658,6 +658,8 @@ struct pci_host_bridge {\n \tunsigned int\tpreserve_config:1;\t/* Preserve FW resource setup */\n \tunsigned int\tsize_windows:1;\t\t/* Enable root bus sizing */\n \tunsigned int\tmsi_domain:1;\t\t/* Bridge wants MSI domain */\n+\tunsigned int\tbroken_l1ss_resume:1;\t/* Resuming from L1ss during\n+\t\t\t\t\t\t   system suspend is broken */\n \n \t/* Resource alignment requirements */\n \tresource_size_t (*align_resource)(struct pci_dev *dev,\n","prefixes":["2/4"]}