From: Bean Huo <huobean@gmail.com>
To: Asutosh Das <quic_asutoshd@quicinc.com>,
quic_nguyenb@quicinc.com, quic_xiaosenh@quicinc.com,
stanley.chu@mediatek.com, adrian.hunter@intel.com,
bvanassche@acm.org, avri.altman@wdc.com, mani@kernel.org,
quic_cang@quicinc.com, beanhuo@micron.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
Alim Akhtar <alim.akhtar@samsung.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Jinyoung Choi <j-young.choi@samsung.com>,
Kiwoong Kim <kwmad.kim@samsung.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3 2/4] ufs: core: mcq: Adds Multi-Circular Queue support
Date: Mon, 05 Sep 2022 15:48:15 +0200 [thread overview]
Message-ID: <748f9c294e304cc5b5ccd9804fa647afc39c8bc3.camel@gmail.com> (raw)
In-Reply-To: <04f4949e4dea991a93bdf6727bf12948ecc586be.1662157846.git.quic_asutoshd@quicinc.com>
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.
Kind regards,
Bean
next prev parent reply other threads:[~2022-09-05 13:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1662157846.git.quic_asutoshd@quicinc.com>
2022-09-02 22:41 ` [RFC PATCH v3 1/4] ufs: core: prepare ufs for multi circular queue support Asutosh Das
2022-09-05 12:26 ` Bean Huo
2022-09-08 3:00 ` Asutosh Das (asd)
2022-09-08 8:23 ` Bean Huo
2022-09-08 21:58 ` Bart Van Assche
2022-09-09 22:48 ` Asutosh Das (asd)
2022-09-09 23:38 ` Bart Van Assche
2022-09-12 18:18 ` Asutosh Das (asd)
2022-09-02 22:41 ` [RFC PATCH v3 2/4] ufs: core: mcq: Adds Multi-Circular Queue support Asutosh Das
2022-09-05 13:48 ` Bean Huo [this message]
2022-09-08 3:01 ` Asutosh Das (asd)
2022-09-05 14:19 ` Bean Huo
2022-09-05 16:27 ` Bean Huo
2022-09-08 3:01 ` Asutosh Das (asd)
2022-09-08 22:02 ` Bart Van Assche
2022-09-08 23:21 ` Bart Van Assche
2022-09-02 22:41 ` [RFC PATCH v3 3/4] ufs: core: Add Event Specific Interrupt configuration vendor specific ops Asutosh Das
2022-09-02 22:41 ` [RFC PATCH v3 4/4] ufs: host: qcom: Add MCQ support Asutosh Das
2022-09-08 22:30 ` Bart Van Assche
2022-09-09 22:43 ` Asutosh Das (asd)
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=748f9c294e304cc5b5ccd9804fa647afc39c8bc3.camel@gmail.com \
--to=huobean@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=j-young.choi@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=krzysztof.kozlowski@linaro.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®