summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2026-02-24 11:06:38 +0900
committerNiklas Cassel <cassel@kernel.org>2026-02-25 07:20:18 +0100
commit46a9d97069cab311738c950d0fcef85a459c7b8f (patch)
treed61009ec37433952268ac73733e38d03998466f9 /include/linux
parentdb1d3cfaf3cd54b3fdfa63bbf40dc9f13787e65b (diff)
ata: libata-eh: avoid unnecessary calls to ata_scsi_port_error_handler()
When handling SCSI command timeouts, if we had no actual command timeouts (either because the command was a deferred qc or the completion path won the race with ata_scsi_cmd_error_handler()), we do not need to go through a port error handling, as there was in fact no errors at all. Modify ata_scsi_cmd_error_handler() to return the number of commands that timed out and use this return value in ata_scsi_error() to call ata_scsi_port_error_handler() only if we had command timeouts, or if the port EH has already been scheduled due to failed commands. Otherwise, simply call scsi_eh_flush_done_q() to finish the completed commands without running the full port error handling. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index db87c99e4189..5c085ef4eda7 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1225,7 +1225,8 @@ extern int ata_ncq_prio_enable(struct ata_port *ap, struct scsi_device *sdev,
extern struct ata_device *ata_dev_pair(struct ata_device *adev);
int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
-extern void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, struct list_head *eh_q);
+int ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap,
+ struct list_head *eh_q);
/*
* SATA specific code - drivers/ata/libata-sata.c