OSDN Git Service

scsi: wd719x: Fix resets and aborts
authorOndrej Zary <linux@zary.sk>
Mon, 17 Jun 2019 17:50:12 +0000 (19:50 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 20 Jun 2019 19:37:02 +0000 (15:37 -0400)
commit5da1faa07b7d6975a6d0266eab391f92a16aeb09
treed32e475fdf79ec6aa1134ab57c4c130dc625e515
parentfd56141244066a6a21ef458670071c58b6402035
scsi: wd719x: Fix resets and aborts

Host reset oopses because it calls wd719x_chip_init, which calls
request_firmware, under a spinlock. Stop the RISC first, then flush active
SCBs under a spinlock. Finally call wd719x_chip_init unlocked.

Also found and fixed more bugs during tests:

Affected active SCBs were not flushed during abort, bus and device
reset. This caused problems in a following host reset (hang or oops).

Device and bus reset failed under load because the result of the reset
command is WD719X_SUE_TERM or WD719X_SUE_RESET. Don't treat these codes as
error in wd719x_wait_done.

wd719x_direct_cmd for RESET/ABORT commands didn't work properly, causing
timeouts. Looks like it was caused by the WD719X_DISABLE_INT bit. Not
setting it for RESET/ABORT commands seems to fix the probem.  Also lower
the log level of the corresponding "direct command completed" message to
debug.

Unfortunately, my documentation is missing some pages, including page
67 (SPIDER67.gif) about resets :(

Reported-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Ondrej Zary <linux@zary.sk>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/wd719x.c