summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index c72ebb8790..69e40c8a7d 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -112,8 +112,7 @@ static int wait_for_bsy(void)
112 int timeout = current_tick + HZ*10; 112 int timeout = current_tick + HZ*10;
113 last_disk_activity = timeout; 113 last_disk_activity = timeout;
114 while (TIME_BEFORE(current_tick, timeout) && (ATA_ALT_STATUS & STATUS_BSY)) 114 while (TIME_BEFORE(current_tick, timeout) && (ATA_ALT_STATUS & STATUS_BSY))
115 sleep_thread(); 115 yield();
116 wake_up_thread();
117 116
118 if (TIME_BEFORE(current_tick, timeout)) 117 if (TIME_BEFORE(current_tick, timeout))
119 return 1; 118 return 1;
@@ -132,10 +131,8 @@ static int wait_for_rdy(void)
132 timeout = current_tick + HZ*10; 131 timeout = current_tick + HZ*10;
133 last_disk_activity = timeout; 132 last_disk_activity = timeout;
134 133
135 while (TIME_BEFORE(current_tick, timeout) && 134 while (TIME_BEFORE(current_tick, timeout) && !(ATA_ALT_STATUS & STATUS_RDY))
136 !(ATA_ALT_STATUS & STATUS_RDY)) 135 yield();
137 sleep_thread();
138 wake_up_thread();
139 136
140 if (TIME_BEFORE(current_tick, timeout)) 137 if (TIME_BEFORE(current_tick, timeout))
141 return STATUS_RDY; 138 return STATUS_RDY;