get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2230068/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2230068,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230068/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260429-d3cold-v5-5-89e9735b9df6@oss.qualcomm.com/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/28/?format=api",
        "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
    },
    "msgid": "<20260429-d3cold-v5-5-89e9735b9df6@oss.qualcomm.com>",
    "date": "2026-04-29T06:42:27",
    "name": "[v5,5/5] PCI: qcom: Add D3cold support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d5fa83c48b3aab3fb29da616b7ea3589fc858ee9",
    "submitter": {
        "id": 89908,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/89908/?format=api",
        "name": "Krishna Chaitanya Chundru",
        "email": "krishna.chundru@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260429-d3cold-v5-5-89e9735b9df6@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 502001,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502001/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=502001",
            "date": "2026-04-29T06:42:22",
            "name": "PCI: qcom: Add D3cold support",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/502001/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2230068/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2230068/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53373-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=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=QettX4S0;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=Q9Aj5z7/;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53373-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=\"QettX4S0\";\n\tdkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"Q9Aj5z7/\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=205.220.168.131",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4g57CY032qz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 16:47:37 +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 A70A830D8BB9\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 06:43:05 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7A7BF38E5EF;\n\tWed, 29 Apr 2026 06:43:01 +0000 (UTC)",
            "from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\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 4D74338F25F\n\tfor <linux-pci@vger.kernel.org>; Wed, 29 Apr 2026 06:42:59 +0000 (UTC)",
            "from pps.filterd (m0279865.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63T3YbMS017747\n\tfor <linux-pci@vger.kernel.org>; Wed, 29 Apr 2026 06:42:58 GMT",
            "from mail-pj1-f70.google.com (mail-pj1-f70.google.com\n [209.85.216.70])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4du1eeabc9-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Wed, 29 Apr 2026 06:42:58 +0000 (GMT)",
            "by mail-pj1-f70.google.com with SMTP id\n 98e67ed59e1d1-35da86144daso11794146a91.3\n        for <linux-pci@vger.kernel.org>; Tue, 28 Apr 2026 23:42:58 -0700 (PDT)",
            "from hu-krichai-hyd.qualcomm.com ([202.46.23.25])\n        by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-364a0303d59sm2021414a91.15.2026.04.28.23.42.52\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 28 Apr 2026 23:42:57 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777444981; cv=none;\n b=StvgPwlXB4yD3GdL8y4k+9aFgwOAnnZ1/WQKzBuWLAHibOtzev4cblst6G1ChkE8QCFETVp/PR7oNIm+b4KNKoQpGdJSoKCe04rddQ0gBAlfxns/omq1g7sHKPglIyNBbUDk/IhPcQuwid0DUbeeOAJJ+BnADlpCbAo+Esr7b7E=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777444981; c=relaxed/simple;\n\tbh=pA76AmsNQb6QnqOiWK09b1zUzJDidnd19LIa2CcRAH8=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:\n\t In-Reply-To:To:Cc;\n b=j3QSG04blXCqp1Q55zOFkbRNNEVm4bRYxq3RmDrebjw8nlbx26L8QX6Fivawt3hD9oh1pIi0Rpaga2wGUNW/vTlhWDOnzTkdg1jRt3O7Q4PabvEPONznGl2V7HhEhgMi+yMXlqzLK2MP+VDkIJwDn0NY/1q5BU066hoao/ppBHw=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com;\n spf=pass smtp.mailfrom=oss.qualcomm.com;\n dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=QettX4S0;\n dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=Q9Aj5z7/; arc=none smtp.client-ip=205.220.168.131",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:content-type:date:from:in-reply-to\n\t:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n\tHq//0MaTtB+D8Slz74o3QINBfe6mU8ByJ3ZjSrdZlow=; b=QettX4S0iLWjYPHi\n\tFTry+GOYf9EN4MCZS21DDK6lWwoeIaVCrqaYjhb12u1AuZHfDrJfpEGJF3H157+u\n\tTdRZUWD2xCLSIDpx+d0JGThXImnkN1LzSrY6sPV2Nqfief6hKiPeF8lOYgLboWgS\n\tF/39v47nnF9vgdFRT9bcq2mHnow7adqAoyWpgH6MpLid01qywToLqQDMMryqmknY\n\twn923A9qek6cXlajP21RO5wni4uFH+YhCEyM8/T7IBsuFHBJul65tbOEXny/nhWc\n\t++PRj76dtgcuJSSM7P7ilXe9So2pT0sHSiuV87h8NEc42Vq+Is6T4YY5CEvTfnGh\n\tkNl0PQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=oss.qualcomm.com; s=google; t=1777444978; x=1778049778;\n darn=vger.kernel.org;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=Hq//0MaTtB+D8Slz74o3QINBfe6mU8ByJ3ZjSrdZlow=;\n        b=Q9Aj5z7/VYNnFqQsvZoisH+XPUmurFBF0xt8oBhlXeSqIXs1Az6lo7oB6SA9BTTH8k\n         HesZNI50kU07iOQH5U1fnJFT2p1axyUR3H3JG/j4qjAKTEpzu6JVIebmThXMstMU1z4I\n         JrNgHvHJ7MgEIILdSu8o1DmnSIQtlCiq/Vrs/TDqgkcbRVMqOq5bxSbjM9KNC1MVSHKv\n         qGsHImfJruD230wtixLNZUlhJLyruxIsCXcoaNHayXSeAndyXqWrXme874EUi2ZfLu69\n         4Reyu8cUEh40zlnTPeN6tO+4wR0uytRxewMPDWBUvHGQQr+THPcdc1qGO0hS9YhTW5q5\n         pSEg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777444978; x=1778049778;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n         :cc:subject:date:message-id:reply-to;\n        bh=Hq//0MaTtB+D8Slz74o3QINBfe6mU8ByJ3ZjSrdZlow=;\n        b=U8GanM7Sdk18TapLpLryjgyoy4pXkPhr0hCP+GEzAUK87W557f8kabHk9mwa+Kr4NR\n         qVc169MWzzC21Re/nLy5AFr11EMKDJtgbXvwpZfEb2w+4Qmy2eNjuKd772M+ml+DcLHv\n         mvQWdWFfeN29VQ0muEf1REzGv9at5wS3ShAcCiC2Mfmpyc5ChqPKKsSvEnfmFFH34jGU\n         TP2oRXvOVqyk3la2vG0v68utjcTNxsuREZ+XltWhOOEtYjuogKoEh3RW0auedVUji908\n         H1mlnm7pU55ax+WAhPSj3c9hQfNJVbLv2huWo9tDTvG7ZU+2xhUnLZxXW+2Q6YDpCfR0\n         nu2g==",
        "X-Gm-Message-State": "AOJu0YxJNOaYgZxlEobxFyifsUE3bpTuDUmXcUW4t4ua0eM9gzFhXU35\n\tRbZf7v9KdAwG+UcGV+GqKU+Nxja74GaB28SybGZM69YTBgcP6fHyhifrSyP0j7TfDq3nDKFRiix\n\tOEc8uUp8P7BX4JMJfCeF9e+SHQDVxHwpyh+r2vYti7xk+oVAGHaRMOPXxdrJk10U=",
        "X-Gm-Gg": "AeBDies8cg9pKxCjhoQNwupB644Z7rrWtJ5kX7jvOwX4KjQuodzXsvLUJ17J0qDB+Mb\n\tqlLWkyUC27+eh/0vh1V/PGEeOpdzpWyHoDcHG+Uw0CZbfc53ZpoT2Vsl1up7l7faIAMynKfR06k\n\tgJ4R1BPYJvVhW0Ip83ELbp10lR1xFgvrZswkvIDWR0m+Wx/PuXCsTTIUGiETn1Z2mkdVaIibEIq\n\tvpcSNAxD/BM8bg3ouMJno+3JyhUJJQS/lyS6+rIILb2TVTe4qtYjo5+FJ0hHt3rFyUT67QmcbNM\n\tlbq5eNXY8rpge+erxnsw6qrD0VuCUsevZpJzGovwXlQuQHsBPla2xgYwKbzgsxpJKJSAKFU6i7p\n\tiMAQCaZVpeHuSDfZM12sPS+phZQLL2OIo+Dha/VWatjhUvBzMw0AjGrV3RMrdogZLvjc=",
        "X-Received": [
            "by 2002:a17:90b:5865:b0:359:f77f:8cff with SMTP id\n 98e67ed59e1d1-36492046f97mr6801405a91.19.1777444977834;\n        Tue, 28 Apr 2026 23:42:57 -0700 (PDT)",
            "by 2002:a17:90b:5865:b0:359:f77f:8cff with SMTP id\n 98e67ed59e1d1-36492046f97mr6801368a91.19.1777444977296;\n        Tue, 28 Apr 2026 23:42:57 -0700 (PDT)"
        ],
        "From": "Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>",
        "Date": "Wed, 29 Apr 2026 12:12:27 +0530",
        "Subject": "[PATCH v5 5/5] PCI: qcom: Add D3cold support",
        "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": "<20260429-d3cold-v5-5-89e9735b9df6@oss.qualcomm.com>",
        "References": "<20260429-d3cold-v5-0-89e9735b9df6@oss.qualcomm.com>",
        "In-Reply-To": "<20260429-d3cold-v5-0-89e9735b9df6@oss.qualcomm.com>",
        "To": "Jingoo Han <jingoohan1@gmail.com>,\n Manivannan Sadhasivam <mani@kernel.org>,\n Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?=\n\t=?utf-8?q?ski?= <kwilczynski@kernel.org>, Rob Herring <robh@kernel.org>,\n Bjorn Helgaas <bhelgaas@google.com>, Will Deacon <will@kernel.org>",
        "Cc": "linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,\n        linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n        jonathanh@nvidia.com, bjorn.andersson@oss.qualcomm.com,\n        Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>",
        "X-Mailer": "b4 0.15.2",
        "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1777444949; l=8346;\n i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id;\n bh=pA76AmsNQb6QnqOiWK09b1zUzJDidnd19LIa2CcRAH8=;\n b=rBSaTdbJhOplkic9jOdMuWUYoZEN4Z5hY6sphVVqaapCV9NZRGxNjRynDSrXYWSeMPcIp8xB2\n /VMqJixAoW2CPphPAtumG5GxoEqm/AT6P2t6yJ4dDrOsgeIhSe5Pclt",
        "X-Developer-Key": "i=krishna.chundru@oss.qualcomm.com; a=ed25519;\n pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg=",
        "X-Authority-Analysis": "v=2.4 cv=C/7ZDwP+ c=1 sm=1 tr=0 ts=69f1a872 cx=c_pps\n a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22\n a=EUspDBNiAAAA:8 a=nOXFll4yYCsuIFAjJyMA:9 a=QEXdDO2ut3YA:10\n a=mQ_c8vxmzFEMiUWkPHU9:22",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDI5MDA2NCBTYWx0ZWRfX98WSfFIOtNAW\n BhvrWJVsznp0+eQtdz7D9hOi9SAjefsd9ZvH7LcPI3LNiVJC87hWO6Ygp5UistLAk8rhkhQ2xcV\n ZikBMNJzANXS/aMohfz33xnGu9ifsowFOflEMUQdNIJEFt+cBlDM2uKwfDksnbGeVS550luimjc\n vV0lJ4efWLzDGsuEdBu3NT4GaBTubtAfV/L7OZiFFzbLw7hBsIwJR/KXK4JymlVYDhU275ZiQpa\n NDfkIiGcvmIKXUiVKWFDp1F4CSydgC3ux2IlnEh+EDgBEYjaQiPffuzxWRF6OL3eXqD1LmnMMzX\n a65GOAxwey32GYTMCn48RU54Jw8xSqD3qxB8Cc7vd3mqB9d2KPnN5uNckxUWHQh1Amo/Jx4pCOg\n t6pG972m/qz0fzV2Arpize3oiCr8jhs9rcrxFFlTPN7SjSlKJWJUWeMe2ZCIIc/S/aOdKdxBqz2\n k4sZdvFzxlVBoyMAXDQ==",
        "X-Proofpoint-GUID": "Uv3HRCOGtkEHhgpYL4UKB3Ou20RC79Cm",
        "X-Proofpoint-ORIG-GUID": "Uv3HRCOGtkEHhgpYL4UKB3Ou20RC79Cm",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-28_05,2026-04-28_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0\n priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1015\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290064"
    },
    "content": "Add support for transitioning PCIe endpoints under host bridge into\nD3cold by integrating with the DWC core suspend/resume helpers.\n\nImplement PME_TurnOff message generation via ELBI_SYS_CTRL and hook it\ninto the DWC host operations so the controller follows the standard\nPME_TurnOff-based power-down sequence before entering D3cold.\n\nWhen the device is suspended into D3cold, fully tear down interconnect\nbandwidth, OPP votes. If D3cold is not entered, retain existing behavior\nby keeping the required interconnect and OPP votes.\n\nUse dw_pcie::skip_pwrctrl_off to avoid powering off devices during suspend\nto preserve wakeup capability of the devices and also not to power on the\ndevices in the init path.\n\nDrop the qcom_pcie::suspended flag and rely on the existing\ndw_pcie::suspended state, which now drives both the power-management\nflow and the interconnect/OPP handling.\n\nSigned-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>\n---\n drivers/pci/controller/dwc/pcie-qcom.c | 155 ++++++++++++++++++++-------------\n 1 file changed, 95 insertions(+), 60 deletions(-)",
    "diff": "diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c\nindex 9dd808e85409..94403be5a05e 100644\n--- a/drivers/pci/controller/dwc/pcie-qcom.c\n+++ b/drivers/pci/controller/dwc/pcie-qcom.c\n@@ -146,6 +146,7 @@\n \n /* ELBI_SYS_CTRL register fields */\n #define ELBI_SYS_CTRL_LT_ENABLE\t\t\tBIT(0)\n+#define ELBI_SYS_CTRL_PME_TURNOFF_MSG\t\tBIT(4)\n \n /* ELBI_SYS_STTS register fields */\n #define ELBI_SYS_STTS_LTSSM_STATE_MASK\t\tGENMASK(17, 12)\n@@ -288,7 +289,6 @@ struct qcom_pcie {\n \tconst struct qcom_pcie_cfg *cfg;\n \tstruct dentry *debugfs;\n \tstruct list_head ports;\n-\tbool suspended;\n \tbool use_pm_opp;\n };\n \n@@ -1364,13 +1364,17 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)\n \tif (ret)\n \t\tgoto err_deinit;\n \n-\tret = pci_pwrctrl_create_devices(pci->dev);\n-\tif (ret)\n-\t\tgoto err_disable_phy;\n+\tif (!pci->suspended) {\n+\t\tret = pci_pwrctrl_create_devices(pci->dev);\n+\t\tif (ret)\n+\t\t\tgoto err_disable_phy;\n+\t}\n \n-\tret = pci_pwrctrl_power_on_devices(pci->dev);\n-\tif (ret)\n-\t\tgoto err_pwrctrl_destroy;\n+\tif (!pp->skip_pwrctrl_off) {\n+\t\tret = pci_pwrctrl_power_on_devices(pci->dev);\n+\t\tif (ret)\n+\t\t\tgoto err_pwrctrl_destroy;\n+\t}\n \n \tif (pcie->cfg->ops->post_init) {\n \t\tret = pcie->cfg->ops->post_init(pcie);\n@@ -1395,9 +1399,10 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)\n err_assert_reset:\n \tqcom_pcie_perst_assert(pcie);\n err_pwrctrl_power_off:\n-\tpci_pwrctrl_power_off_devices(pci->dev);\n+\tif (!pp->skip_pwrctrl_off)\n+\t\tpci_pwrctrl_power_off_devices(pci->dev);\n err_pwrctrl_destroy:\n-\tif (ret != -EPROBE_DEFER)\n+\tif (ret != -EPROBE_DEFER && !pci->suspended)\n \t\tpci_pwrctrl_destroy_devices(pci->dev);\n err_disable_phy:\n \tqcom_pcie_phy_power_off(pcie);\n@@ -1414,11 +1419,14 @@ static void qcom_pcie_host_deinit(struct dw_pcie_rp *pp)\n \n \tqcom_pcie_perst_assert(pcie);\n \n-\t/*\n-\t * No need to destroy pwrctrl devices as this function only gets called\n-\t * during system suspend as of now.\n-\t */\n-\tpci_pwrctrl_power_off_devices(pci->dev);\n+\tif (!pci->pp.skip_pwrctrl_off) {\n+\t\t/*\n+\t\t * No need to destroy pwrctrl devices as this function only gets called\n+\t\t * during system suspend as of now.\n+\t\t */\n+\t\tpci_pwrctrl_power_off_devices(pci->dev);\n+\t}\n+\n \tqcom_pcie_phy_power_off(pcie);\n \tpcie->cfg->ops->deinit(pcie);\n }\n@@ -1432,10 +1440,18 @@ static void qcom_pcie_host_post_init(struct dw_pcie_rp *pp)\n \t\tpcie->cfg->ops->host_post_init(pcie);\n }\n \n+static void qcom_pcie_host_pme_turn_off(struct dw_pcie_rp *pp)\n+{\n+\tstruct dw_pcie *pci = to_dw_pcie_from_pp(pp);\n+\n+\twritel(ELBI_SYS_CTRL_PME_TURNOFF_MSG, pci->elbi_base + ELBI_SYS_CTRL);\n+}\n+\n static const struct dw_pcie_host_ops qcom_pcie_dw_ops = {\n \t.init\t\t= qcom_pcie_host_init,\n \t.deinit\t\t= qcom_pcie_host_deinit,\n \t.post_init\t= qcom_pcie_host_post_init,\n+\t.pme_turn_off\t= qcom_pcie_host_pme_turn_off,\n };\n \n /* Qcom IP rev.: 2.1.0\tSynopsys IP rev.: 4.01a */\n@@ -2102,53 +2118,51 @@ static int qcom_pcie_suspend_noirq(struct device *dev)\n \tif (!pcie)\n \t\treturn 0;\n \n-\t/*\n-\t * Set minimum bandwidth required to keep data path functional during\n-\t * suspend.\n-\t */\n-\tif (pcie->icc_mem) {\n-\t\tret = icc_set_bw(pcie->icc_mem, 0, kBps_to_icc(1));\n-\t\tif (ret) {\n-\t\t\tdev_err(dev,\n-\t\t\t\t\"Failed to set bandwidth for PCIe-MEM interconnect path: %d\\n\",\n-\t\t\t\tret);\n-\t\t\treturn ret;\n-\t\t}\n-\t}\n+\tret = dw_pcie_suspend_noirq(pcie->pci);\n+\tif (ret)\n+\t\treturn ret;\n \n-\t/*\n-\t * Turn OFF the resources only for controllers without active PCIe\n-\t * devices. For controllers with active devices, the resources are kept\n-\t * ON and the link is expected to be in L0/L1 (sub)states.\n-\t *\n-\t * Turning OFF the resources for controllers with active PCIe devices\n-\t * will trigger access violation during the end of the suspend cycle,\n-\t * as kernel tries to access the PCIe devices config space for masking\n-\t * MSIs.\n-\t *\n-\t * Also, it is not desirable to put the link into L2/L3 state as that\n-\t * implies VDD supply will be removed and the devices may go into\n-\t * powerdown state. This will affect the lifetime of the storage devices\n-\t * like NVMe.\n-\t */\n-\tif (!dw_pcie_link_up(pcie->pci)) {\n-\t\tqcom_pcie_host_deinit(&pcie->pci->pp);\n-\t\tpcie->suspended = true;\n-\t}\n+\tif (pcie->pci->suspended) {\n+\t\tret = icc_disable(pcie->icc_mem);\n+\t\tif (ret)\n+\t\t\tdev_err(dev, \"Failed to disable PCIe-MEM interconnect path: %d\\n\", ret);\n \n-\t/*\n-\t * Only disable CPU-PCIe interconnect path if the suspend is non-S2RAM.\n-\t * Because on some platforms, DBI access can happen very late during the\n-\t * S2RAM and a non-active CPU-PCIe interconnect path may lead to NoC\n-\t * error.\n-\t */\n-\tif (pm_suspend_target_state != PM_SUSPEND_MEM) {\n \t\tret = icc_disable(pcie->icc_cpu);\n \t\tif (ret)\n \t\t\tdev_err(dev, \"Failed to disable CPU-PCIe interconnect path: %d\\n\", ret);\n \n \t\tif (pcie->use_pm_opp)\n \t\t\tdev_pm_opp_set_opp(pcie->pci->dev, NULL);\n+\t} else {\n+\t\t/*\n+\t\t * Set minimum bandwidth required to keep data path functional during\n+\t\t * suspend.\n+\t\t */\n+\t\tif (pcie->icc_mem) {\n+\t\t\tret = icc_set_bw(pcie->icc_mem, 0, kBps_to_icc(1));\n+\t\t\tif (ret) {\n+\t\t\t\tdev_err(dev,\n+\t\t\t\t\t\"Failed to set bandwidth for PCIe-MEM interconnect path: %d\\n\",\n+\t\t\t\t\tret);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\n+\t\t/*\n+\t\t * Only disable CPU-PCIe interconnect path if the suspend is non-S2RAM.\n+\t\t * Because on some platforms, DBI access can happen very late during the\n+\t\t * S2RAM and a non-active CPU-PCIe interconnect path may lead to NoC\n+\t\t * error.\n+\t\t */\n+\t\tif (pm_suspend_target_state != PM_SUSPEND_MEM) {\n+\t\t\tret = icc_disable(pcie->icc_cpu);\n+\t\t\tif (ret)\n+\t\t\t\tdev_err(dev, \"Failed to disable CPU-PCIe interconnect path: %d\\n\",\n+\t\t\t\t\tret);\n+\n+\t\t\tif (pcie->use_pm_opp)\n+\t\t\t\tdev_pm_opp_set_opp(pcie->pci->dev, NULL);\n+\t\t}\n \t}\n \treturn ret;\n }\n@@ -2162,25 +2176,46 @@ static int qcom_pcie_resume_noirq(struct device *dev)\n \tif (!pcie)\n \t\treturn 0;\n \n-\tif (pm_suspend_target_state != PM_SUSPEND_MEM) {\n+\tif (pcie->pci->suspended) {\n \t\tret = icc_enable(pcie->icc_cpu);\n \t\tif (ret) {\n \t\t\tdev_err(dev, \"Failed to enable CPU-PCIe interconnect path: %d\\n\", ret);\n \t\t\treturn ret;\n \t\t}\n-\t}\n \n-\tif (pcie->suspended) {\n-\t\tret = qcom_pcie_host_init(&pcie->pci->pp);\n-\t\tif (ret)\n-\t\t\treturn ret;\n+\t\tret = icc_enable(pcie->icc_mem);\n+\t\tif (ret) {\n+\t\t\tdev_err(dev, \"Failed to enable PCIe-MEM interconnect path: %d\\n\", ret);\n+\t\t\tgoto disable_icc_cpu;\n+\t\t}\n \n-\t\tpcie->suspended = false;\n+\t\t/*\n+\t\t * Ignore -ENODEV & -EIO here since it is expected when no endpoint is\n+\t\t * connected to the PCIe link.\n+\t\t */\n+\t\tret = dw_pcie_resume_noirq(pcie->pci);\n+\t\tif (ret && ret != -ENODEV && ret != -EIO)\n+\t\t\tgoto disable_icc_mem;\n+\t} else {\n+\t\tif (pm_suspend_target_state != PM_SUSPEND_MEM) {\n+\t\t\tret = icc_enable(pcie->icc_cpu);\n+\t\t\tif (ret) {\n+\t\t\t\tdev_err(dev, \"Failed to enable CPU-PCIe interconnect path: %d\\n\",\n+\t\t\t\t\tret);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n \t}\n \n \tqcom_pcie_icc_opp_update(pcie);\n \n \treturn 0;\n+disable_icc_mem:\n+\ticc_disable(pcie->icc_mem);\n+disable_icc_cpu:\n+\ticc_disable(pcie->icc_cpu);\n+\n+\treturn ret;\n }\n \n static const struct of_device_id qcom_pcie_match[] = {\n",
    "prefixes": [
        "v5",
        "5/5"
    ]
}