- Timestamp:
- May 25, 2007 8:29:27 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r2842 r2862 3617 3617 } 3618 3618 3619 if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE || s->iSourceSink != ATAFN_SS_NULL) 3620 { 3621 /* Need to continue the transfer in the async I/O thread. This is 3622 * the case for write operations or generally for not yet finished 3623 * transfers (some data might need to be read). */ 3624 ataUnsetStatus(s, ATA_STAT_READY | ATA_STAT_DRQ); 3625 ataSetStatus(s, ATA_STAT_BUSY); 3626 3627 Log2(("%s: Ctl#%d: message to async I/O thread, continuing PIO transfer\n", __FUNCTION__, ATACONTROLLER_IDX(pCtl))); 3628 ataAsyncIOPutRequest(pCtl, &ataPIORequest); 3629 } 3630 else 3631 { 3632 /* Everything finished, mark device as ready. */ 3633 ataUnsetStatus(s, ATA_STAT_DRQ); 3634 3635 Log2(("%s: Ctl#%d: skipping message to async I/O thread, ending PIO transfer\n", __FUNCTION__, ATACONTROLLER_IDX(pCtl))); 3636 ataPIOTransferStop(s); 3637 } 3619 ataUnsetStatus(s, ATA_STAT_READY | ATA_STAT_DRQ); 3620 ataSetStatus(s, ATA_STAT_BUSY); 3621 3622 Log2(("%s: Ctl#%d: message to async I/O thread, continuing PIO transfer\n", __FUNCTION__, ATACONTROLLER_IDX(pCtl))); 3623 ataAsyncIOPutRequest(pCtl, &ataPIORequest); 3638 3624 } 3639 3625 … … 4182 4168 ataSetIRQ(s); 4183 4169 4184 if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE || s->iSourceSink != ATAFN_SS_NULL) 4185 { 4186 /* Write operations and not yet finished transfers 4187 * must be completed in the async I/O thread. */ 4188 pCtl->uAsyncIOState = ATA_AIO_PIO; 4189 } 4190 else 4191 { 4192 /* Finished read operation can be handled inline 4193 * in the end of PIO transfer handling code. Linux 4194 * depends on this, as it waits only briefly for 4195 * devices to become ready after incoming data 4196 * transfer. Cannot find anything in the ATA spec 4197 * that backs this assumption, but as all kernels 4198 * are affected (though most of the time it does 4199 * not cause any harm) this must work. */ 4200 pCtl->uAsyncIOState = ATA_AIO_NEW; 4201 } 4170 pCtl->uAsyncIOState = ATA_AIO_PIO; 4202 4171 } 4203 4172 else … … 4310 4279 ataSetIRQ(s); 4311 4280 4312 if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE || s->iSourceSink != ATAFN_SS_NULL) 4313 { 4314 /* Write operations and not yet finished transfers 4315 * must be completed in the async I/O thread. */ 4316 pCtl->uAsyncIOState = ATA_AIO_PIO; 4317 } 4318 else 4319 { 4320 /* Finished read operation can be handled inline 4321 * in the end of PIO transfer handling code. Linux 4322 * depends on this, as it waits only briefly for 4323 * devices to become ready after incoming data 4324 * transfer. Cannot find anything in the ATA spec 4325 * that backs this assumption, but as all kernels 4326 * are affected (though most of the time it does 4327 * not cause any harm) this must work. */ 4328 pCtl->uAsyncIOState = ATA_AIO_NEW; 4329 } 4281 pCtl->uAsyncIOState = ATA_AIO_PIO; 4330 4282 } 4331 4283 else
Note:
See TracChangeset
for help on using the changeset viewer.