Commit 0bcb45fb authored by Raghava Aditya Renukunta's avatar Raghava Aditya Renukunta Committed by Martin K. Petersen

scsi: aacraid: Add helper function to set queue depth

Add helper function to set queue depth from information retrieved from
the bmic phy structure.
Signed-off-by: default avatarRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e2ee8c94
...@@ -1755,6 +1755,28 @@ static int aac_send_safw_bmic_cmd(struct aac_dev *dev, ...@@ -1755,6 +1755,28 @@ static int aac_send_safw_bmic_cmd(struct aac_dev *dev,
return rcode; return rcode;
} }
static void aac_set_safw_target_qd(struct aac_dev *dev, int bus, int target)
{
struct aac_ciss_identify_pd *identify_resp;
if (dev->hba_map[bus][target].devtype != AAC_DEVTYPE_NATIVE_RAW)
return;
identify_resp = dev->hba_map[bus][target].safw_identify_resp;
if (identify_resp == NULL) {
dev->hba_map[bus][target].qd_limit = 32;
return;
}
if (identify_resp->current_queue_depth_limit <= 0 ||
identify_resp->current_queue_depth_limit > 255)
dev->hba_map[bus][target].qd_limit = 32;
else
dev->hba_map[bus][target].qd_limit =
identify_resp->current_queue_depth_limit;
}
static int aac_issue_safw_bmic_identify(struct aac_dev *dev, static int aac_issue_safw_bmic_identify(struct aac_dev *dev,
struct aac_ciss_identify_pd **identify_resp, u32 bus, u32 target) struct aac_ciss_identify_pd **identify_resp, u32 bus, u32 target)
{ {
...@@ -1781,13 +1803,6 @@ static int aac_issue_safw_bmic_identify(struct aac_dev *dev, ...@@ -1781,13 +1803,6 @@ static int aac_issue_safw_bmic_identify(struct aac_dev *dev,
if (unlikely(rcode < 0)) if (unlikely(rcode < 0))
goto mem_free_all; goto mem_free_all;
if (identify_reply->current_queue_depth_limit <= 0 ||
identify_reply->current_queue_depth_limit > 32)
dev->hba_map[bus][target].qd_limit = 32;
else
dev->hba_map[bus][target].qd_limit =
identify_reply->current_queue_depth_limit;
*identify_resp = identify_reply; *identify_resp = identify_reply;
out: out:
...@@ -1936,17 +1951,14 @@ static int aac_get_safw_attr_all_targets(struct aac_dev *dev, int rescan) ...@@ -1936,17 +1951,14 @@ static int aac_get_safw_attr_all_targets(struct aac_dev *dev, int rescan)
rcode = aac_issue_safw_bmic_identify(dev, rcode = aac_issue_safw_bmic_identify(dev,
&identify_resp, bus, target); &identify_resp, bus, target);
if (unlikely(rcode < 0)) { if (unlikely(rcode < 0))
dev->hba_map[bus][target].qd_limit = 32;
goto free_identify_resp; goto free_identify_resp;
}
dev->hba_map[bus][target].safw_identify_resp = identify_resp; dev->hba_map[bus][target].safw_identify_resp = identify_resp;
} }
out: out:
return rcode; return rcode;
free_identify_resp: free_identify_resp:
aac_free_safw_all_identify_resp(dev, i); aac_free_safw_all_identify_resp(dev, i);
goto out; goto out;
...@@ -1995,8 +2007,7 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, int rescan) ...@@ -1995,8 +2007,7 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, int rescan)
} else } else
devtype = AAC_DEVTYPE_ARC_RAW; devtype = AAC_DEVTYPE_ARC_RAW;
if (devtype != AAC_DEVTYPE_NATIVE_RAW) aac_set_safw_target_qd(dev, bus, target);
goto update_devtype;
update_devtype: update_devtype:
if (rescan == AAC_INIT) if (rescan == AAC_INIT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment