• X
    scsi: hisi_sas: Try wait commands before before controller reset · a865ae14
    Xiaofei Tan 提交于
    We may reset the controller in many scenarios, such as SCSI EH and HW
    errors. There should be no IO which returns from target when SCSI EH is
    active. But for other scenarios, there may be.  It is not necessary to make
    such IOs fail.
    
    This patch adds an function of trying to wait for any commands, or IO, to
    complete before host reset. If no more CQ returned from host controller in
    100ms, we assume no more IO can return, and then stop waiting. We wait 5s
    at most.
    
    The HW has a register CQE_SEND_CNT to indicate the total number of CQs that
    has been reported to driver. We can use this register and it is reliable to
    resd this register in such scenarios that require host reset.
    Signed-off-by: NXiaofei Tan <tanxiaofei@huawei.com>
    Signed-off-by: NJohn Garry <john.garry@huawei.com>
    Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
    a865ae14
hisi_sas_v3_hw.c 74.8 KB