Commit c3566f9a authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: Create separate host attributes per HBA



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: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 236bd823
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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,
+0 −6
Original line number Diff line number Diff line
@@ -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,
+6 −1
Original line number Diff line number Diff line
@@ -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 = {
+6 −1
Original line number Diff line number Diff line
@@ -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 = {
+6 −1
Original line number Diff line number Diff line
@@ -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,
};