Skip to content

Commit f4e34f2

Browse files
Xiang Chenmartinkpetersen
authored andcommitted
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: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1c09b66 commit f4e34f2

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎drivers/scsi/hisi_sas/hisi_sas_v2_hw.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,8 +3240,7 @@ static irqreturn_t sata_int_v2_hw(int irq_no, void *p)
32403240
if (fis->status & ATA_ERR) {
32413241
dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", phy_no,
32423242
fis->status);
3243-
disable_phy_v2_hw(hisi_hba, phy_no);
3244-
enable_phy_v2_hw(hisi_hba, phy_no);
3243+
hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
32453244
res = IRQ_NONE;
32463245
goto end;
32473246
}

‎drivers/scsi/hisi_sas/hisi_sas_v3_hw.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,16 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
11911191
dev_info(dev, "phyup: phy%d link_rate=%d(sata)\n", phy_no, link_rate);
11921192
initial_fis = &hisi_hba->initial_fis[phy_no];
11931193
fis = &initial_fis->fis;
1194+
1195+
/* check ERR bit of Status Register */
1196+
if (fis->status & ATA_ERR) {
1197+
dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n",
1198+
phy_no, fis->status);
1199+
hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
1200+
res = IRQ_NONE;
1201+
goto end;
1202+
}
1203+
11941204
sas_phy->oob_mode = SATA_OOB_MODE;
11951205
attached_sas_addr[0] = 0x50;
11961206
attached_sas_addr[7] = phy_no;

0 commit comments

Comments
 (0)