]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r358308:
authorWarner Losh <imp@FreeBSD.org>
Thu, 28 May 2020 23:23:49 +0000 (23:23 +0000)
committerWarner Losh <imp@FreeBSD.org>
Thu, 28 May 2020 23:23:49 +0000 (23:23 +0000)
commitb5ea3046503b88f95aa68e7f36a94e2503e8d1ef
tree102af641c84c11e0be15d489c24b1019ff542128
parent3183744d998ef4697b3b61ad4ca9e933347589f3
MFC r358308:

    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
sys/dev/mpr/mpr_sas.c
sys/dev/mpr/mpr_sas.h
sys/dev/mps/mps_sas.c
sys/dev/mps/mps_sas.h