]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: atari_scsi: Fix race condition between .queuecommand and EH
authorFinn Thain <fthain@telegraphics.com.au>
Fri, 20 Nov 2020 04:39:56 +0000 (15:39 +1100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Nov 2020 03:12:09 +0000 (22:12 -0500)
commit61bae5a4ccc5f6ae9695cbcbf716e60ecf3e5eb8
treed3ed4bbb0cbcea87439e6bb56cfa1625c8acceb7
parentadb3acf6bedf2389ef538864c0094d7017e7c417
scsi: atari_scsi: Fix race condition between .queuecommand and EH

It is possible that bus_reset_cleanup() or .eh_abort_handler could be
invoked during NCR5380_queuecommand(). If that takes place before the new
command is enqueued and after the ST-DMA "lock" has been acquired, the
ST-DMA "lock" will be released again. This will result in a lost DMA
interrupt and a command timeout. Fix this by excluding EH and interrupt
handlers while the new command is enqueued.

Link: https://lore.kernel.org/r/af25163257796b50bb99d4ede4025cea55787b8f.1605847196.git.fthain@telegraphics.com.au
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/NCR5380.c
drivers/scsi/atari_scsi.c