]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: g_NCR5380: Re-work PDMA loops
authorOndrej Zary <linux@rainbow-software.org>
Mon, 3 Jul 2017 07:59:06 +0000 (03:59 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 7 Aug 2017 18:04:00 +0000 (14:04 -0400)
commitad3f7658a7ddda5c77d3ce8c6d77ab657cd6aa55
treee6cd80216efa3409984f6f3634b096fd7fdcc3f8
parentb04018c6ef0da36dc70cc9fb9a85613eb0103305
scsi: g_NCR5380: Re-work PDMA loops

The polling loops in pread() and pwrite() can easily become infinite
loops and hang the machine.

Merge the IRQ check into host buffer wait loop and add polling limit.

Also place a limit on polling for 53C80 registers accessibility.

[Use NCR5380_poll_politely2() for register polling. Rely on polling for
gated IRQ rather than polling for phase error, like the algorithm in the
53c400 datasheet. Move DTC436 workarounds into a separate patch.
Factor-out common code as wait_for_53c80_access(). Rework the residual
calculations. -- F.T.]

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/g_NCR5380.c