atari_NCR5380: Refactor Falcon locking
authorFinn Thain <fthain@telegraphics.com.au>
Wed, 12 Nov 2014 05:12:15 +0000 (16:12 +1100)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 Nov 2014 08:11:17 +0000 (09:11 +0100)
commite3c3da67340ac7d1d2f630f319eb718474b0d9c3
tree3786bf1885076bc2ef606aab34d0f9cd357c7980
parentef1081cbf05b22d3d0e05b267a5559a8cd8e8d4a
atari_NCR5380: Refactor Falcon locking

Simplify falcon_release_lock_if_possible() by making callers responsible for
disabling local IRQ's, which they must do anyway to correctly synchronize
the ST DMA "lock" with core driver data structures. Move this
synchronization logic to the core driver with which it is tightly coupled.

Other LLD's like sun3_scsi and mac_scsi that can make use of this core
driver can just stub out the NCR5380_acquire_dma_irq() and
NCR5380_release_dma_irq() calls so the compiler will eliminate the
ST DMA code.

Remove a redundant local_irq_save/restore pair (irq's are disabled for
interrupt handlers these days). Revise the locking for
atari_scsi_bus_reset(): use local_irq_save/restore() instead of
atari_turnoff/turnon_irq(). There is no guarantee that atari_scsi still
holds the ST DMA lock during EH, so atari_turnoff/turnon_irq() could
end up dropping an IDE or floppy interrupt.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/atari_NCR5380.c
drivers/scsi/atari_scsi.c