From: Luca Lauro via B4 Relay <devnull+famlauro93l.gmail.com@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>,
"open list:BAREBOX" <barebox@lists.infradead.org>
Cc: Luca Lauro <famlauro93l@gmail.com>
Subject: [PATCH v4 11/14] ata: ahci: add helper for ATA commands without data
Date: Thu, 13 Aug 2026 17:26:31 +0200 [thread overview]
Message-ID: <20260813-rn102-rn104-series-v4-11-f932ac63efa0@gmail.com> (raw)
In-Reply-To: <20260813-rn102-rn104-series-v4-0-f932ac63efa0@gmail.com>
From: Luca Lauro <famlauro93l@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@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
next prev parent reply other threads:[~2026-08-13 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 15:26 [PATCH v4 00/14] (no cover subject) Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 01/14] ARM: mvebu: add Netgear RN102 support Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 02/14] ARM: mvebu: enable RN102 in mvebu_defconfig Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 03/14] ARM: mvebu: improve Netgear RN104 support Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 04/14] ARM: mvebu: rename PUTC_LL to MVEBU_PUTC_LL Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 05/14] drivers: fan: add fan subsystem, core API and G76x fan controller driver Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 06/14] commands: add fan control command Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 07/14] usb: ehci: add Marvell EHCI host controller driver Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 08/14] usb: ehci: initialize periodic_queue_dma Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 09/14] ata: ahci: add PCI AHCI and Marvell 9170 controller support Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 10/14] ata: ahci: fix zero-length DMA handling Luca Lauro via B4 Relay
2026-08-13 15:26 ` Luca Lauro via B4 Relay [this message]
2026-08-13 15:26 ` [PATCH v4 12/14] ata: ahci: improve AHCI port bring-up sequence Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 13/14] ata: ahci: add FLUSH EXT and STANDBY IMMEDIATE support during shutdown Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 14/14] ata: ahci: cleanup legacy code and remove unused paths Luca Lauro via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260813-rn102-rn104-series-v4-11-f932ac63efa0@gmail.com \
--to=devnull+famlauro93l.gmail.com@kernel.org \
--cc=barebox@lists.infradead.org \
--cc=famlauro93l@gmail.com \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox