diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index ce8ab1085936cabeed5ea5237376cfe25a5f016c..cad057d25a29761db257f24c1d53368b96989bf0 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -659,8 +659,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
 		stat = hwif->INB(IDE_STATUS_REG);
 	}
 
-	if (!OK_STAT(stat, READY_STAT, BAD_STAT))
-		return ide_error(drive, "drive_cmd", stat);
+	if (!OK_STAT(stat, (pio_in ? 0 : READY_STAT), BAD_STAT))
+		return ide_error(drive, __FUNCTION__, stat);
 		/* calls ide_end_drive_cmd */
 	ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG));
 	return ide_stopped;