mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avri Altman <Avri.Altman@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Asutosh Das <quic_asutoshd@quicinc.com>,
	"quic_cang@quicinc.com" <quic_cang@quicinc.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] scsi: ufs: mcq: Limit the amount of inflight requests
Date: Thu, 30 Mar 2023 18:39:16 +0000	[thread overview]
Message-ID: <DM6PR04MB6575FBF184F21EE63DA03338FC8E9@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <8cb5216b-7dee-a924-1362-88b53ecbe6ea@acm.org>

 
> On 3/30/23 06:11, Avri Altman wrote:
> > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> > index 35a3bd95c5e4..d529c42a682a 100644
> > --- a/drivers/ufs/core/ufshcd.c
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -8468,6 +8468,10 @@ static int ufshcd_alloc_mcq(struct ufs_hba *hba)
> >       if (ret)
> >               goto err;
> >
> > +     if (WARN_ONCE(hba->nutrs * hba->nr_hw_queues > (1 << 16) - 1,
> > +                  "there can be at most 1<<16 inflight requests\n"))
> > +             goto err;
> > +
> >       /*
> >        * Previously allocated memory for nutrs may not be enough in MCQ
> mode.
> >        * Number of supported tags in MCQ mode may be larger than SDB
> mode.
> 
> Hi Avri,
> 
> WARN*() should only be used to report kernel bugs. hba->nutrs *
> hba->nr_hw_queues being too large is not a kernel bug but a
> configuration issue.
Will replace with an appropriate dev_info and a clarifying comment.

> 
> Instead of failing MCQ allocation, shouldn't
> ufshcd_mcq_decide_queue_depth() be modified such that it restricts
> hba->nutrs to a value that can be supported?
The driver's capacity is the product of  hba->nutrs * hba->nr_hw_queues,
Where the latter is being established only later in ufshcd_mcq_init.

Thanks,
Avri
> 
> Thanks,
> 
> Bart.

      reply	other threads:[~2023-03-30 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 13:11 Avri Altman
2023-03-30 14:06 ` Johannes Thumshirn
2023-03-30 18:28   ` Avri Altman
2023-03-30 16:39 ` Bart Van Assche
2023-03-30 18:39   ` Avri Altman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR04MB6575FBF184F21EE63DA03338FC8E9@DM6PR04MB6575.namprd04.prod.outlook.com \
    --to=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®