Skip to content

Commit 4e87eb2

Browse files
Ewan D. Milnemartinkpetersen
authored andcommitted
scsi: lpfc: do not set queue->page_count to 0 if pc_sli4_params.wqpcnt is invalid
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: 895427b ("scsi: lpfc: NVME Initiator: Base modifications") Cc: stable@vger.kernel.org # 4.11+ Signed-off-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Laurence Oberman <loberman@redhat.com> Tested-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4af14d1 commit 4e87eb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14575,7 +14575,8 @@ lpfc_sli4_queue_alloc(struct lpfc_hba *phba, uint32_t page_size,
1457514575
hw_page_size))/hw_page_size;
1457614576

1457714577
/* If needed, Adjust page count to match the max the adapter supports */
14578-
if (queue->page_count > phba->sli4_hba.pc_sli4_params.wqpcnt)
14578+
if (phba->sli4_hba.pc_sli4_params.wqpcnt &&
14579+
(queue->page_count > phba->sli4_hba.pc_sli4_params.wqpcnt))
1457914580
queue->page_count = phba->sli4_hba.pc_sli4_params.wqpcnt;
1458014581

1458114582
INIT_LIST_HEAD(&queue->list);

0 commit comments

Comments
 (0)