Messages in this thread | | | Subject | Re: [PATCH v4 2/3] scsi: ufs: core: Cleanup ufshcd_slave_alloc() | From | Bean Huo <> | Date | Tue, 25 Oct 2022 13:44:18 +0200 |
| |
On Mon, 2022-10-24 at 16:25 -0700, Bart Van Assche wrote: > On 10/22/22 14:36, Bean Huo wrote: > > + u8 lun_qdepth = hba->nutrs; > > How about changing this into hba->nutrs - 1 since one tag is reserved > ('reserved_slot')? > > Thanks,
Bart,
If having a look at
scsi_change_queue_depth() {
depth = min_t(int, depth, scsi_device_max_queue_depth(sdev)); ... }
so the finnal depth per Lu is still 31. I did test and debug, this is true.
+set_qdepth: + /* + * For WLUNs that don't support unit descriptor, queue depth is set to 1. For LUs whose + * bLUQueueDepth == 0, the queue depth is set to a maximum value that host can queue. + */ + dev_dbg(hba->dev, "Set LU %x queue depth %d\n", lun, lun_qdepth); + scsi_change_queue_depth(sdev, lun_qdepth);
so lun_qdepth is 32, but scsi_change_queue_depth() will return 31, since we set sdev->host->can_queue is 31.
If you need me to change the patch, let me know, it is no problem for me to change to:
u8 lun_qdepth = hba->nutrs - UFSHCD_NUM_RESERVED.
or
u8 lun_qdepth = UFSHCD_CMD_PER_LUN.
Kind regards, Bean
| |