> On 11/5/19 5:50 AM, Bean Huo (beanhuo) wrote: > >> - wait_event(hba->tm_tag_wq, ufshcd_get_tm_free_slot(hba, > >> &free_slot)); > >> + req = blk_get_request(q, REQ_OP_DRV_OUT, BLK_MQ_REQ_RESERVED); > >> + req->end_io_data = &wait; > >> + free_slot = req->tag; > >> + WARN_ON_ONCE(free_slot < 0 || free_slot >= hba->nutmrs); > >> ufshcd_hold(hba, false); > >> > > Understand now , you delete ufshcd_get_tm_free_slot(). Run a big circle to > get a free_slot from reserved tags by calling blk_get_request(). > > But UFS data transfer queue depth is 32, not 32 + hba->nutmrs. How to make > sure we see the tag is consistent across block/scsi/ufs? > > Hi Bean, > > Please have a look at the blk_mq_get_tag() function in the block layer. > The implementation of that function makes it clear that the tags with numbers > [0 .. nr_reserved) are considered reserved tags and also that the tags with > numbers [nr_reserved .. queue_depth) are considered regular tags. In other > words, adding hba->nutmrs to can_queue does not increase the queue depth > because the same number of tags are considered reserved tags. > > Bart. Hi, Bart Yes, I saw that. And actually, task management requests and regular data transfer Requests will be stored to different queues, and use different door-bell registers. So as you said, to introduce a new tag set for TMFs is better. Thanks, //Bean