From 70e4d825243226e07ef26612908b39e7961c63ec Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 7 Oct 2021 20:21:01 +0900 Subject: [PATCH] ata: fix bad timeout on ATAPI initialization, fixes vbox seeing the CD --- modules/ata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ata.c b/modules/ata.c index ce596648..315876d2 100644 --- a/modules/ata.c +++ b/modules/ata.c @@ -594,7 +594,7 @@ static int atapi_device_init(struct ata_device * dev) { while (1) { uint8_t status = inportb(dev->io_base + ATA_REG_STATUS); if ((status & ATA_SR_ERR)) goto atapi_error; - if (timeout-- < 100) goto atapi_timeout; + if (timeout-- < 0) goto atapi_timeout; if (!(status & ATA_SR_BSY) && (status & ATA_SR_DRDY)) break; } @@ -607,7 +607,7 @@ static int atapi_device_init(struct ata_device * dev) { while (1) { uint8_t status = inportb(dev->io_base + ATA_REG_STATUS); if ((status & ATA_SR_ERR)) goto atapi_error_read; - if (timeout-- < 100) goto atapi_timeout; + if (timeout-- < 0) goto atapi_timeout; if (!(status & ATA_SR_BSY) && (status & ATA_SR_DRDY)) break; if ((status & ATA_SR_DRQ)) break; }