From: Bart Van Assche <bvanassche@acm.org>
To: Manivannan Sadhasivam <mani@kernel.org>, Can Guo <quic_cang@quicinc.com>
Cc: quic_asutoshd@quicinc.com, quic_nguyenb@quicinc.com,
quic_xiaosenh@quicinc.com, stanley.chu@mediatek.com,
adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com,
linux-scsi@vger.kernel.org, kernel-team@android.com,
Alim Akhtar <alim.akhtar@samsung.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Jinyoung Choi <j-young.choi@samsung.com>,
jongmin jeong <jjmin.jeong@samsung.com>,
Kiwoong Kim <kwmad.kim@samsung.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2 1/2] scsi: ufs: Add Multi-Circular Queue support
Date: Thu, 18 Aug 2022 13:24:17 -0700 [thread overview]
Message-ID: <02e92b29-9fcd-b52f-3ddb-e5e20e6db604@acm.org> (raw)
In-Reply-To: <20220812091012.GB4956@thinkpad>
On 8/12/22 02:10, Manivannan Sadhasivam wrote:
> On Thu, Aug 11, 2022 at 03:33:03AM -0700, Can Guo wrote:
>> +static unsigned int dev_cmd_queue = 1;
>> +static unsigned int read_queues;
>
> Where is this initialized?
The Linux kernel coding style does not allow to explicitly initialize
static variables to zero.
>> +
>> +static int rw_queue_count_set(const char *val, const struct kernel_param *kp)
>> +{
>> + unsigned int n;
>> + int ret;
>> +
>> + ret = kstrtouint(val, 10, &n);
>> + if (ret)
>> + return ret;
>> + if (n > num_possible_cpus())
>> + return -EINVAL;
>> + return param_set_uint(val, kp);
>> +}
>> +
>> +static const struct kernel_param_ops rw_queue_count_ops = {
>> + .set = rw_queue_count_set,
>> + .get = param_get_uint,
>> +};
>> +
>> +static unsigned int rw_queues = 8;
>> +module_param_cb(rw_queues, &rw_queue_count_ops, &rw_queues, 0644);
>> +MODULE_PARM_DESC(rw_queues, "Number of queues used for rw. Default value is 8");
>> +
>
> Using module params is not encouraged these days. So please switch to Kconfig.
Hmm ... I think using CONFIG_* variables is worse than using module
parameters since modifying CONFIG_* variables requires rebuilding the
kernel.
>> +struct cq_entry {
>> + /* DW 0-1 */
>> + __le32 command_desc_base_addr_lo;
>> + __le32 command_desc_base_addr_hi;
>> +
>> + /* DW 2 */
>> + __le16 response_upiu_length;
>> + __le16 response_upiu_offset;
>> +
>> + /* DW 3 */
>> + __le16 prd_table_length;
>> + __le16 prd_table_offset;
>> +
>> + /* DW 4 */
>> + __le32 status;
>> +
>> + /* DW 5-7 */
>> + u32 reserved[3];
>> +};
>
> packed?
Using __packed if it is not necessary is wrong since it makes code slower.
Thanks,
Bart.
next prev parent reply other threads:[~2022-08-18 20:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 10:33 [RFC PATCH v2 0/2] UFS Multi-Circular Queue (MCQ) Can Guo
2022-08-11 10:33 ` [RFC PATCH v2 1/2] scsi: ufs: Add Multi-Circular Queue support Can Guo
2022-08-12 9:10 ` Manivannan Sadhasivam
2022-08-18 20:24 ` Bart Van Assche [this message]
2022-08-19 2:57 ` Asutosh Das (asd)
2022-08-19 2:41 ` Bart Van Assche
2022-08-25 1:42 ` Asutosh Das (asd)
2022-08-25 18:04 ` Bart Van Assche
2022-08-25 18:08 ` Asutosh Das (asd)
2022-08-11 10:33 ` [RFC PATCH v2 2/2] scsi: ufs-qcom: Add MCQ support Can Guo
2022-08-19 2:48 ` Bart Van Assche
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=02e92b29-9fcd-b52f-3ddb-e5e20e6db604@acm.org \
--to=bvanassche@acm.org \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=j-young.choi@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=jjmin.jeong@samsung.com \
--cc=kernel-team@android.com \
--cc=kwmad.kim@samsung.com \
--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;
as well as URLs for NNTP newsgroup(s).