Skip to content

Commit 182caa1

Browse files
ipylypivfloatious
authored andcommitted
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>
1 parent d5d2861 commit 182caa1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/ata/libata-eh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3181,7 +3181,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
31813181
sata_scr_read(link, SCR_STATUS, &sstatus))
31823182
rc = -ERESTART;
31833183

3184-
if (try >= max_tries) {
3184+
if (try >= max_tries || rc == -ENODEV) {
31853185
/*
31863186
* Thaw host port even if reset failed, so that the port
31873187
* can be retried on the next phy event. This risks

0 commit comments

Comments
 (0)