freebsd-src/sys/dev/mps
Warner Losh 4c1cdd4a7c Before issing the REMOVE_DEVICE command to the firmware, make sure that all
commands have completed.

It's not OK to force complete any pending commands before we send the
REMOVE_DEVICE. Instead, make sure that all pending commands are complete before
sending that. By trying to second guess the firmware here, we run the risk of
completing commands twice, which leads to corruption.

This removes the forced completion of commands introduced in r218811. So it's a
partial backout of that commit, but replaces it with a more rebust
mechanism. Either these commands will complete due to the TARGET RESET, or they
will timeout and be aborted, but they will all complete.

Add assert that all commands are complete to REMOVE_DEVICE completion
routine. We attempt to assure this programatically, so we shouldn't have any
commands in the queue because we've waited for them all. Any commands that make
it into our action routine after we mark the target in removal will complete
immediately with an error.

When we're removing a target that's not a volume, advertise up the stack that
it's actually gone, as opposed to having a transient selection error we should
retry. Do this both in the action routine, and when we get a notification of an
aborted command. We don't do this for volumes because the driver tries hard not
to advertise to the OS a volume has disappeared.

Apply these changes to both mpr and mps since they are based on quite similar
designs.

Discussed with: scottl@
Differential Revision: https://reviews.freebsd.org/D23768
2020-02-25 04:27:23 +00:00
..
mpi
mps.c Advertise the MPI Message Version that's contained in the IOCFacts message 2020-02-07 12:15:39 +00:00
mps_config.c
mps_ioctl.h
mps_mapping.c Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
mps_mapping.h
mps_pci.c mps(4): add missing cam(4) dependency 2020-01-19 22:52:36 +00:00
mps_sas.c Before issing the REMOVE_DEVICE command to the firmware, make sure that all 2020-02-25 04:27:23 +00:00
mps_sas.h Before issing the REMOVE_DEVICE command to the firmware, make sure that all 2020-02-25 04:27:23 +00:00
mps_sas_lsi.c Fix bugs in recovery path and improve cm tracking 2019-07-08 20:20:01 +00:00
mps_table.c Add missing break statements. Coverity CID 1400446. 2019-03-27 12:25:46 +00:00
mps_table.h
mps_user.c Fix busy status leak in case of incorrect passthrough args. 2019-05-30 14:13:09 +00:00
mpsvar.h Advertise the MPI Message Version that's contained in the IOCFacts message 2020-02-07 12:15:39 +00:00