Unverified Commit 916c2454 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!503 SAS-related bugfix:rolls back these policies without disabling the hard disk PHY.

Merge Pull Request from: @xia-bing1 
 
SATA disks do not support multiple hosts at the same time. When the same disk is dually connected after power-on, the host that connects to the disk reports an I/O error, which triggers the disk PHY to be disabled.
Solution:
The open-source Hisisas rolls back these policies without disabling the hard disk PHY. 
 
Link:https://gitee.com/openeuler/kernel/pulls/503

 

Reviewed-by: default avatarYihang Li <liyihang9@huawei.com>
Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 2237604e afa6401d
Loading
Loading
Loading
Loading
+5 −24
Original line number Diff line number Diff line
@@ -1917,33 +1917,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
	}
	hisi_sas_dereg_device(hisi_hba, device);

	rc = hisi_sas_debug_I_T_nexus_reset(device);
	if (rc == TMF_RESP_FUNC_COMPLETE && dev_is_sata(device)) {
		struct sas_phy *local_phy;

	if (dev_is_sata(device)) {
		rc = hisi_sas_softreset_ata_disk(device);
		switch (rc) {
		case -ECOMM:
			rc = -ENODEV;
			break;
		case TMF_RESP_FUNC_FAILED:
		case -EMSGSIZE:
		case -EIO:
			local_phy = sas_get_local_phy(device);
			rc = sas_phy_enable(local_phy, 0);
			if (!rc) {
				local_phy->enabled = 0;
				dev_err(dev, "Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n",
		if (rc == TMF_RESP_FUNC_FAILED)
			dev_err(dev, "ata disk %016llx reset (%d)\n",
				SAS_ADDR(device->sas_addr), rc);
				rc = -ENODEV;
			}
			sas_put_local_phy(local_phy);
			break;
		default:
			break;
		}
	}

	rc = hisi_sas_debug_I_T_nexus_reset(device);
	if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
		hisi_sas_release_task(hisi_hba, device);