]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: Add SATA FIS check for v3 hw
authorXiang Chen <chenxiang66@hisilicon.com>
Wed, 18 Jul 2018 14:14:33 +0000 (22:14 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 16:23:18 +0000 (18:23 +0200)
BugLink: https://bugs.launchpad.net/bugs/1794151
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>
(cherry picked from commit f4e34f2a5dd9c0db19baad3f015c3abd5f2e0343)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index daa2dd1848e97167b80bc709500150c03dc182ff..7b39c4d23328b5d00ac55cf91fead074821d9262 100644 (file)
@@ -3257,8 +3257,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;
        }
index 03c5f56ccca6048ba44d2df6310cd8d12c500b09..7a5a028d3f2168080397760b582b4d09ea60328c 100644 (file)
@@ -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;