• Finn Thain's avatar
    atari_NCR5380: Refactor Falcon locking · e3c3da67
    Finn Thain authored
    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: default avatarFinn Thain <fthain@telegraphics.com.au>
    Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    e3c3da67
atari_NCR5380.c 89 KB