Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4e34f2a authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: Add SATA FIS check for v3 hw



Add a check ERR bit of status to decide whether there is something wrong
with initial register-D2H FIS. If error exist, PHY link reset the channel
to restart OOB.

Directly call work HISI_PHYE_LINK_RESET replacing disable_phy_vx_hw() and
enable_phy_vx_hw().

Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1c09b663
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3240,8 +3240,7 @@ static irqreturn_t sata_int_v2_hw(int irq_no, void *p)
	if (fis->status & ATA_ERR) {
		dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", phy_no,
				fis->status);
		disable_phy_v2_hw(hisi_hba, phy_no);
		enable_phy_v2_hw(hisi_hba, phy_no);
		hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
		res = IRQ_NONE;
		goto end;
	}
+10 −0
Original line number Diff line number Diff line
@@ -1191,6 +1191,16 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
		dev_info(dev, "phyup: phy%d link_rate=%d(sata)\n", phy_no, link_rate);
		initial_fis = &hisi_hba->initial_fis[phy_no];
		fis = &initial_fis->fis;

		/* check ERR bit of Status Register */
		if (fis->status & ATA_ERR) {
			dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n",
				 phy_no, fis->status);
			hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
			res = IRQ_NONE;
			goto end;
		}

		sas_phy->oob_mode = SATA_OOB_MODE;
		attached_sas_addr[0] = 0x50;
		attached_sas_addr[7] = phy_no;