Commit 704af3bc authored by Committed by ROOLBrowse files
Fix "Too complex" errors causing invalid transfer lengths to be used
When ATA_Op reports a "Too complex" error, the truncated transfer length that it returns isn't guaranteed to be a multiple of the sector size. Make sure that we apply the appropriate rounding to the value before retrying the op. This issue was discovered while testing long descriptor page tables on 4GB IGEPv5, which has the restriction that only the low 2GB of RAM can be accessed by the SATA controller. The kernel will (via OS_Memory 19) instruct SATADriver to use a bounce buffer for any parts of a transfer which access high RAM, but SATADriver only has a limited bounce buffer size, which will force it to split the transfer with a "Too complex" error once the buffer is full. If a mix of low & high RAM is being used for a transfer then this can easily result in SATADriver suggesting a transfer length which isn't a multiple of the sector size. For 2GB/short descriptor page tables this situation is much less likely to occur, since it'd be rare for a transfer to target a non-DMAable address (would have to be a mix of RAM & IO memory) Version 4.06. Tagged as 'ADFS4-4_06'
Showing with 23 additions and 14 deletions