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>
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