From: Tejun Heo Date: Wed, 23 May 2007 09:22:15 +0000 (+0200) Subject: libata: don't consider 0xff as port empty if SStatus is available X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd7fe701612e42fb8780d7bf61fbb0467a488c9b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git libata: don't consider 0xff as port empty if SStatus is available Some SATA controllers (sata_sil) use 0xff to indicate port not ready status, not port empty. As libata interprets 0xff as port empty, this causes unnecessary reset failure and retry. Don't consider 0xff as port empty if SStatus is available and indicates that port is online. Signed-off-by: tejun Heo Cc: Paul Mundt Cc: Indan Zupancic Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a6de57e02047..5788a9dd0445 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3022,7 +3022,7 @@ int ata_wait_ready(struct ata_port *ap, unsigned long deadline) if (!(status & ATA_BUSY)) return 0; - if (status == 0xff) + if (!ata_port_online(ap) && status == 0xff) return -ENODEV; if (time_after(now, deadline)) return -EBUSY;