freebsd-nq/sys/dev/mpr
Warner Losh 57aa9163fd Fix leak in state machine for commands.
When we get a device departed message from the firmware, we send a TARGET_REST
to the device to let the firmware know we're done and as part of the recovery
process. This will abort all the commands. While the documentation says the IOC
is responsible for writing the completion message for all the commands pending
with an aborted status, we sometimes have queued commands for the target that
haven't been completed so are in the INQUEUE state. So, when we later complete
the pending CCB as aborted, these commands are freed and we hit the "state not
busy" panic.

Elsewhere where we dequeue commands, we move the state to BUSY from INQUEUE. Do
that here as well. In talking to Ken, Scott and Justin, they recommended a
series of tests to see if this is 100% safe. Those tests are ongoing, but
preliminary tests suggest this is safe as we see no duplicate completions when
we hit this case at work. We have a machine that has a dodgy powersupply which
usually doesn't apply power to a few drives, but sometimes does when the machine
is under heavy load so we get a rash of the connect / disconnect messages over
half an hour. Without this change, we'd see state not busy panic. With this
change, the drives just annoyingly come and go without affecting the rest of the
machine, but without a complete error injection test suite, it's hard to know if
all edge cases are now covered or not.

Discussed with: scottl, ken, gibbs
2019-11-24 15:24:05 +00:00
..
mpi Update MPI header files version to 2.00.52 from 2.00.48 2018-12-26 10:38:12 +00:00
mpr_config.c Update copyright information 2018-12-26 10:43:31 +00:00
mpr_ioctl.h Update copyright information 2018-12-26 10:43:31 +00:00
mpr_mapping.c Update copyright information 2018-12-26 10:43:31 +00:00
mpr_mapping.h Update copyright information 2018-12-26 10:43:31 +00:00
mpr_pci.c Add Sea,Aero adapter support 2018-12-26 10:41:14 +00:00
mpr_sas_lsi.c Fix bugs in recovery path and improve cm tracking 2019-07-08 20:20:01 +00:00
mpr_sas.c Fix leak in state machine for commands. 2019-11-24 15:24:05 +00:00
mpr_sas.h Update copyright information 2018-12-26 10:43:31 +00:00
mpr_table.c Add missing break statements. Coverity CID 1400446. 2019-03-27 12:25:46 +00:00
mpr_table.h Convert some in-line printing of diagnostic into tables. 2017-09-09 22:02:36 +00:00
mpr_user.c Fix busy status leak in case of incorrect passthrough args. 2019-05-30 14:13:09 +00:00
mpr.c More fully implement the state machine. 2019-07-11 06:22:15 +00:00
mprvar.h Fix bugs in recovery path and improve cm tracking 2019-07-08 20:20:01 +00:00