[PATCH v2 0/4] ata: libata-scsi: fix ATA PASS-THROUGH(32) handling
From: shao.mingyin
Date: Wed Nov 11 2026 - 09:45:12 EST
ATA PASS-THROUGH(32) still has translation and completion paths that
interpret fields as if the command used a 12- or 16-byte CDB.
Patch 1 skips the nonexistent MULTIPLE_COUNT field and corrects the
invalid-PROTOCOL field pointer. Patch 2 rejects unsupported service
actions with sense data. Patch 3 honors CK_COND and generates SAT sense
on completion. Patch 4 corrects the remaining invalid-field pointers,
including distinguishing READ/WRITE LONG protocol and count errors.
The four patches can be applied independently; the numbered order groups
the related translation fixes together.
Changes in v2, following Niklas Cassel's review:
- Do not interpret byte 10 bits 7:5 as MULTIPLE_COUNT. Skip the CDB
count checks for the 32-byte form, keeping the device-mode check.
- Move the unrelated invalid-PROTOCOL hunk from patch 3 to patch 1.
- Keep patch 2's code unchanged and add patch 4 for the remaining
PROTOCOL, FEATURES, COMMAND and sector-count field pointers.
- Generate all diffs and indexes from Git commits. Validate the exact
resulting blobs and include observed field-pointer helper arguments
from userspace function tests in the per-patch notes.
- Keep the Reviewed-by tags on patches 2 and 3: patch 2 is unchanged,
and patch 3 only loses the hunk moved to patch 1. Patch 1 changes the
MULTIPLE_COUNT handling itself, so its v1 tag does not apply.
Link to v1: https://lore.kernel.org/all/20261104220832716LXKf7OaS9dt1VJ8Q959AG@xxxxxxxxxx/
Review: https://lore.kernel.org/all/avI7-lrzsRL_Gz75@ryzen/
Shao Mingyin (4):
ata: libata-scsi: skip MULTIPLE_COUNT for 32-byte passthru
ata: libata-scsi: reject unsupported ATA-32 service actions
ata: libata-scsi: generate SAT sense data for ATA PASS-THROUGH(32)
ata: libata-scsi: fix remaining passthru field pointers
drivers/ata/libata-scsi.c | 64 ++++++++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 20 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b