]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: Create separate host attributes per HBA
authorXiang Chen <chenxiang66@hisilicon.com>
Fri, 9 Nov 2018 14:06:32 +0000 (22:06 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
Currently all the three HBA (v1/v2/v3 HW) share the same host attributes.

To support each HBA having separate attributes in future, create per-HBA
attributes.

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 c3566f9a617de3288739fd3b8e7539951bf2b04d)
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: 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 0ddb53c8a2e29fe5b83fa8eb0319ce9fb8c5ea9f..94a9e13c069cbc9277c555aa9338050049450203 100644 (file)
@@ -468,7 +468,6 @@ extern int hisi_sas_remove(struct platform_device *pdev);
 extern int hisi_sas_slave_configure(struct scsi_device *sdev);
 extern int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time);
 extern void hisi_sas_scan_start(struct Scsi_Host *shost);
-extern struct device_attribute *host_attrs[];
 extern int hisi_sas_host_reset(struct Scsi_Host *shost, int reset_type);
 extern void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy);
 extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba,
index 9b054527d231d2acc035323c3064930401b3160d..c24905f223e69cdc02b5128d14c15d55f05ec28f 100644 (file)
@@ -1998,12 +1998,6 @@ EXPORT_SYMBOL_GPL(hisi_sas_kill_tasklets);
 struct scsi_transport_template *hisi_sas_stt;
 EXPORT_SYMBOL_GPL(hisi_sas_stt);
 
-struct device_attribute *host_attrs[] = {
-       &dev_attr_phy_event_threshold,
-       NULL,
-};
-EXPORT_SYMBOL_GPL(host_attrs);
-
 static struct sas_domain_function_template hisi_sas_transport_ops = {
        .lldd_dev_found         = hisi_sas_dev_found,
        .lldd_dev_gone          = hisi_sas_dev_gone,
index 8df822a4a1bd6624abb8814a70e8bdc502274192..e8e3a876e4934ca1074d3b1b6286b7a569791305 100644 (file)
@@ -1797,6 +1797,11 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)
        return 0;
 }
 
+static struct device_attribute *host_attrs_v1_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v1_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -1815,7 +1820,7 @@ static struct scsi_host_template sht_v1_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v1_hw,
 };
 
 static const struct hisi_sas_hw hisi_sas_v1_hw = {
index 77a85ead483e098a8e1d837c8130bfb873dc3671..574a269e28652ece5f39a94855baa8c6a1e6940f 100644 (file)
@@ -3552,6 +3552,11 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba,
        dev_dbg(dev, "wait commands complete %dms\n", time);
 }
 
+struct device_attribute *host_attrs_v2_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v2_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -3570,7 +3575,7 @@ static struct scsi_host_template sht_v2_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v2_hw,
 };
 
 static const struct hisi_sas_hw hisi_sas_v2_hw = {
index 955ebb56a8b5aa36e08e9b8269446e2e09125aed..2fd5a83850f39e61d1b084f3fd9b8a9af0b43c54 100644 (file)
@@ -2089,6 +2089,11 @@ static void wait_cmds_complete_timeout_v3_hw(struct hisi_hba *hisi_hba,
        dev_dbg(dev, "wait commands complete %dms\n", time);
 }
 
+struct device_attribute *host_attrs_v3_hw[] = {
+       &dev_attr_phy_event_threshold,
+       NULL
+};
+
 static struct scsi_host_template sht_v3_hw = {
        .name                   = DRV_NAME,
        .module                 = THIS_MODULE,
@@ -2107,7 +2112,7 @@ static struct scsi_host_template sht_v3_hw = {
        .eh_target_reset_handler = sas_eh_target_reset_handler,
        .target_destroy         = sas_target_destroy,
        .ioctl                  = sas_ioctl,
-       .shost_attrs            = host_attrs,
+       .shost_attrs            = host_attrs_v3_hw,
        .tag_alloc_policy       = BLK_TAG_ALLOC_RR,
 };