get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2225152,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2225152/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260420122321.4161027-5-philpem@philpem.me.uk/",
    "project": {
        "id": 13,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/13/?format=api",
        "name": "Linux IDE development",
        "link_name": "linux-ide",
        "list_id": "linux-ide.vger.kernel.org",
        "list_email": "linux-ide@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260420122321.4161027-5-philpem@philpem.me.uk>",
    "date": "2026-04-20T12:23:20",
    "name": "[v2,4/5] ata: libata-scsi: probe additional LUNs for multi-LUN ATAPI devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3c84b839a92c588fe3f546230244732f08e42058",
    "submitter": {
        "id": 93108,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93108/?format=api",
        "name": "Phil Pemberton",
        "email": "philpem@philpem.me.uk"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260420122321.4161027-5-philpem@philpem.me.uk/mbox/",
    "series": [
        {
            "id": 500602,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500602/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=500602",
            "date": "2026-04-20T12:23:21",
            "name": "ata: libata-scsi: multi-LUN ATAPI device support",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/500602/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2225152/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2225152/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-ide+bounces-5499-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ide@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=philpem.me.uk header.i=@philpem.me.uk\n header.a=rsa-sha256 header.s=mail header.b=NnwMstFn;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ide+bounces-5499-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=philpem.me.uk header.i=@philpem.me.uk\n header.b=\"NnwMstFn\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=178.62.38.78",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=philpem.me.uk",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=philpem.me.uk"
        ],
        "Received": [
            "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\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 4fzlbg3Ghnz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 22:46:23 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 15783301A6B2\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 12:45:43 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 665D23A1686;\n\tMon, 20 Apr 2026 12:45:28 +0000 (UTC)",
            "from nick.sneptech.io (nick.sneptech.io [178.62.38.78])\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 8E0E9399019;\n\tMon, 20 Apr 2026 12:45:25 +0000 (UTC)",
            "from wolf.philpem.me.uk (81-187-163-148.ip4.reverse-dns.uk\n [81.187.163.148])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits))\n\t(No client certificate requested)\n\t(Authenticated sender: mailrelay_wolf@philpem.me.uk)\n\tby nick.sneptech.io (Postfix) with ESMTPSA id 45D87BEFE9;\n\tMon, 20 Apr 2026 12:23:29 +0000 (UTC)",
            "from cheetah.homenet.philpem.me.uk (cheetah.homenet.philpem.me.uk\n [10.0.0.32])\n\tby wolf.philpem.me.uk (Postfix) with ESMTPSA id BC87A5FC5A;\n\tMon, 20 Apr 2026 13:23:28 +0100 (BST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776689128; cv=none;\n b=hpMbfncGS1QSvLPsNIvmITZOpaWpU09uU4niRAJnoyvJNzDSudMox41e77N+MVVgGguNqRuCamOClFj58T1XsQM7/pwtj181xf72SY6kkIEvYqdcdEYM9erQN3ycy4dY0xFrJIcGiit6meIqPhZEJpsqn9Zs/7Hc+aAUELUIyyg=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776689128; c=relaxed/simple;\n\tbh=vGCMlAn3ZRxZJy5AYq/flJzKXszt4Qsi2hLGeF8baJI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=r8T3S5DzPG80e80/2iurSLWG6aPQFdN+q2GMeOz/AKY/v/e9idgAxLAuN0YVTspCHGffIe/Hdo6OxxqHvtP1hdwB6AwUgkEFE8cbYlHLDkHZnimXiItVKPBtf8ePKrVHnZySpZvRRWLvPRjwfWFOaDglE525Bla0HFk6UBl9zN8=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=philpem.me.uk;\n spf=pass smtp.mailfrom=philpem.me.uk;\n dkim=pass (1024-bit key) header.d=philpem.me.uk header.i=@philpem.me.uk\n header.b=NnwMstFn; arc=none smtp.client-ip=178.62.38.78",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=philpem.me.uk;\n\ts=mail; t=1776687809;\n\tbh=vGCMlAn3ZRxZJy5AYq/flJzKXszt4Qsi2hLGeF8baJI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=NnwMstFnPSaFTU9eZ02elsf1KakiUBpX9K4dsmrpcq/SiZOR3aYyucaWZaz0PIBWS\n\t w0Z6UUJyWKvfErW4V8Eh0WQCed0AB8cfcYXMVhTfbyWLXhEi2MipW12P9T7ezWPr9h\n\t xNEMsI1u9RiJqFYDU0vt0Hr6ieNzT8L0LfORqRUk=",
        "From": "Phil Pemberton <philpem@philpem.me.uk>",
        "To": "Damien Le Moal <dlemoal@kernel.org>,\n\tNiklas Cassel <cassel@kernel.org>",
        "Cc": "\"James E . J . Bottomley\" <James.Bottomley@HansenPartnership.com>,\n\t\"Martin K . Petersen\" <martin.petersen@oracle.com>,\n\tHannes Reinecke <hare@suse.de>,\n\tlinux-ide@vger.kernel.org,\n\tlinux-scsi@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tPhil Pemberton <philpem@philpem.me.uk>",
        "Subject": "[PATCH v2 4/5] ata: libata-scsi: probe additional LUNs for multi-LUN\n ATAPI devices",
        "Date": "Mon, 20 Apr 2026 13:23:20 +0100",
        "Message-ID": "<20260420122321.4161027-5-philpem@philpem.me.uk>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260420122321.4161027-1-philpem@philpem.me.uk>",
        "References": "<20260420122321.4161027-1-philpem@philpem.me.uk>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ide@vger.kernel.org",
        "List-Id": "<linux-ide.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ide+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ide+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "After LUN 0 is added for an ATAPI device, check its BLIST_FORCELUN\nflag.  If set, call scsi_scan_target() with SCAN_WILD_CARD to trigger\nthe SCSI layer's built-in sequential LUN scan for that target only.\nThis probes LUNs 1..shost->max_lun, driven by the atapi_max_lun module\nparameter from patch 1/5.  Devices without BLIST_FORCELUN (the vast\nmajority of ATAPI devices) are left with only LUN 0 — no sequential\nscan is triggered, so single-LUN devices like the iHAS124 DVD writer\nare completely unaffected.\n\nTo suppress spurious \"No Device\" log entries from non-responding LUNs\n(e.g. LUN 2+ on a two-LUN PD/CD drive), set pdt_1f_for_no_lun on the\nscsi_target during LUN 0 configuration.  The Panasonic PD-1 returns\nPQ=0/PDT=0x1f for unpopulated LUNs rather than the standard PQ=3;\nwith this flag, scsi_probe_and_add_lun() silently skips them.\n\nIf BLIST_FORCELUN is set but atapi_max_lun is still at its default of\n1, an informational message points the user at the module parameter so\nthe knob is discoverable from dmesg.\n\nSigned-off-by: Phil Pemberton <philpem@philpem.me.uk>\n---\n drivers/ata/libata-scsi.c | 53 ++++++++++++++++++++++++++++++++-------\n 1 file changed, 44 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c\nindex 4e88ae7d94c3..9d18ef2835a5 100644\n--- a/drivers/ata/libata-scsi.c\n+++ b/drivers/ata/libata-scsi.c\n@@ -26,6 +26,7 @@\n #include <scsi/scsi_device.h>\n #include <scsi/scsi_tcq.h>\n #include <scsi/scsi_transport.h>\n+#include <scsi/scsi_devinfo.h>\n #include <linux/libata.h>\n #include <linux/hdreg.h>\n #include <linux/uaccess.h>\n@@ -1132,6 +1133,22 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,\n \t\tsdev->security_supported = 1;\n \n \tdev->sdev[sdev->lun] = sdev;\n+\n+\t/*\n+\t * Tell the SCSI scan layer that PDT 0x1f with PQ 0 means \"no LUN\n+\t * present\" for this target.  The Panasonic PD-1 (and likely other\n+\t * multi-LUN ATAPI devices) returns PQ=0/PDT=0x1f for unpopulated\n+\t * LUNs instead of the standard PQ=3.  Setting this flag lets the\n+\t * sequential LUN scan skip those LUNs cleanly.\n+\t */\n+\tif (dev->class == ATA_DEV_ATAPI && sdev->lun == 0) {\n+\t\tsdev->sdev_target->pdt_1f_for_no_lun = 1;\n+\n+\t\tif ((sdev->sdev_bflags & BLIST_FORCELUN) && atapi_max_lun < 2)\n+\t\t\tata_dev_info(dev,\n+\t\t\t\t\"device has additional LUNs; set libata.atapi_max_lun=2 or higher to access them\\n\");\n+\t}\n+\n \treturn 0;\n }\n \n@@ -4700,7 +4717,6 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)\n  repeat:\n \tata_for_each_link(link, ap, EDGE) {\n \t\tata_for_each_dev(dev, link, ENABLED) {\n-\t\t\tstruct scsi_device *sdev;\n \t\t\tint channel = 0, id = 0;\n \n \t\t\tif (dev->sdev[0])\n@@ -4711,15 +4727,34 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)\n \t\t\telse\n \t\t\t\tchannel = link->pmp;\n \n-\t\t\tsdev = __scsi_add_device(ap->scsi_host, channel, id, 0,\n-\t\t\t\t\t\t NULL);\n-\t\t\tif (!IS_ERR(sdev)) {\n-\t\t\t\tdev->sdev[0] = sdev;\n-\t\t\t\tata_scsi_assign_ofnode(dev, ap);\n-\t\t\t\tscsi_device_put(sdev);\n-\t\t\t} else {\n-\t\t\t\tdev->sdev[0] = NULL;\n+\t\t\t{\n+\t\t\t\tstruct scsi_device *sdev;\n+\n+\t\t\t\tsdev = __scsi_add_device(ap->scsi_host,\n+\t\t\t\t\t\t\t channel, id, 0, NULL);\n+\t\t\t\tif (!IS_ERR(sdev)) {\n+\t\t\t\t\t/*\n+\t\t\t\t\t * For multi-LUN ATAPI (BLIST_FORCELUN),\n+\t\t\t\t\t * trigger the sequential LUN scan.\n+\t\t\t\t\t * pdt_1f_for_no_lun (set during LUN 0\n+\t\t\t\t\t * configure) ensures non-responding LUNs\n+\t\t\t\t\t * are silently skipped.  dev->sdev[] is\n+\t\t\t\t\t * populated by ata_scsi_dev_config()\n+\t\t\t\t\t * during the scan callbacks.\n+\t\t\t\t\t */\n+\t\t\t\t\tif (dev->class == ATA_DEV_ATAPI &&\n+\t\t\t\t\t    sdev->sdev_bflags & BLIST_FORCELUN)\n+\t\t\t\t\t\tscsi_scan_target(\n+\t\t\t\t\t\t\t&ap->scsi_host->shost_gendev,\n+\t\t\t\t\t\t\tchannel, id,\n+\t\t\t\t\t\t\tSCAN_WILD_CARD,\n+\t\t\t\t\t\t\tSCSI_SCAN_RESCAN);\n+\t\t\t\t\tscsi_device_put(sdev);\n+\t\t\t\t}\n \t\t\t}\n+\n+\t\t\tif (dev->sdev[0])\n+\t\t\t\tata_scsi_assign_ofnode(dev, ap);\n \t\t}\n \t}\n \n",
    "prefixes": [
        "v2",
        "4/5"
    ]
}