From: Damien Le Moal <dlemoal@kernel.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH] ata: libata-eh: avoid unnecessary calls to ata_scsi_port_error_handler()
Date: Wed, 25 Feb 2026 05:59:00 +0900 [thread overview]
Message-ID: <d27a152a-7ceb-4d85-ba26-165a6da7e2ea@kernel.org> (raw)
In-Reply-To: <aZ2wyWgR02F1cEvJ@ryzen>
On 2/24/26 23:08, Niklas Cassel wrote:
> On Tue, Feb 24, 2026 at 11:06:38AM +0900, Damien Le Moal wrote:
>> 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: Niklas Cassel <cassel@kernel.org>
>
>
>> diff --git a/include/linux/libata.h b/include/linux/libata.h
>> index db87c99e4189..c872d1f9f43b 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);
>> +extern int ata_scsi_cmd_error_handler(struct Scsi_Host *host,
>> + struct ata_port *ap, struct list_head *eh_q);
>
> Nit: we could drop the extern while touching this line anyway.
Sure. Can you fix that up when applying ?
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-02-24 20:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 2:06 [PATCH] ata: libata-eh: avoid unnecessary calls to ata_scsi_port_error_handler() Damien Le Moal
2026-02-24 14:08 ` Niklas Cassel
2026-02-24 20:59 ` Damien Le Moal [this message]
2026-02-24 21:21 ` Martin K. Petersen
2026-02-25 6:22 ` Niklas Cassel
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=d27a152a-7ceb-4d85-ba26-165a6da7e2ea@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linux-ide@vger.kernel.org \
/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