Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 685b6d6e authored by John Garry's avatar John Garry Committed by Martin K. Petersen
Browse files

hisi_sas: add device and slot alloc hw methods



Add methods to use HW specific versions of functions to allocate slot
and device.  HW specific methods are permitted to workaround device id
vs IPTT collision issue in v2 hw.

Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarHannes Reinicke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 54c40428
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ struct hisi_sas_hw {
	int (*hw_init)(struct hisi_hba *hisi_hba);
	void (*setup_itct)(struct hisi_hba *hisi_hba,
			   struct hisi_sas_device *device);
	int (*slot_index_alloc)(struct hisi_hba *hisi_hba, int *slot_idx,
				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);
	int (*get_free_slot)(struct hisi_hba *hisi_hba, int *q, int *s);
	void (*start_delivery)(struct hisi_hba *hisi_hba);
+9 −2
Original line number Diff line number Diff line
@@ -227,6 +227,10 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
	} else
		n_elem = task->num_scatter;

	if (hisi_hba->hw->slot_index_alloc)
		rc = hisi_hba->hw->slot_index_alloc(hisi_hba, &slot_idx,
						    device);
	else
		rc = hisi_sas_slot_index_alloc(hisi_hba, &slot_idx);
	if (rc)
		goto err_out;
@@ -417,6 +421,9 @@ static int hisi_sas_dev_found(struct domain_device *device)
	struct hisi_sas_device *sas_dev;
	struct device *dev = &hisi_hba->pdev->dev;

	if (hisi_hba->hw->alloc_dev)
		sas_dev = hisi_hba->hw->alloc_dev(device);
	else
		sas_dev = hisi_sas_alloc_dev(device);
	if (!sas_dev) {
		dev_err(dev, "fail alloc dev: max support %d devices\n",