提交 677bae68 编写于 作者: L Luo Jiaxing 提交者: Xie XiuQi

scsi: hisi_sas: prevent ops->hardreset() from executing at controller reset

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

In the function of hisi_sas_init_device(), we add ops->hardreset()
to clear affiliation of STP target port or handle [STP pending] state
recently.

Function hisi_sas_init_device() will be call when device found or
controller reset. At controller reset, we call hisi_sas_init_device
to re-init the disks by TMF or softreset(in case of ATA devices),
so ops->hardreset() is unnecessary and it also will cause some
delay at controller reset.

Besides, ops->hardreset() will call sas_ex_phy_discover() and it set
attached_sas_addr of ex_phy base on the respond of smp command:
SMP_DISCOVER. If we call this function at error handle, it may
misleading the handle flow of libsas.

So we prevent ops->hardreset() from executing at controller reset.
Signed-off-by: NLuo Jiaxing <luojiaxing@huawei.com>
Reviewed-by: NXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: NJohn Garry <john.garry@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 006499fe
......@@ -756,7 +756,8 @@ static int hisi_sas_init_device(struct domain_device *device)
* STP target port
*/
local_phy = sas_get_local_phy(device);
if (!scsi_is_sas_phy_local(local_phy)) {
if (!scsi_is_sas_phy_local(local_phy) &&
!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) {
unsigned long deadline = ata_deadline(jiffies, 20000);
struct sata_device *sata_dev = &device->sata_dev;
struct ata_host *ata_host = sata_dev->ata_host;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册