• Jeffrey Lee's avatar
    Fix "Too complex" errors causing invalid transfer lengths to be used · 704af3bc
    Jeffrey Lee authored
    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...
    704af3bc
discop 17 KB