summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata.h
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2024-08-28 09:27:04 +0200
committerDamien Le Moal <dlemoal@kernel.org>2024-08-29 03:06:11 +0200
commit9526dec226f0779d72f798e7a18375bf8d414775 (patch)
tree97bfadd80a59214718c44c36198420aa589893be /drivers/ata/libata.h
parentata: ahci_brcm: Use devm_platform_ioremap_resource_byname() helper function (diff)
downloadlinux-9526dec226f0779d72f798e7a18375bf8d414775.tar.xz
linux-9526dec226f0779d72f798e7a18375bf8d414775.zip
ata: libata: Add helper ata_eh_decide_disposition()
Every time I see libata code calling scsi_check_sense(), I get confused why the code path that is working fine for SCSI code, is not sufficient for libata code. The reason is that SCSI usually gets the sense data as part of the completion, and will thus automatically call scsi_check_sense(), which will set the SCSI ML byte (if any). However, for libata queued commands, we always need to fetch the sense data via SCSI EH, and thus do not get the luxury of having scsi_check_sense() called automatically. Add a new helper, ata_eh_decide_disposition(), that has a ata_eh_ prefix to more clearly highlight that this is only needed for code called by EH, while also having a similar name to scsi_decide_disposition(), such that it is easier to compare the libata code with the equivalent SCSI code. Also add a big kdoc comment explaining why this helper is called/needed in the first place. Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r--drivers/ata/libata.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 22e667394368..ab4bd44ba17c 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -161,6 +161,7 @@ extern void ata_eh_finish(struct ata_port *ap);
extern int ata_ering_map(struct ata_ering *ering,
int (*map_fn)(struct ata_ering_entry *, void *),
void *arg);
+enum scsi_disposition ata_eh_decide_disposition(struct ata_queued_cmd *qc);
extern unsigned int atapi_eh_tur(struct ata_device *dev, u8 *r_sense_key);
extern unsigned int atapi_eh_request_sense(struct ata_device *dev,
u8 *sense_buf, u8 dfl_sense_key);