mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
ncr5380: Fix pseudo DMA transfers on 53C400
Pseudo-DMA (PDMA) has been broken for ages, resulting in hangs on 53C400-based cards. According to 53C400 datasheet, PDMA transfer length must be a multiple of 128. Check if that's true and use PIO if it's not. This makes PDMA work on 53C400 (Canon FG2-5202). Signed-off-by: Ondrej Zary <[email protected]> Signed-off-by: Finn Thain <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
3d07d22b3d
commit
f03946210d
1 changed files with 4 additions and 0 deletions
|
|
@ -702,6 +702,10 @@ static int generic_NCR5380_dma_xfer_len(struct scsi_cmnd *cmd)
|
|||
!(cmd->SCp.this_residual % transfersize))
|
||||
transfersize = 32 * 1024;
|
||||
|
||||
/* 53C400 datasheet: non-modulo-128-byte transfers should use PIO */
|
||||
if (transfersize % 128)
|
||||
transfersize = 0;
|
||||
|
||||
return transfersize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue