scsi: lpfc: vmid: Introduce VMID in I/O path
Hello Gaurav Srivastava,
The patch 33c79741deaf: "scsi: lpfc: vmid: Introduce VMID in I/O path" from Jun 8, 2021, leads to the following Smatch static checker warning:
mm/percpu.c:1949 __alloc_percpu() warn: sleeping in atomic context
drivers/scsi/lpfc/lpfc_scsi.c
5510 vmp->io_rd_cnt = 0;
5511 vmp->io_wr_cnt = 0;
5512 vmp->flag = LPFC_VMID_SLOT_USED;
5513
5514 vmp->delete_inactive =
5515 vport->vmid_inactivity_timeout ? 1 : 0;
5516
5517 /* if type priority tag, get next available VMID */
5518 if (lpfc_vmid_is_type_priority_tag(vport))
5519 lpfc_vmid_assign_cs_ctl(vport, vmp);
5520
5521 /* allocate the per cpu variable for holding */
5522 /* the last access time stamp only if VMID is enabled */
5523 if (!vmp->last_io_time)
5524 vmp->last_io_time = __alloc_percpu(sizeof(u64),
^^^^^^^^^^^^^^This allocation sleeps. A non-sleeping alternative is __alloc_percpu_gfp().
5525 __alignof__(struct
5526 lpfc_vmid));
5527 if (!vmp->last_io_time) {
5528 hash_del(&vmp->hnode);
5529 vmp->flag = LPFC_VMID_SLOT_FREE;
5530 write_unlock(&vport->vmid_lock);
5531 return -EIO;
5532 }
5533
5534 write_unlock(&vport->vmid_lock);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^We're holding a write lock.
regards,
dan carpenter