On Aug 13, 2025 / 18:27, Damien Le Moal wrote: > Commit 4371fe1ba400 ("ata: libata-eh: Avoid unnecessary resets when > revalidating devices") replaced the call to ata_phys_link_offline() in > ata_eh_revalidate_and_attach() with the new function > ata_eh_link_established() which relaxes the checks on a device link > state to account for low power mode transitions. However, this changed > assumed that the device port has a valid scr_read method to obstain the > SSTATUS register for the port. This is not always the case, especially > with older IDE/PATA adapters (e.g. as emulated with qemu). For such > adapter, ata_eh_link_established() will always return false, causing > ata_eh_revalidate_and_attach() to go into its error path and ultimately > to the device being disabled. > > Avoid this by restoring the previous behavior, which is to assume that > the link is online if reading the port SSTATUS register fails. > > Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > Fixes: 4371fe1ba400 ("ata: libata-eh: Avoid unnecessary resets when revalidating devices") > Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx> Thank you for the fix. I confirmed that this patch avoids the failure of blktests test case scsi/006 with QEMU IDE/PATA device that I reported [1]. Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> [1] https://lore.kernel.org/linux-block/suhzith2uj75uiprq4m3cglvr7qwm3d7gi4tmjeohlxl6fcmv3@zu6zym6nmvun/T/#u