[PATCH v4 11/14] ata: ahci: add helper for ATA commands without data
Luca Lauro via B4 Relay
devnull+famlauro93l.gmail.com at kernel.org
Thu Aug 13 08:26:31 PDT 2026
From: Luca Lauro <famlauro93l at gmail.com>
Introduce ahci_ata_nodata(), a small wrapper that prepares a FIS and
submits an AHCI command without PRDT entries or DMA setup. This avoids
duplicating zero-length handling logic across callers and simplifies
ATA command submission paths.
Signed-off-by: Luca Lauro <famlauro93l at gmail.com>
---
drivers/ata/ahci.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ea2df31515..1175d76881 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -233,6 +233,21 @@ static int ahci_io(struct ahci_port *ahci_port, u8 *fis, int fis_len, void *rbuf
return ret;
}
+static int ahci_ata_nodata(struct ahci_port *ahci, u8 command, u8 feature)
+{
+ u8 fis[20] = {
+ 0x27, /* Host to device FIS */
+ 1 << 7, /* Command FIS */
+ command, /* Command */
+ feature, /* Features */
+ };
+
+ if (!ahci_link_ok(ahci, 0))
+ return -ENODEV;
+
+ return ahci_io(ahci, fis, sizeof(fis), NULL, NULL, 0);
+}
+
/*
* SCSI INQUIRY command operation.
*/
--
2.47.3
More information about the barebox
mailing list