mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Asutosh Das <quic_asutoshd@quicinc.com>,
	quic_cang@quicinc.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org
Cc: quic_nguyenb@quicinc.com, quic_xiaosenh@quicinc.com,
	stanley.chu@mediatek.com, eddie.huang@mediatek.com,
	daejun7.park@samsung.com, avri.altman@wdc.com, mani@kernel.org,
	beanhuo@micron.com, linux-arm-msm@vger.kernel.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Jinyoung Choi <j-young.choi@samsung.com>,
	Arthur Simchaev <Arthur.Simchaev@wdc.com>,
	Kiwoong Kim <kwmad.kim@samsung.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 07/16] ufs: core: mcq: Calculate queue depth
Date: Wed, 9 Nov 2022 13:28:44 -0800	[thread overview]
Message-ID: <d934fe3b-df58-838f-a5cb-f26c05500609@acm.org> (raw)
In-Reply-To: <fb85bf2b7dd3126b3168ce4613481365da291db5.1668022680.git.quic_asutoshd@quicinc.com>

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.

  reply	other threads:[~2022-11-09 21:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1668022680.git.quic_asutoshd@quicinc.com>
2022-11-09 19:41 ` [PATCH v4 01/16] ufs: core: Optimize duplicate code to read extended feature Asutosh Das
2022-11-09 20:54   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 02/16] ufs: core: Probe for ext_iid support Asutosh Das
2022-11-09 20:56   ` Bart Van Assche
2022-11-10 10:47   ` Avri Altman
2022-11-09 19:41 ` [PATCH v4 03/16] ufs: core: Introduce Multi-circular queue capability Asutosh Das
2022-11-09 20:59   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 04/16] ufs: core: Defer adding host to scsi if mcq is supported Asutosh Das
2022-11-09 19:41 ` [PATCH v4 05/16] ufs: core: mcq: Add Multi Circular Queue support Asutosh Das
2022-11-09 21:16   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 06/16] ufs: core: mcq: Configure resource regions Asutosh Das
2022-11-09 21:21   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 07/16] ufs: core: mcq: Calculate queue depth Asutosh Das
2022-11-09 21:28   ` Bart Van Assche [this message]
2022-11-09 19:41 ` [PATCH v4 08/16] ufs: core: mcq: Allocate memory for mcq mode Asutosh Das
2022-11-09 21:36   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 09/16] ufs: core: mcq: Configure operation and runtime interface Asutosh Das
2022-11-09 21:39   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 10/16] ufs: core: mcq: Use shared tags for MCQ mode Asutosh Das
2022-11-09 19:41 ` [PATCH v4 11/16] ufs: core: Prepare ufshcd_send_command for mcq Asutosh Das
2022-11-09 19:41 ` [PATCH v4 12/16] ufs: core: mcq: Find hardware queue to queue request Asutosh Das
2022-11-09 19:41 ` [PATCH v4 13/16] ufs: core: Prepare for completion in mcq Asutosh Das
2022-11-09 19:41 ` [PATCH v4 14/16] ufs: mcq: Add completion support of a cqe Asutosh Das
2022-11-11 19:54   ` kernel test robot
2022-11-11 20:15   ` kernel test robot
2022-11-09 19:41 ` [PATCH v4 15/16] ufs: core: mcq: Add completion support in poll Asutosh Das
2022-11-09 19:41 ` [PATCH v4 16/16] ufs: core: mcq: Enable Multi Circular Queue Asutosh Das

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=d934fe3b-df58-838f-a5cb-f26c05500609@acm.org \
    --to=bvanassche@acm.org \
    --cc=Arthur.Simchaev@wdc.com \
    --cc=agross@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=daejun7.park@samsung.com \
    --cc=eddie.huang@mediatek.com \
    --cc=j-young.choi@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=konrad.dybcio@somainline.org \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_xiaosenh@quicinc.com \
    --cc=stanley.chu@mediatek.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®