On 4/26/23 05:48, Bean Huo wrote:
lrbp->cmd will always be non-NULL after this slot in the queue has been used once?
Hi Bean, The reserved slot is used for device commands, UPIU commands and also for RPMB commands. The other slots are used for SCSI commands. So lrbp->cmd could be set after the lrbp array has been allocated instead of when a command is queued. I haven't done that because in the near future I would like to remove the lrbp->cmd pointer. This is possible by setting the .cmd_size member in the SCSI host template to sizeof(struct ufshcd_lrb). Setting that member causes the SCSI core to allocate additional memory at the end of each struct scsi_cmnd instance. Thanks, Bart.