lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 30 Mar 2023 18:39:16 +0000
From:   Avri Altman <Avri.Altman@....com>
To:     Bart Van Assche <bvanassche@....org>,
        "James E . J . Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>
CC:     Asutosh Das <quic_asutoshd@...cinc.com>,
        "quic_cang@...cinc.com" <quic_cang@...cinc.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: ufs: mcq: Limit the amount of inflight requests

 
> 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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ