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]
Message-ID: <d934fe3b-df58-838f-a5cb-f26c05500609@acm.org>
Date:   Wed, 9 Nov 2022 13:28:44 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Asutosh Das <quic_asutoshd@...cinc.com>, quic_cang@...cinc.com,
        martin.petersen@...cle.com, linux-scsi@...r.kernel.org
Cc:     quic_nguyenb@...cinc.com, quic_xiaosenh@...cinc.com,
        stanley.chu@...iatek.com, eddie.huang@...iatek.com,
        daejun7.park@...sung.com, avri.altman@....com, mani@...nel.org,
        beanhuo@...ron.com, linux-arm-msm@...r.kernel.org,
        Alim Akhtar <alim.akhtar@...sung.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...ainline.org>,
        Jinyoung Choi <j-young.choi@...sung.com>,
        Arthur Simchaev <Arthur.Simchaev@....com>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 07/16] ufs: core: mcq: Calculate queue depth

On 11/9/22 11:41, Asutosh Das wrote:
> +int ufshcd_mcq_decide_queue_depth(struct ufs_hba *hba)
> +{
> +	int mac;
> +
> +	/* Mandatory to implement get_hba_mac() */
> +	mac = ufshcd_mcq_vops_get_hba_mac(hba);
> +	if (mac < 0) {
> +		dev_err(hba->dev, "Failed to get mac, err=%d\n", mac);
> +		return mac;
> +	}
> +
> +	/*  MAC is a 0 based value. */
> +	mac += 1;

Please make ufshcd_mcq_vops_get_hba_mac() return a 1-based value. The 
0-based convention is useful for bit-constrained device registers but is 
confusing when not reading from a hardware register.

> +	/*
> +	 * max. value of bqueuedepth = 256, mac is host dependent.
> +	 * It is mandatory for UFS device to define bQueueDepth if
> +	 * shared queuing architecture is enabled.
> +	 */
> +	return min_t(int, mac, hba->dev_info.bqueuedepth);

According to the UFS specification bQueueDepth is zero if there is one 
queue per logical unit inside the device. Should a warning statement be 
added that reports a complaint if bQueueDepth == 0 since the above code 
does not support bQueueDepth == 0? I'm not sure whether any UFS devices 
exist that use per-LU queuing.

> +static int ufs_qcom_get_hba_mac(struct ufs_hba *hba)
> +{
> +	/* Default is 32, but Qualcomm HC supports upto 64 */

I think that "default is 32" should be left out since the code that 
reads the MAC register has been removed.

Additionally, please change "upto" into "up to".

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ