]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ata: libata-eh: avoid unnecessary calls to ata_scsi_port_error_handler()
authorDamien Le Moal <dlemoal@kernel.org>
Tue, 24 Feb 2026 02:06:38 +0000 (11:06 +0900)
committerNiklas Cassel <cassel@kernel.org>
Wed, 25 Feb 2026 06:20:18 +0000 (07:20 +0100)
commit46a9d97069cab311738c950d0fcef85a459c7b8f
treed61009ec37433952268ac73733e38d03998466f9
parentdb1d3cfaf3cd54b3fdfa63bbf40dc9f13787e65b
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>
drivers/ata/libata-eh.c
include/linux/libata.h