diff options
author | John Garry | 2016-09-06 17:36:12 +0200 |
---|---|---|
committer | Martin K. Petersen | 2016-09-14 18:54:17 +0200 |
commit | 4fde02ad66dc9ceb0b55daca21ef33b43df30ded (patch) | |
tree | 4c707c92f64c6c18bfaa4dd62c6e24f70fc0abbd /drivers/scsi/hisi_sas/hisi_sas_main.c | |
parent | scsi: hisi_sas: save completion queue read pointer (diff) | |
download | kernel-qcow2-linux-4fde02ad66dc9ceb0b55daca21ef33b43df30ded.tar.gz kernel-qcow2-linux-4fde02ad66dc9ceb0b55daca21ef33b43df30ded.tar.xz kernel-qcow2-linux-4fde02ad66dc9ceb0b55daca21ef33b43df30ded.zip |
scsi: hisi_sas: save delivery queue write pointer
Optimise by saving an avoidable read in the get_free_slot function. The
delivery queue write pointer will only be updated by software, so don't
bother re-reading what was already written in the previous call to
start_delivery function.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas_main.c')
-rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 85c73d311e4d..5d5657670d4c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1239,11 +1239,16 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost) for (i = 0; i < hisi_hba->queue_count; i++) { struct hisi_sas_cq *cq = &hisi_hba->cq[i]; + struct hisi_sas_dq *dq = &hisi_hba->dq[i]; /* Completion queue structure */ cq->id = i; cq->hisi_hba = hisi_hba; + /* Delivery queue structure */ + dq->id = i; + dq->hisi_hba = hisi_hba; + /* Delivery queue */ s = sizeof(struct hisi_sas_cmd_hdr) * HISI_SAS_QUEUE_SLOTS; hisi_hba->cmd_hdr[i] = dma_alloc_coherent(dev, s, |