> scsi_add_host() allocates shost->can_queue tags. ufshcd_init() sets > shost->can_queue to hba->nutrs. In other words, we know that tag values > will be in the range [0, hba->nutrs). Remove a check that verifies what > we already know. This check was introduced by commit 14497328b6a6 > ("scsi: > ufs: verify command tag validity"). > > Cc: Gilad Broner <gbroner@xxxxxxxxxxxxxx> > Cc: Yaniv Gardi <ygardi@xxxxxxxxxxxxxx> > Cc: Subhash Jadavani <subhashj@xxxxxxxxxxxxxx> > Cc: Dolev Raviv <draviv@xxxxxxxxxxxxxx> > Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> > --- > drivers/scsi/ufs/ufshcd.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index c230d2a6a55c..71c720d940a3 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -2701,21 +2701,11 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, > struct ufshcd_lrb *lrb, int i) > */ > static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd > *cmd) > { > + struct ufs_hba *hba = shost_priv(host); > + int tag = cmd->request->tag; > struct ufshcd_lrb *lrbp; > - struct ufs_hba *hba; > - int tag; > int err = 0; > > - hba = shost_priv(host); > - > - tag = cmd->request->tag; > - if (!ufshcd_valid_tag(hba, tag)) { > - dev_err(hba->dev, > - "%s: invalid command tag %d: cmd=0x%p, cmd- > >request=0x%p", > - __func__, tag, cmd, cmd->request); > - BUG(); > - } While at it, maybe remove ufshcd_valid_tag altogether? Thanks, Avri > - > if (!down_read_trylock(&hba->clk_scaling_lock)) > return SCSI_MLQUEUE_HOST_BUSY;