mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
scsi: hisi_sas: Put reserved tags in lower region of tagset
To be consistent with blk-mq, put the reserved tags in the lower region of the tagset. Eventually we hope to get rid of all this reserved tag management. Signed-off-by: John Garry <john.garry@huawei.com> Link: https://lore.kernel.org/r/1666091763-11023-4-git-send-email-john.garry@huawei.com Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
295fd2330a
commit
f7d190a94e
1 changed files with 7 additions and 7 deletions
|
@ -183,16 +183,16 @@ static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba,
|
|||
void *bitmap = hisi_hba->slot_index_tags;
|
||||
|
||||
if (rq)
|
||||
return rq->tag;
|
||||
return rq->tag + HISI_SAS_RESERVED_IPTT;
|
||||
|
||||
spin_lock(&hisi_hba->lock);
|
||||
index = find_next_zero_bit(bitmap, hisi_hba->slot_index_count,
|
||||
index = find_next_zero_bit(bitmap, HISI_SAS_RESERVED_IPTT,
|
||||
hisi_hba->last_slot_index + 1);
|
||||
if (index >= hisi_hba->slot_index_count) {
|
||||
if (index >= HISI_SAS_RESERVED_IPTT) {
|
||||
index = find_next_zero_bit(bitmap,
|
||||
hisi_hba->slot_index_count,
|
||||
HISI_SAS_UNRESERVED_IPTT);
|
||||
if (index >= hisi_hba->slot_index_count) {
|
||||
HISI_SAS_RESERVED_IPTT,
|
||||
0);
|
||||
if (index >= HISI_SAS_RESERVED_IPTT) {
|
||||
spin_unlock(&hisi_hba->lock);
|
||||
return -SAS_QUEUE_FULL;
|
||||
}
|
||||
|
@ -2216,7 +2216,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba)
|
|||
if (!hisi_hba->sata_breakpoint)
|
||||
goto err_out;
|
||||
|
||||
hisi_hba->last_slot_index = HISI_SAS_UNRESERVED_IPTT;
|
||||
hisi_hba->last_slot_index = 0;
|
||||
|
||||
hisi_hba->wq = create_singlethread_workqueue(dev_name(dev));
|
||||
if (!hisi_hba->wq) {
|
||||
|
|
Loading…
Add table
Reference in a new issue