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] [thread-next>] [day] [month] [year] [list]
Message-ID: <d53ed27c-024f-8f50-1c9b-8b639b52a1c8@quicinc.com>
Date:   Wed, 7 Sep 2022 20:01:18 -0700
From:   "Asutosh Das (asd)" <quic_asutoshd@...cinc.com>
To:     Bean Huo <huobean@...il.com>, <quic_nguyenb@...cinc.com>,
        <quic_xiaosenh@...cinc.com>, <stanley.chu@...iatek.com>,
        <adrian.hunter@...el.com>, <bvanassche@....org>,
        <avri.altman@....com>, <mani@...nel.org>, <quic_cang@...cinc.com>,
        <beanhuo@...ron.com>, <martin.petersen@...cle.com>,
        <linux-scsi@...r.kernel.org>
CC:     <linux-arm-msm@...r.kernel.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Jinyoung Choi <j-young.choi@...sung.com>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v3 2/4] ufs: core: mcq: Adds Multi-Circular Queue
 support

Hello Bean
Thanks for your comments. Responses inline.

On 9/5/2022 6:48 AM, Bean Huo wrote:
> On Fri, 2022-09-02 at 15:41 -0700, Asutosh Das wrote:
>> +/**
>> + * ufshcd_mcq_decide_queue_depth - decide the queue depth
>> + * @hba - per adapter instance
>> + *
>> + * MAC - Max. Active Command of the Host Controller (HC)
>> + * HC wouldn't send more than this commands to the device.
>> + * The default MAC is 32, but the max. value may vary with
>> + * vendor implementation.
>> + * Calculates and adjusts the queue depth based on the depth
>> + * supported by the HC, ufs device and if ext_iid is supported.
>> + */
>> +u32 ufshcd_mcq_decide_queue_depth(struct ufs_hba *hba)
>> +{
>> +       u32 qd, val;
>> +       int mac;
>> +
>> +       mac = ufshcd_mcq_vops_get_hba_mac(hba);
>> +       if (mac < 0) {
>> +               val = ufshcd_readl(hba, REG_UFS_MCQ_CFG);
>> +               mac = (val & MCQ_CFG_MAC_MASK) >> MCQ_CFG_MAC_OFFSET;
>> +       }
>> +
>> +       /*  MAC is a 0 based value. */
>> +       mac += 1;
>> +       qd = min_t(u32, mac, hba->dev_info.bqueuedepth);
>> +       if (!qd)
>> +               qd = mac;
>> +
>> +       /* Adjust queue depth based on ext_iid support. */
>> +       if (qd > 256 && (!hba->ext_iid_sup || !hba-
>>> dev_info.b_ext_iid_en))
>> +               qd = 256;
>> +       else if (qd > 4096 && hba->ext_iid_sup && hba-
>>> dev_info.b_ext_iid_en)
>> +               qd = 4096;
>> +
> 
> Astosh,
> 
> I don't understand here.  How can qd be 4096?  MAC in UFSHCI  is 9 bits
> width, the maximum depth will be 512, and hba->dev_info.bqueuedepth is
> one byte width, maximum will be 256.
> 
Correct. The spec is fuzzy about it. Because ext_iid provides a 
provision to increase the Queue depth to 2^12. Even though the 
parameters that you referred to don't support it now.

Will remove this part in the next version.

> Kind regards,
> Bean
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ