summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorNiklas Cassel <niklas.cassel@wdc.com>2022-10-07 15:23:40 +0200
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-10-19 13:46:08 +0900
commit5122e53ee784b9a2a2f40d34222751b6b4ab076c (patch)
tree7a636ece9bb4c0c65920727a68adfc8dd521e324 /drivers/ata
parent7834589e81bcf5fe4e7ab60430670c9245183de0 (diff)
downloadlinux-5122e53ee784b9a2a2f40d34222751b6b4ab076c.tar.bz2
ata: libata-core: do not retry reading the log on timeout
ata_read_log_page() first tries to read the log using READ LOG DMA EXT. If that fails it will instead try to read the log using READ LOG EXT. ata_exec_internal_sg() is synchronous, so it will wait for the command to finish. If we actually got an error back from the device, it is correct to retry. However, if the command timed out, ata_exec_internal_sg() will freeze the port. There is no point in retrying if the port is frozen, as ata_exec_internal_sg() will return AC_ERR_SYSTEM on a frozen port, without ever sending the command down to the drive. Therefore, avoid retrying if the first command froze the port, as that will result in a misleading AC_ERR_SYSTEM error print, instead of printing the error that actually caused the port to be frozen (AC_ERR_TIMEOUT). Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 695a20dee1d1..884ae73b11ea 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2000,7 +2000,8 @@ retry:
if (err_mask) {
if (dma) {
dev->horkage |= ATA_HORKAGE_NO_DMA_LOG;
- goto retry;
+ if (!ata_port_is_frozen(dev->link->ap))
+ goto retry;
}
ata_dev_err(dev,
"Read log 0x%02x page 0x%02x failed, Emask 0x%x\n",