]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: send primitive NOTIFY to SSP situation only
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 25 Jan 2019 14:22:30 +0000 (22:22 +0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:05 +0000 (14:23 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
[ Upstream commit 569eddcf3a0f4efff4ef96a7012010e0f7daa8b4 ]

Send primitive NOTIFY to SSP situation only, or it causes underflow issue
when sending IO. Also rename hisi_sas_hw.sl_notify() to hisi_sas_hw.
sl_notify_ssp().

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index af291947a54d86809b7a202abac074e9f164e9c7..f9026ad67732036706a2c7b8f5eddfba1542befc 100644 (file)
@@ -227,7 +227,7 @@ struct hisi_sas_hw {
        int (*slot_index_alloc)(struct hisi_hba *hisi_hba,
                                struct domain_device *device);
        struct hisi_sas_device *(*alloc_dev)(struct domain_device *device);
-       void (*sl_notify)(struct hisi_hba *hisi_hba, int phy_no);
+       void (*sl_notify_ssp)(struct hisi_hba *hisi_hba, int phy_no);
        int (*get_free_slot)(struct hisi_hba *hisi_hba, struct hisi_sas_dq *dq);
        void (*start_delivery)(struct hisi_sas_dq *dq);
        void (*prep_ssp)(struct hisi_hba *hisi_hba,
index 3c03de9d18ddf9c806ebb15c8c2a4155f864b8ba..477dc9adbde276eafb9119fa7fc6c63b06c306a3 100644 (file)
@@ -779,7 +779,8 @@ static void hisi_sas_phyup_work(struct work_struct *work)
        struct asd_sas_phy *sas_phy = &phy->sas_phy;
        int phy_no = sas_phy->id;
 
-       hisi_hba->hw->sl_notify(hisi_hba, phy_no); /* This requires a sleep */
+       if (phy->identify.target_port_protocols == SAS_PROTOCOL_SSP)
+               hisi_hba->hw->sl_notify_ssp(hisi_hba, phy_no);
        hisi_sas_bytes_dmaed(hisi_hba, phy_no);
 }
 
index ef23d26b2271faeea7abbcb188f5c269c7e0e3cc..b68fa23e18c6ae3dd0e855558fb1e65f6b706e83 100644 (file)
@@ -835,7 +835,7 @@ static void phys_init_v1_hw(struct hisi_hba *hisi_hba)
        mod_timer(timer, jiffies + HZ);
 }
 
-static void sl_notify_v1_hw(struct hisi_hba *hisi_hba, int phy_no)
+static void sl_notify_ssp_v1_hw(struct hisi_hba *hisi_hba, int phy_no)
 {
        u32 sl_control;
 
@@ -1827,7 +1827,7 @@ static struct scsi_host_template sht_v1_hw = {
 static const struct hisi_sas_hw hisi_sas_v1_hw = {
        .hw_init = hisi_sas_v1_init,
        .setup_itct = setup_itct_v1_hw,
-       .sl_notify = sl_notify_v1_hw,
+       .sl_notify_ssp = sl_notify_ssp_v1_hw,
        .clear_itct = clear_itct_v1_hw,
        .prep_smp = prep_smp_v1_hw,
        .prep_ssp = prep_ssp_v1_hw,
index 0341fa72d97e59f897b18356a54a836c2f31d94c..3c6d6ed962265bb1afe2d498ac8122ebef643c0d 100644 (file)
@@ -1589,7 +1589,7 @@ static void phys_init_v2_hw(struct hisi_hba *hisi_hba)
        }
 }
 
-static void sl_notify_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
+static void sl_notify_ssp_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
 {
        u32 sl_control;
 
@@ -3591,7 +3591,7 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = {
        .setup_itct = setup_itct_v2_hw,
        .slot_index_alloc = slot_index_alloc_quirk_v2_hw,
        .alloc_dev = alloc_dev_quirk_v2_hw,
-       .sl_notify = sl_notify_v2_hw,
+       .sl_notify_ssp = sl_notify_ssp_v2_hw,
        .get_wideport_bitmap = get_wideport_bitmap_v2_hw,
        .clear_itct = clear_itct_v2_hw,
        .free_device = free_device_v2_hw,
index 96caa8eb3f292e40d77baf2710e64a36d674c420..6c6fba42543ddff3b7c7f719a45dd3e881dfaf2c 100644 (file)
@@ -868,7 +868,7 @@ static void phys_init_v3_hw(struct hisi_hba *hisi_hba)
        }
 }
 
-static void sl_notify_v3_hw(struct hisi_hba *hisi_hba, int phy_no)
+static void sl_notify_ssp_v3_hw(struct hisi_hba *hisi_hba, int phy_no)
 {
        u32 sl_control;
 
@@ -2373,7 +2373,7 @@ static const struct hisi_sas_hw hisi_sas_v3_hw = {
        .get_wideport_bitmap = get_wideport_bitmap_v3_hw,
        .complete_hdr_size = sizeof(struct hisi_sas_complete_v3_hdr),
        .clear_itct = clear_itct_v3_hw,
-       .sl_notify = sl_notify_v3_hw,
+       .sl_notify_ssp = sl_notify_ssp_v3_hw,
        .prep_ssp = prep_ssp_v3_hw,
        .prep_smp = prep_smp_v3_hw,
        .prep_stp = prep_ata_v3_hw,