Cover Letter Detail
Show a cover letter.
GET /api/1.2/covers/2233890/?format=api
{ "id": 2233890, "url": "http://patchwork.ozlabs.org/api/1.2/covers/2233890/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ide/cover/20260506234548.1974603-1-philpem@philpem.me.uk/", "project": { "id": 13, "url": "http://patchwork.ozlabs.org/api/1.2/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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260506234548.1974603-1-philpem@philpem.me.uk>", "list_archive_url": null, "date": "2026-05-06T23:45:41", "name": "[v4,0/7] ata: libata-scsi: multi-LUN ATAPI device support", "submitter": { "id": 93108, "url": "http://patchwork.ozlabs.org/api/1.2/people/93108/?format=api", "name": "Phil Pemberton", "email": "philpem@philpem.me.uk" }, "mbox": "http://patchwork.ozlabs.org/project/linux-ide/cover/20260506234548.1974603-1-philpem@philpem.me.uk/mbox/", "series": [ { "id": 503084, "url": "http://patchwork.ozlabs.org/api/1.2/series/503084/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=503084", "date": "2026-05-06T23:45:42", "name": "ata: libata-scsi: multi-LUN ATAPI device support", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/503084/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2233890/comments/", "headers": { "Return-Path": "\n <linux-ide+bounces-5691-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=pokDPXzH;\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-ide+bounces-5691-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=\"pokDPXzH\"", "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 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 4g9sVd3jLTz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 09:47:05 +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 970A83037166\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 6 May 2026 23:46:04 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5B83F3D646E;\n\tWed, 6 May 2026 23:45:59 +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 A1AF462809;\n\tWed, 6 May 2026 23:45:55 +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 D48D9BD55C;\n\tWed, 6 May 2026 23:45:53 +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 714A25F8AD;\n\tThu, 7 May 2026 00:45:53 +0100 (BST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778111159; cv=none;\n b=A4DYtKFYNkb5FFzMIwRGYV801qQ3QVY/f/gSO2tJm/0WwcsOUyW3dbPzHTFQzrLQkv8nkH6/HrATXPAth/BONdTLQNTAPxvGUU/UFLg4Tr22vpQ0REsHCP1YKuSu6gyrPa4fX9OnHsUoT4QaXwaWqjmuKi7qvlynERBtAzXQr0U=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778111159; c=relaxed/simple;\n\tbh=qJ+np+8O5wz7m1vWjuaQKj1LYUTIbZmMzvAqL317g4w=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=BhQ9Nu4Lt/Z1mulu3r7er66Y3Yxk4FGQ0WKyKrVpGSrJoLTFWdcsSqSr97aGOmNNtaogl2l4kd42u8XzwcVXiP8gMZpXIrZOdAueBnCPIG5T3ejIZZ4HP0WiXeDcqWzRt5EtmOamLaO+4d5zlTjZPCy2bzC/PhI+6y0P5hnszoU=", "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=pokDPXzH; 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=1778111153;\n\tbh=qJ+np+8O5wz7m1vWjuaQKj1LYUTIbZmMzvAqL317g4w=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=pokDPXzHAe7gdKL6l39L/i4SRtw2BU2oCabO29OcA4/7ofkqE5SjL9hEvNB7xIREt\n\t +ADTNtielhpesB8XQgoyVk+hxVBJURujbUzXlOVBoWcSEh2xzm72Si//LfufROHSa7\n\t YZG+NcXcphOrTslN7r33HyvzFNzvVnNCoqkttyak=", "From": "Phil Pemberton <philpem@philpem.me.uk>", "To": "linux-ide@vger.kernel.org,\n\tlinux-scsi@vger.kernel.org", "Cc": "linux-kernel@vger.kernel.org,\n\tDamien Le Moal <dlemoal@kernel.org>,\n\tNiklas Cassel <cassel@kernel.org>,\n\t\"James E . J . Bottomley\" <James.Bottomley@HansenPartnership.com>,\n\t\"Martin K . Petersen\" <martin.petersen@oracle.com>,\n\tHannes Reinecke <hare@suse.de>,\n\tPhil Pemberton <philpem@philpem.me.uk>", "Subject": "[PATCH v4 0/7] ata: libata-scsi: multi-LUN ATAPI device support", "Date": "Thu, 7 May 2026 00:45:41 +0100", "Message-ID": "<20260506234548.1974603-1-philpem@philpem.me.uk>", "X-Mailer": "git-send-email 2.43.0", "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": "Hi all,\n\nThis is v4, addressing review feedback from Damien Le Moal and Hannes\nReinecke on v3.\n\nThis series gives libata support for ATAPI devices with multiple LUNs,\nsuch as the Panasonic PD-1 PD/CD combo drive. This exposes both the\nCD-ROM and rewritable PD optical interfaces: CD-ROM as LUN 0 and PD\nas LUN 1.\n\nlibata has never supported multi-LUN ATAPI. This series adds support\nby fixing the following limitations:\n\n 1. shost->max_lun is hardcoded to 1 in ata_scsi_add_hosts(), preventing\n the SCSI layer from probing any LUN beyond 0.\n\n 2. __ata_scsi_find_dev() rejects all commands where scsidev->lun != 0,\n returning NULL and resulting in DID_BAD_TARGET.\n\n 3. The SCSI-2 CDB LUN field (byte 1, bits 7:5) is never populated.\n ATAPI tunnels SCSI commands over the ATA PACKET interface, and the\n transport-layer LUN addressing used by SPC-3+ is not available.\n Older multi-LUN ATAPI devices rely on this CDB field to route\n commands to the correct LUN.\n\n 4. ata_scsi_scan_host() only calls __scsi_add_device() for LUN 0,\n never probing additional LUNs even when the SCSI device info table\n would indicate the device supports them.\n\n 5. dev->sdev is a single pointer, but multi-LUN ATAPI puts multiple\n sdevs behind one ata_device. Every call to ata_scsi_dev_config()\n overwrote the pointer, and ata_scsi_sdev_destroy() tore down the\n entire ATA device whenever any sdev was destroyed -- so removing a\n spurious LUN result during scanning would kill the whole port, and\n the other users of dev->sdev (scsi_remove_device in\n ata_port_detach(), ACPI uevents, zpodd, media-change notify,\n suspend/resume rescan) could only ever see one LUN.\n\nChanges from v3:\n\n - 1/7 unchanged; carries Hannes' Reviewed-by from v2.\n\n - 2/7 (sdev array): added a per-device dev->nr_luns field so the\n common single-LUN case iterates one slot rather than ATAPI_MAX_LUN\n (8). Added an inline ata_dev_scsi_device(dev, lun) helper with a\n WARN_ON_ONCE(lun >= dev->nr_luns) bounds check, and converted the\n hardcoded LUN-0 references in libata-acpi (uevent kobj),\n libata-zpodd (disk events, wake notify), and the door-lock and\n OF-node paths in libata-scsi to use it. Hannes' v2 Reviewed-by\n has been dropped given the scope of the rework.\n\n - 3/7 (LUN routing): hoisted the non-zero LUN handling to the top of\n __ata_scsi_find_dev() so the original channel/id rejection logic\n is left structurally unchanged. Replaced the bare \"lun >= 8\" gate\n in atapi_xlat() with WARN_ON_ONCE(lun >= dev->nr_luns); the SCSI\n layer caps lun at shost->max_lun (<= ATAPI_MAX_LUN), so this\n should never trigger in practice.\n\n - 4/7 (BLIST_NO_LUN_1F): use sdev->sdev_bflags (just assigned)\n rather than re-dereferencing *bflags, and dropped a stray blank\n line. Picked up Reviewed-by tags from Damien and Hannes.\n\n - 5/7 (probe extra LUNs): dropped the introduced inner { } scope\n around sdev so the declaration sits at its original spot at the\n top of the loop body. Bump dev->nr_luns to the host's max_lun\n before calling scsi_scan_target() so the probe INQUIRYs to LUN > 0\n are accepted by atapi_xlat(). Stale \"see patch X\" cross-references\n have been removed from the changelog.\n\n - 6/7 (COMPAQ PD-1): unchanged; picked up Reviewed-by tags from\n Damien and Hannes.\n\n - 7/7 (MATSHITA + NEC PD-1): unchanged; picked up Reviewed-by tag\n from Damien. Kept as a separate patch from 6/7: the variants are\n untested (the author only has the COMPAQ unit), and being a\n standalone patch lets maintainers drop or hold it independently\n from the rest of the series.\n\nThe series is split as:\n\n 1/7: libata-scsi: add libata.atapi_max_lun module parameter.\n\n 2/7: libata-scsi: convert dev->sdev to a per-LUN array, add\n dev->nr_luns and the ata_dev_scsi_device() helper, and update\n every caller.\n\n 3/7: libata-scsi: relax __ata_scsi_find_dev() to accept non-zero LUN\n for ATAPI devices, and encode the LUN in CDB byte 1 bits 7:5.\n\n 4/7: scsi: add a BLIST_NO_LUN_1F blacklist flag, which sets\n scsi_target.pdt_1f_for_no_lun for matching devices so that\n PDT 0x1f / PQ 0 INQUIRY responses are treated as \"LUN not\n present\" and silently skipped.\n\n 5/7: libata-scsi: after adding LUN 0, trigger scsi_scan_target() for\n BLIST_FORCELUN ATAPI devices only. Single-LUN devices are\n completely unaffected.\n\n 6/7: scsi_devinfo: add the COMPAQ-branded variant of the PD-1 to the\n device info table with BLIST_FORCELUN | BLIST_SINGLELUN |\n BLIST_NO_LUN_1F.\n\n 7/7: scsi_devinfo: extend BLIST_NO_LUN_1F to the MATSHITA and NEC\n PD-1 variants. Untested on those OEM units (the author only\n has the COMPAQ-branded drive), but all three appear to use the\n same Panasonic LF-1095/LF-1195 mechanism and firmware family,\n so the quirk is expected to apply equally. Kept separate so\n it can be dropped independently if confirmation on MATSHITA or\n NEC hardware is preferred.\n\nTested on a Panasonic LF-1195C PD/CD (Compaq branded) attached to an\nata_piix host on i686, kernel 7.0.0-rc7+, with libata.atapi_max_lun=7.\nBoth LUNs enumerate correctly: the CD-ROM as sr0 and the PD as sda.\nReads from each device succeed against the appropriate media.\nNon-responding LUNs are silently skipped (no spurious \"No Device\"\nentries in dmesg). An iHAS124 DVD writer on the same machine\n(single-LUN, no BLIST_FORCELUN entry) is unaffected: only LUN 0 is\nscanned.\n\nTwo known limitations around media-change detection on multi-LUN\nATAPI devices with a shared physical media slot (e.g. PD/CD combos\nflagged BLIST_SINGLELUN):\n\n1. The block layer disables in-kernel polling by default\n (block.events_dfl_poll_msecs defaults to 0). Without polling,\n sd_check_events never runs and media insertion on the PD LUN is\n not detected automatically. sr_mod is unaffected because it\n re-reads the TOC on every open.\n\n Workaround -- either globally via kernel boot parameter:\n\n block.events_dfl_poll_msecs=2000\n\n or per-device via udev rule:\n\n ACTION==\"add\", KERNEL==\"sd*\", \\\n ATTRS{vendor}==\"COMPAQ \", ATTRS{model}==\"PD-1*\", \\\n ATTR{events_poll_msecs}=\"2000\"\n\n Even with polling enabled the sd path does not always pick up\n fresh media on this firmware; `blockdev --rereadpt /dev/sdX`\n reliably forces a revalidate and proves the libata routing\n itself is correct.\n\n2. Media-change sense is not propagated across sibling LUNs. When\n one LUN reports UNIT ATTENTION (ASC 0x28 or 0x3A), the other LUNs\n are not notified. With polling enabled, sd_check_events detects\n the change independently on each LUN via TUR, so this is mainly a\n latency issue rather than a functional one. A follow-up to\n propagate media-change events to sibling LUNs in\n atapi_qc_complete is straightforward but deferred to keep this\n series focused on the LUN-scanning core.\n\nSuspend/resume with multi-LUN ATAPI attached has not yet been tested;\nthis is on the list. ata_scsi_dev_rescan iterates all populated LUN\nslots, and the SCSI layer's host-level suspend tracking already\nserialises port quiesce, so no additional per-LUN suspend counting\nis needed in libata.\n\nComments and suggestions welcome.\n\nPhil Pemberton (7):\n ata: libata-scsi: add atapi_max_lun module parameter\n ata: libata-scsi: convert dev->sdev to per-LUN array\n ata: libata-scsi: route non-zero LUN commands for multi-LUN ATAPI\n scsi: add BLIST_NO_LUN_1F blacklist flag\n ata: libata-scsi: probe additional LUNs for multi-LUN ATAPI devices\n scsi: scsi_devinfo: add COMPAQ PD-1 multi-LUN ATAPI device quirk\n scsi: scsi_devinfo: extend BLIST_NO_LUN_1F to MATSHITA and NEC PD-1\n variants\n\n drivers/ata/libata-acpi.c | 6 +-\n drivers/ata/libata-core.c | 16 ++-\n drivers/ata/libata-scsi.c | 208 +++++++++++++++++++++++-------------\n drivers/ata/libata-zpodd.c | 6 +-\n drivers/ata/libata.h | 1 +\n drivers/scsi/scsi_devinfo.c | 8 +-\n drivers/scsi/scsi_scan.c | 2 +\n include/linux/libata.h | 12 ++-\n include/scsi/scsi_devinfo.h | 6 +-\n 9 files changed, 175 insertions(+), 90 deletions(-)" }