Commit a88b5ff6 authored by Ewan D. Milne's avatar Ewan D. Milne Committed by Greg Kroah-Hartman

scsi: lpfc: do not set queue->page_count to 0 if pc_sli4_params.wqpcnt is invalid

commit 4e87eb2f upstream.

Certain older adapters such as the OneConnect OCe10100 may not have a valid
wqpcnt value.  In this case, do not set queue->page_count to 0 in
lpfc_sli4_queue_alloc() as this will prevent the driver from initializing.

Fixes: 895427bd ("scsi: lpfc: NVME Initiator: Base modifications")
Cc: # 4.11+
Signed-off-by: default avatarEwan D. Milne <>
Reviewed-by: default avatarLaurence Oberman <>
Tested-by: default avatarLaurence Oberman <>
Signed-off-by: Martin K. Petersen's avatarMartin K. Petersen <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent eed234bc
......@@ -14501,7 +14501,8 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t page_size,
/* If needed, Adjust page count to match the max the adapter supports */
if (queue->page_count > phba->sli4_hba.pc_sli4_params.wqpcnt)
if (phba->sli4_hba.pc_sli4_params.wqpcnt &&
(queue->page_count > phba->sli4_hba.pc_sli4_params.wqpcnt))
queue->page_count = phba->sli4_hba.pc_sli4_params.wqpcnt;
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