diff options
| author | Igor Pylypiv <ipylypiv@google.com> | 2026-04-02 09:07:05 -0700 |
|---|---|---|
| committer | Niklas Cassel <cassel@kernel.org> | 2026-04-02 20:18:29 +0200 |
| commit | 182caa17360dd48e6df08e18f00ebda0be87ab24 (patch) | |
| tree | 944b0d8d03a035ea5fcb8f32ac68e0eb2b43b743 /drivers | |
| parent | d5d286154b6cc1729b5aa0bc579902e2dbe9be5c (diff) | |
ata: libata-eh: Do not retry reset if the device is gone
If a device is hot-unplugged or otherwise disappears during error handling,
ata_eh_reset() may fail with -ENODEV. Currently, the error handler will
continue to retry the reset operation up to max_tries times.
Prevent unnecessary reset retries by exiting the loop early when
ata_do_reset() returns -ENODEV.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ata/libata-eh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index bb0813ea8b18..9a4b67b90b17 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -3181,7 +3181,7 @@ int ata_eh_reset(struct ata_link *link, int classify, sata_scr_read(link, SCR_STATUS, &sstatus)) rc = -ERESTART; - if (try >= max_tries) { + if (try >= max_tries || rc == -ENODEV) { /* * Thaw host port even if reset failed, so that the port * can be retried on the next phy event. This risks |
