• Ondrej Zary's avatar
    scsi: wd719x: Fix resets and aborts · 5da1faa0
    Ondrej Zary authored
    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: default avatarHariprasad Kelam <hariprasad.kelam@gmail.com>
    Signed-off-by: default avatarOndrej Zary <linux@zary.sk>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    5da1faa0
wd719x.c 27.1 KB