ncr5380: Sleep when polling, if possible
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 3 Jan 2016 05:05:22 +0000 (16:05 +1100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Jan 2016 02:42:56 +0000 (21:42 -0500)
commit2f854b82b001b5d05b4e1c81acb947f7bd9cee9f
treee0efdc6bc54882856e8e5631336cdb2b96676570
parent0ad0eff98fec3c940ec199047ff580abaaa5bb1a
ncr5380: Sleep when polling, if possible

When in process context, sleep during polling if doing so won't add
significant latency. In interrupt context or if the lock is held, poll
briefly then give up. Keep both core drivers in sync.

Calibrate busy-wait iterations to allow for variation in chip register
access times between different 5380 hardware implementations.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/NCR5380.c
drivers/scsi/NCR5380.h
drivers/scsi/atari_NCR5380.c