get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217840,
    "url": "http://patchwork.ozlabs.org/api/patches/2217840/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260330174011.1161-6-alifm@linux.ibm.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": "<20260330174011.1161-6-alifm@linux.ibm.com>",
    "list_archive_url": null,
    "date": "2026-03-30T17:40:09",
    "name": "[v12,5/7] vfio-pci/zdev: Add a device feature for error information",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c7e77596cf7c3f4bd2dd5473a8a4b86b4dc9bc1b",
    "submitter": {
        "id": 73785,
        "url": "http://patchwork.ozlabs.org/api/people/73785/?format=api",
        "name": "Farhan Ali",
        "email": "alifm@linux.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260330174011.1161-6-alifm@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 498071,
            "url": "http://patchwork.ozlabs.org/api/series/498071/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=498071",
            "date": "2026-03-30T17:40:08",
            "name": "Error recovery for vfio-pci devices on s390x",
            "version": 12,
            "mbox": "http://patchwork.ozlabs.org/series/498071/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217840/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217840/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-51486-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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=bbTBn8Ip;\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-51486-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=\"bbTBn8Ip\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=148.163.158.5",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.ibm.com"
        ],
        "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkzCG2v3Rz1xrn\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 04:44:26 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id D8703308781D\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 17:40:36 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 3B0773DE428;\n\tMon, 30 Mar 2026 17:40:30 +0000 (UTC)",
            "from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\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 5F3993DE432;\n\tMon, 30 Mar 2026 17:40:27 +0000 (UTC)",
            "from pps.filterd (m0353725.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 62UFSIQE270868;\n\tMon, 30 Mar 2026 17:40:20 GMT",
            "from ppma11.dal12v.mail.ibm.com\n (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4d65dc7pvn-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tMon, 30 Mar 2026 17:40:20 +0000 (GMT)",
            "from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])\n\tby ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 62UG1ItH008698;\n\tMon, 30 Mar 2026 17:40:19 GMT",
            "from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4])\n\tby ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4d6v11dmqk-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tMon, 30 Mar 2026 17:40:19 +0000",
            "from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com\n [10.241.53.103])\n\tby smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 62UHeIGI1901252\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tMon, 30 Mar 2026 17:40:18 GMT",
            "from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C1C1A58056;\n\tMon, 30 Mar 2026 17:40:18 +0000 (GMT)",
            "from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id F2C8158062;\n\tMon, 30 Mar 2026 17:40:17 +0000 (GMT)",
            "from IBM-D32RQW3.ibm.com (unknown [9.61.243.214])\n\tby smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP;\n\tMon, 30 Mar 2026 17:40:17 +0000 (GMT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774892430; cv=none;\n b=bLB2QWBY4mF2HD0o9LZAZIyXTlTa3R26T6Bi0lI99rulzfNort/bhWZnA/LYyyhmKi6m+ZYw75vJZ/2GITZZvgSbyVUwDHZ7U+OejhtpAJ0a4pYo1d9yx243Am3OV4m8u7stm7C8rXhw8EUtQ3RIaO0QYClNrHTDRP3F0J4UII4=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774892430; c=relaxed/simple;\n\tbh=zmO9qVygBTl3Ynmb51HKeC92Av1E7/vfIZEtPOocSCU=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=lYxVcWengu3yiOgm6wyQVSFH82d8GytDxRcZdZZy+BNauheOAcAif/WzZlo75MWOIACFeEYqS8XFPg+tAn1rZY/uZWQfTI014yWWvitcHvK/HrVSYln3DBjOSOR6+BNBYFbuA/8uuWR2pj+9Q8GpLK66VNXCtyCfyhVBT3/GhLg=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com;\n spf=pass smtp.mailfrom=linux.ibm.com;\n dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=bbTBn8Ip; arc=none smtp.client-ip=148.163.158.5",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n\t:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=pp1; bh=FYxLOqn7kUmMT8BfP\n\tDug1DpYshopCZ3Iipsaiwu5E84=; b=bbTBn8Ipcd4uU2kQmdZ+aCIUXKEjv6e7e\n\tUp2VaqjOfSq5UdRLO7bozzKgKGkqiZ9bw0TADGc+UzSmNSrc5eGMfvSFDE/anFnw\n\tLIGDMoXak+Tk7AaMH7WKDYpo2bJojnXbaf1yfJr+WXBQEtOSuz6vwDQjj6cklVfl\n\tozOwRNwm5JEWxy4awtn0rzySdka3NKzNEZvLNOYX3Qxz7Sprb8q5AyB7Sds5co7a\n\tCiLJ9dmIDXGODZI2uFN5w4k9FKByH+EtB+n2GH8u1XRtUfdtuGdxS7+AH0tnEJR6\n\tgDKIgzRr0l58hKq/FGZI/rfGjyRzmzqA4XWoIcdqN2wR9b56LFldw==",
        "From": "Farhan Ali <alifm@linux.ibm.com>",
        "To": "linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,\n        linux-pci@vger.kernel.org",
        "Cc": "helgaas@kernel.org, lukas@wunner.de, alex@shazbot.org, clg@redhat.com,\n        kbusch@kernel.org, alifm@linux.ibm.com, schnelle@linux.ibm.com,\n        mjrosato@linux.ibm.com",
        "Subject": "[PATCH v12 5/7] vfio-pci/zdev: Add a device feature for error\n information",
        "Date": "Mon, 30 Mar 2026 10:40:09 -0700",
        "Message-ID": "<20260330174011.1161-6-alifm@linux.ibm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260330174011.1161-1-alifm@linux.ibm.com>",
        "References": "<20260330174011.1161-1-alifm@linux.ibm.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",
        "Content-Transfer-Encoding": "8bit",
        "X-TM-AS-GCONF": "00",
        "X-Authority-Analysis": "v=2.4 cv=RsjI7SmK c=1 sm=1 tr=0 ts=69cab584 cx=c_pps\n a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17\n a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=QIy8Zix3hhx26zbqT_4A:9",
        "X-Proofpoint-GUID": "vrMufRkLdoDnQmSYejUT6F0YpNkgfA5d",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMzMwMDE0MSBTYWx0ZWRfX2BDLNWCGY6I/\n mzMqI8aS6RrMyvXwswdFzr4SViIz/lnuS3xCvRPFyaz+I9A4i+Jtpc2saNHalzr+D86VCl07H6O\n 6uauTFzLq3r5NfP+kv3/92xfTUD9vIeapGAu+XyF1ujbcho1G3pABIUNYpON0JqEGIA++lGFkYM\n JPW3NsjsEpEHCuyPgcHoQTRMD8tgmb3CHMkO/A6VtaRtXJWi+CzgGZnHsA/I4HXGMhyq3Z6TgvD\n WV5y6tVu890eVUx/0zB9L/s6LH/T0Tk/jQCpbVt9KWE02R525WdaDAiB6fVnSFqmrMHQisSuRk+\n JM9xhEjMFAEq9be9On97f7r3nEBzk/bsyZzAAW5W5gbnP7LUkqNZPUQcOq0kXI4VYkgecRQypja\n 60ohePQDTp0RhLE/HJLidMBzTcMLjqGKIwe5nRRCHa9iZULW+p8XKxTRhOORqU7Dl8adktV/W2r\n +pxz+JVWHhPMEkgt0vg==",
        "X-Proofpoint-ORIG-GUID": "vrMufRkLdoDnQmSYejUT6F0YpNkgfA5d",
        "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-03-29_05,2026-03-28_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0\n suspectscore=0 malwarescore=0 spamscore=0 clxscore=1015 phishscore=0\n adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001\n definitions=main-2603300141"
    },
    "content": "For zPCI devices, we have platform specific error information. The platform\nfirmware provides this error information to the operating system in an\narchitecture specific mechanism. To enable recovery from userspace for\nthese devices, we want to expose this error information to userspace. Add a\nnew device feature to expose this information.\n\nSigned-off-by: Farhan Ali <alifm@linux.ibm.com>\n---\n drivers/vfio/pci/vfio_pci_core.c |  2 ++\n drivers/vfio/pci/vfio_pci_priv.h |  9 ++++++++\n drivers/vfio/pci/vfio_pci_zdev.c | 36 ++++++++++++++++++++++++++++++++\n include/uapi/linux/vfio.h        | 18 ++++++++++++++++\n 4 files changed, 65 insertions(+)",
    "diff": "diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c\nindex d43745fe4c84..bbdb625e35ef 100644\n--- a/drivers/vfio/pci/vfio_pci_core.c\n+++ b/drivers/vfio/pci/vfio_pci_core.c\n@@ -1534,6 +1534,8 @@ int vfio_pci_core_ioctl_feature(struct vfio_device *device, u32 flags,\n \t\treturn vfio_pci_core_feature_token(vdev, flags, arg, argsz);\n \tcase VFIO_DEVICE_FEATURE_DMA_BUF:\n \t\treturn vfio_pci_core_feature_dma_buf(vdev, flags, arg, argsz);\n+\tcase VFIO_DEVICE_FEATURE_ZPCI_ERROR:\n+\t\treturn vfio_pci_zdev_feature_err(device, flags, arg, argsz);\n \tdefault:\n \t\treturn -ENOTTY;\n \t}\ndiff --git a/drivers/vfio/pci/vfio_pci_priv.h b/drivers/vfio/pci/vfio_pci_priv.h\nindex 27ac280f00b9..647a9e8f348d 100644\n--- a/drivers/vfio/pci/vfio_pci_priv.h\n+++ b/drivers/vfio/pci/vfio_pci_priv.h\n@@ -89,6 +89,8 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n \t\t\t\tstruct vfio_info_cap *caps);\n int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev);\n void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev);\n+int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,\n+\t\t\t      void __user *arg, size_t argsz);\n #else\n static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n \t\t\t\t\t      struct vfio_info_cap *caps)\n@@ -103,6 +105,13 @@ static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)\n \n static inline void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev)\n {}\n+\n+static inline int vfio_pci_zdev_feature_err(struct vfio_device *device,\n+\t\t\t\t\t    u32 flags, void __user *arg,\n+\t\t\t\t\t    size_t argsz)\n+{\n+\treturn -ENOTTY;\n+}\n #endif\n \n static inline bool vfio_pci_is_vga(struct pci_dev *pdev)\ndiff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c\nindex 0658095ac5b1..0a8663879eee 100644\n--- a/drivers/vfio/pci/vfio_pci_zdev.c\n+++ b/drivers/vfio/pci/vfio_pci_zdev.c\n@@ -141,6 +141,42 @@ int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,\n \treturn ret;\n }\n \n+int vfio_pci_zdev_feature_err(struct vfio_device *device, u32 flags,\n+\t\t\t      void __user *arg, size_t argsz)\n+{\n+\tstruct vfio_device_feature_zpci_err err = {};\n+\tstruct vfio_pci_core_device *vdev;\n+\tstruct zpci_dev *zdev;\n+\tint head = 0;\n+\tint ret;\n+\n+\tvdev = container_of(device, struct vfio_pci_core_device, vdev);\n+\tzdev = to_zpci(vdev->pdev);\n+\tif (!zdev)\n+\t\treturn -ENODEV;\n+\n+\tret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_GET,\n+\t\t\t\t sizeof(err));\n+\tif (ret != 1)\n+\t\treturn ret;\n+\n+\tmutex_lock(&zdev->pending_errs_lock);\n+\tif (zdev->pending_errs.count) {\n+\t\thead = zdev->pending_errs.head % ZPCI_ERR_PENDING_MAX;\n+\t\terr.pec = zdev->pending_errs.err[head].pec;\n+\t\tzdev->pending_errs.head++;\n+\t\tzdev->pending_errs.count--;\n+\t\terr.pending_errors = zdev->pending_errs.count;\n+\t}\n+\tmutex_unlock(&zdev->pending_errs_lock);\n+\n+\terr.version = 1;\n+\tif (copy_to_user(arg, &err, sizeof(err)))\n+\t\treturn -EFAULT;\n+\n+\treturn 0;\n+}\n+\n int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev)\n {\n \tstruct zpci_dev *zdev = to_zpci(vdev->pdev);\ndiff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h\nindex bb7b89330d35..2552eef42000 100644\n--- a/include/uapi/linux/vfio.h\n+++ b/include/uapi/linux/vfio.h\n@@ -1510,6 +1510,24 @@ struct vfio_device_feature_dma_buf {\n \tstruct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);\n };\n \n+/**\n+ * VFIO_DEVICE_FEATURE_ZPCI_ERROR feature provides PCI error information to\n+ * userspace for vfio-pci devices on s390x. On s390x PCI error recovery\n+ * involves platform firmware and notification to operating system is done\n+ * by architecture specific mechanism. Exposing this information to\n+ * userspace allows userspace to take appropriate actions to handle an\n+ * error on the device. The pending_errors provide any additional errors\n+ * pending for the device, and userspace should read until zero.\n+ */\n+\n+struct vfio_device_feature_zpci_err {\n+\t__u8 version;\n+\t__u8 pending_errors;\n+\t__u16 pec;\n+};\n+\n+#define VFIO_DEVICE_FEATURE_ZPCI_ERROR 12\n+\n /* -------- API for Type1 VFIO IOMMU -------- */\n \n /**\n",
    "prefixes": [
        "v12",
        "5/7"
    ]
}