]> asedeno.scripts.mit.edu Git - linux.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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 15 Nov 2018 19:37:05 +0000 (14:37 -0500)
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>
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 b3f01d5b821b53c2671e9a5d4768220657dd08a6..8633ff9335d167ecfaa9b70bcd64a8d3a484f99d 100644 (file)
@@ -1994,12 +1994,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 f0e457e6884e5ca9c92d84c12c1db2cf6906104b..d24342bcd072c01524c44de5e6fbbec5bcaa08d4 100644 (file)
@@ -1799,6 +1799,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,
@@ -1817,7 +1822,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 cc36b6473e986b3191f88160ac41f24f730999d6..e78a97e8c1c69a2f0d4e1d15b9a359d62c9e1100 100644 (file)
@@ -3554,6 +3554,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,
@@ -3572,7 +3577,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 73bf45e52a0aab1517eccc715d462d90f6e71e92..601b1631fec0aa39a45228c544a9ad039d4aeabb 100644 (file)
@@ -2091,6 +2091,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,
@@ -2109,7 +2114,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,
 };