get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227527,
    "url": "http://patchwork.ozlabs.org/api/patches/2227527/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423212316.3431746-11-dmatlack@google.com/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260423212316.3431746-11-dmatlack@google.com>",
    "list_archive_url": null,
    "date": "2026-04-23T21:23:14",
    "name": "[v4,10/11] PCI: liveupdate: Do not disable bus mastering on preserved devices during kexec",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "286d3c9c80b574996deaf3df6bbbe97a1be2024d",
    "submitter": {
        "id": 69449,
        "url": "http://patchwork.ozlabs.org/api/people/69449/?format=api",
        "name": "David Matlack",
        "email": "dmatlack@google.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423212316.3431746-11-dmatlack@google.com/mbox/",
    "series": [
        {
            "id": 501248,
            "url": "http://patchwork.ozlabs.org/api/series/501248/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501248",
            "date": "2026-04-23T21:23:04",
            "name": "PCI: liveupdate: PCI core support for Live Update",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501248/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227527/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227527/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53077-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=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=S6Yg/35I;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-53077-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"S6Yg/35I\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.202",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1q1y5LkGz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 07:27:50 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id D7B7C3076EE4\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 21:25:03 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 05C2C3BFE3C;\n\tThu, 23 Apr 2026 21:23:48 +0000 (UTC)",
            "from mail-pl1-f202.google.com (mail-pl1-f202.google.com\n [209.85.214.202])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id B53E23C13F2\n\tfor <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 21:23:39 +0000 (UTC)",
            "by mail-pl1-f202.google.com with SMTP id\n d9443c01a7336-2adef9d486bso65247445ad.2\n        for <linux-pci@vger.kernel.org>; Thu, 23 Apr 2026 14:23:39 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776979425; cv=none;\n b=Zl+k0PajiBWxcFLiTaU6Q5DkX54kESUFhlbgSWiuK7roD5F4LdooUboLCKAaz041O4hGTy3NDffAAfd1k0VupHc+BpzSIrYameDx4VzNKnUYDUxZnyxSpRzFlYDzDz3O8neb/G4ta5vod3HrewooLIhJzd+aP3D0D3YagYiR3uY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776979425; c=relaxed/simple;\n\tbh=Oe8MwOihG5BzjH99EK3y2Iy4j4M/3j0maoUzCe5H9s8=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=hIrcHQI9mQiKcwPZGhGotVhxF91uJhnYnZX9ObBiA+8XPdvlJu0Gz2q2I4RpjtHwgI969idRj9KhoKqHPPyxYbF2V/sO9LNBFgKOUnXT4O96ucmu/yX5Rfv272QDso0ikmi7hiPatSIWG0agaKASLQX140LSY10I2o6lUfLez8U=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=S6Yg/35I; arc=none smtp.client-ip=209.85.214.202",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1776979418; x=1777584218;\n darn=vger.kernel.org;\n        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n         :date:from:to:cc:subject:date:message-id:reply-to;\n        bh=NDSmr3KzvFf45fqXLLacm4Nig+LS/n/kl38OHtIvfGo=;\n        b=S6Yg/35I+BOb4hlpM7fzMitlnY4VsnIm8RupHp0/S0Bs1Bi9GhkNJoPAuow9rzY+vH\n         ustao6je+FQe+CEwUTr/JgUaCeehxRbwLbaVcupthpdSpZ4L7kOgB0UTvQvU5etRR3HD\n         QCsLDtGOo1VZs8zLzhUlPdHdPb1ZnbqF59ZDdaYRnQ8Iaa7TT7t/ZPAkjoVqxbSrPbaH\n         oyCaNehedELWVERJ+buwkQvhjc5g4shwm4F3SHsZ/z/RPjcn778jZ6amThx8037XTcGD\n         wQrcfJUCLw8Ej5pzHTOhkTLs+9H/Rwet4hCqtrsK+HFlyKW24P2T2BzKgGGYE++mGss+\n         uQ2w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776979418; x=1777584218;\n        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n         :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n        bh=NDSmr3KzvFf45fqXLLacm4Nig+LS/n/kl38OHtIvfGo=;\n        b=bPmcYcP+v/X7g+0MXCYjLQDHe4yVS7gYpEwvm6wiqzZ6xYfDnp3GYc5nDtSO6WvDKD\n         NHxDQrr42AD/4FB/7LyxQAyRN7XvuE0nFlNdTOH3661pVpYAtPBEGv5gGCAdRjJebVTC\n         qOOTTRIPyAYzKg44WRBZPLlBLn4DlG8Eigq8FeJKn1UMrnmeSUd6gJQNiVhk0geVggWY\n         E83jjB14x6UBfnifKbECG3HUv9kSLMFOgTyetXhagWUSJVo0MoGzZ9HawOUFd5/OItQ8\n         2FgCwW7j9i6NWo9Vn73jY3vIQuAIfKu0xCvi+5vPMhlLrAP4VYLRmygt09z9A3rz3Rph\n         DOwA==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ9iIZ7iQGA+7H5Vc/ddvpkneaJ/ttSn+8sWkIHB/FYTrgjPHIjw+FPW5BkiXHquUMRsPaDeXM7CtJk=@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0YyuY1E1L7fgfgN+vYIAafSsxqAdQE+GUNcYnL9JBZ395nvzF38F\n\tYQD6WW54KFnrIb7MmVscZjaJmOIQlwBZbLdCWZDe7N9Mx9aJMC6dVVkD+aERZnb9wCQEXMuEIDa\n\tMegbA6pmaR6VSdw==",
        "X-Received": "from plov1.prod.google.com ([2002:a17:902:8d81:b0:2ae:c54f:d5ad])\n (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by\n 2002:a17:902:ba94:b0:2b4:5c0d:314b with SMTP id\n d9443c01a7336-2b5f9f83342mr210260195ad.38.1776979417788;\n Thu, 23 Apr 2026 14:23:37 -0700 (PDT)",
        "Date": "Thu, 23 Apr 2026 21:23:14 +0000",
        "In-Reply-To": "<20260423212316.3431746-1-dmatlack@google.com>",
        "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",
        "References": "<20260423212316.3431746-1-dmatlack@google.com>",
        "X-Mailer": "git-send-email 2.54.0.rc2.544.gc7ae2d5bb8-goog",
        "Message-ID": "<20260423212316.3431746-11-dmatlack@google.com>",
        "Subject": "[PATCH v4 10/11] PCI: liveupdate: Do not disable bus mastering on\n preserved devices during kexec",
        "From": "David Matlack <dmatlack@google.com>",
        "To": "iommu@lists.linux.dev, kexec@lists.infradead.org,\n\tlinux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org,\n\tlinux-pci@vger.kernel.org",
        "Cc": "Adithya Jayachandran <ajayachandra@nvidia.com>,\n Alexander Graf <graf@amazon.com>,\n\tAlex Williamson <alex@shazbot.org>, Bjorn Helgaas <bhelgaas@google.com>,\n Chris Li <chrisl@kernel.org>,\n\tDavid Matlack <dmatlack@google.com>, David Rientjes <rientjes@google.com>,\n\tJacob Pan <jacob.pan@linux.microsoft.com>, Jason Gunthorpe <jgg@nvidia.com>,\n\tJoerg Roedel <joro@8bytes.org>, Jonathan Corbet <corbet@lwn.net>,\n Josh Hilke <jrhilke@google.com>,\n\tLeon Romanovsky <leonro@nvidia.com>, Lukas Wunner <lukas@wunner.de>,\n Mike Rapoport <rppt@kernel.org>,\n\tParav Pandit <parav@nvidia.com>, Pasha Tatashin <pasha.tatashin@soleen.com>,\n\tPranjal Shrivastava <praan@google.com>, Pratyush Yadav <pratyush@kernel.org>,\n\tRobin Murphy <robin.murphy@arm.com>, Saeed Mahameed <saeedm@nvidia.com>,\n\tSamiullah Khawaja <skhawaja@google.com>,\n Shuah Khan <skhan@linuxfoundation.org>,\n\tWill Deacon <will@kernel.org>, William Tu <witu@nvidia.com>,\n Yi Liu <yi.l.liu@intel.com>",
        "Content-Type": "text/plain; charset=\"UTF-8\""
    },
    "content": "Do not disable bus mastering on outgoing preserved devices during\npci_device_shutdown() for kexec.\n\nPreserved devices must be allowed to perform memory transactions during\na Live Update to minimize downtime and ensure continuous operation.\nClearing the bus mastering bit would prevent these devices from issuing\nany memory requests while the new kernel boots.\n\nBecause bridges upstream of preserved endpoint devices are also\nautomatically preserved, this change also avoids clearing bus mastering\non them. This is critical because clearing bus mastering on an upstream\nbridge prevents the bridge from forwarding memory requests upstream (i.e.\nit would prevent the endpoint device from accessing system RAM and doing\npeer-to-peer transactions with devices not downstream of the bridge).\n\nSigned-off-by: David Matlack <dmatlack@google.com>\n---\n drivers/pci/liveupdate.c |  4 ++++\n drivers/pci/pci-driver.c | 31 ++++++++++++++++++++++---------\n 2 files changed, 26 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c\nindex 25c86cd4c173..2a4a139623a6 100644\n--- a/drivers/pci/liveupdate.c\n+++ b/drivers/pci/liveupdate.c\n@@ -132,6 +132,10 @@\n  *  * The PCI core inherits ARI Forwarding Enable on all bridges with downstream\n  *    preserved devices to ensure that all preserved devices on the bridge's\n  *    secondary bus are addressable after the Live Update.\n+ *\n+ *  * The PCI core does not disable bus mastering on outoing preserved devices\n+ *    during kexec. This allows preserved devices to issue memory transactions\n+ *    throughout the Live Update.\n  */\n \n #define pr_fmt(fmt) \"PCI: liveupdate: \" fmt\ndiff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c\nindex d10ece0889f0..05584bc76332 100644\n--- a/drivers/pci/pci-driver.c\n+++ b/drivers/pci/pci-driver.c\n@@ -531,6 +531,27 @@ static void pci_device_remove(struct device *dev)\n \tpci_dev_put(pci_dev);\n }\n \n+/*\n+ * Disable bus mastering on the device so that it does not perform memory\n+ * transactions during kexec.\n+ *\n+ * Don't touch devices that are being preserved across kexec for Live\n+ * Update or that are in D3cold or unknown states.\n+ */\n+static void pci_clear_master_for_shutdown(struct pci_dev *pci_dev)\n+{\n+\tif (!kexec_in_progress)\n+\t\treturn;\n+\n+\tif (pci_liveupdate_outgoing(pci_dev))\n+\t\treturn;\n+\n+\tif (pci_dev->current_state > PCI_D3hot)\n+\t\treturn;\n+\n+\tpci_clear_master(pci_dev);\n+}\n+\n static void pci_device_shutdown(struct device *dev)\n {\n \tstruct pci_dev *pci_dev = to_pci_dev(dev);\n@@ -541,15 +562,7 @@ static void pci_device_shutdown(struct device *dev)\n \tif (drv && drv->shutdown)\n \t\tdrv->shutdown(pci_dev);\n \n-\t/*\n-\t * If this is a kexec reboot, turn off Bus Master bit on the\n-\t * device to tell it to not continue to do DMA. Don't touch\n-\t * devices in D3cold or unknown states.\n-\t * If it is not a kexec reboot, firmware will hit the PCI\n-\t * devices with big hammer and stop their DMA any way.\n-\t */\n-\tif (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))\n-\t\tpci_clear_master(pci_dev);\n+\tpci_clear_master_for_shutdown(pci_dev);\n }\n \n #ifdef CONFIG_PM_SLEEP\n",
    "prefixes": [
        "v4",
        "10/11"
    ]
}