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 18:27:03 +0200 [thread overview]
Message-ID: <c3d2d8b307f7e11b7a2be751673220049b9a1a77.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:
>
> +
> +static void ufshcd_mcq_config_nr_queues(struct ufs_hba *hba)
> +{
> + int i, rem;
> + u32 hbaq_cap, cmp;
> + struct Scsi_Host *host = hba->host;
> +
> + hbaq_cap = hba->mcq_capabilities & 0xff;
> +
> + rem = hbaq_cap - dev_cmd_queue;
> + /* min() compares variables of same type */
> + hba->nr_queues[HCTX_TYPE_DEFAULT] = min(hbaq_cap -
> dev_cmd_queue,
hba->nr_queues[HCTX_TYPE_DEFAULT] = min(rem, num_possible_cpus());
> + num_possible_cpus());
> + rem -= hba->nr_queues[HCTX_TYPE_DEFAULT];
> + if (rem <= 0)
> + goto out;
> + cmp = rem;
> + hba->nr_queues[HCTX_TYPE_POLL] = min(cmp, poll_queues);
> + rem -= hba->nr_queues[HCTX_TYPE_POLL];
> + if (rem <= 0)
> + goto out;
> + cmp = rem;
> + hba->nr_queues[HCTX_TYPE_READ] = min(cmp, read_queues);
static read_queues is not initialized.
>
.....
> +static inline void ufshcd_inc_tp(struct ufs_hw_queue *q)
> +{
> + u32 mask = q->max_entries - 1;
> + u32 val;
> +
> + q->sq_tp_slot = (q->sq_tp_slot + 1) & mask;
> + val = q->sq_tp_slot * sizeof(struct utp_transfer_req_desc);
> + writel(val, q->mcq_sq_tp);
> +}
This function just accesses the submission queue tail pointer. The
function name should clearly explain this.
next prev parent reply other threads:[~2022-09-05 16:27 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
2022-09-08 3:01 ` Asutosh Das (asd)
2022-09-05 14:19 ` Bean Huo
2022-09-05 16:27 ` Bean Huo [this message]
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=c3d2d8b307f7e11b7a2be751673220049b9a1a77.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®