• John Garry's avatar
    scsi: hisi_sas: Issue internal abort on all relevant queues · 795f25a3
    John Garry authored
    To support queue mapped to a CPU, it needs to be ensured that issuing an
    internal abort is safe, in that it is guaranteed that an internal abort is
    processed for a single IO or a device after all the relevant command(s)
    which it is attempting to abort have been processed by the controller.
    
    Currently we only deliver commands for any device on a single queue to
    solve this problem, as we know that commands issued on the same queue will
    be processed in order, and we will not have a scenario where the internal
    abort is racing against a command(s) which it is trying to abort.
    
    To enqueue commands on queue mapped to a CPU, choosing a queue for an
    command is based on the associated queue for the current CPU, so this is
    not safe for internal abort since it would definitely not be guaranteed
    that commands for the command devices are issued on the same queue.
    
    To solve this issue, we take a bludgeoning approach, and issue a separate
    internal abort on any queue(s) relevant to the command or device, in that
    we will be guaranteed that at least one of these internal aborts will be
    received last in the controller.
    
    So, for aborting a single command, we can just force the internal abort to
    be issued on the same queue as the command which we are trying to abort.
    
    For aborting all commands associated with a device, we issue a separate
    internal abort on all relevant queues. Issuing multiple internal aborts in
    this fashion would have not side affect.
    Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
    Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    795f25a3
hisi_sas_v3_hw.c 92 KB