提交 710b333a 编写于 作者: X Xiaofei Tan 提交者: Xie XiuQi

scsi: hisi_sas: release remain resources when dev gone

We should ensure that all resources of device are freed before gone.
In fact, upper layer can ensure that all upper layer IOs are finished
when get dev gone. But for some LLDD internal failed IOs, LLDD resources
may not freed. So, this patch release remain LLDD resources before dev
gone if there are.
Signed-off-by: NXiaofei Tan <tanxiaofei@huawei.com>
上级 a5a22771
...@@ -866,6 +866,10 @@ static void hisi_sas_dev_gone(struct domain_device *device) ...@@ -866,6 +866,10 @@ static void hisi_sas_dev_gone(struct domain_device *device)
HISI_SAS_INT_ABT_DEV, 0); HISI_SAS_INT_ABT_DEV, 0);
hisi_sas_dereg_device(hisi_hba, device); hisi_sas_dereg_device(hisi_hba, device);
if (!list_empty(&sas_dev->list)) {
hisi_sas_release_task(hisi_hba, device);
dev_info(dev, "dev gone: release remain resources anyway.\n");
}
down(&hisi_hba->sem); down(&hisi_hba->sem);
hisi_hba->hw->clear_itct(hisi_hba, sas_dev); hisi_hba->hw->clear_itct(hisi_hba, sas_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册