[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e92d248b-6041-49bc-a3dd-1e17abf0fb26@acm.org>
Date: Wed, 9 Nov 2022 13:16:16 -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>,
Adrian Hunter <adrian.hunter@...el.com>,
Arthur Simchaev <Arthur.Simchaev@....com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Jinyoung Choi <j-young.choi@...sung.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 05/16] ufs: core: mcq: Add Multi Circular Queue support
On 11/9/22 11:41, Asutosh Das wrote:
> +static int ufshcd_mcq_config_nr_queues(struct ufs_hba *hba)
> +{
> + int i;
> + u32 hba_maxq, rem, tot_queues;
> + struct Scsi_Host *host = hba->host;
> +
> + hba_maxq = FIELD_GET(GENMASK(7, 0), hba->mcq_capabilities);
> +
> + if (!rw_queues)
> + rw_queues = num_possible_cpus();
> +
> + tot_queues = UFS_MCQ_NUM_DEV_CMD_QUEUES + read_queues + poll_queues +
> + rw_queues;
> +
> + if (hba_maxq < tot_queues) {
> + dev_err(hba->dev, "Total queues (%d) exceeds HC capacity (%d)\n",
> + tot_queues, hba_maxq);
> + return -EOPNOTSUPP;
> + }
This function can fail with default kernel module parameters, e.g.
num_possible_cpus() == 8 and hba_maxq == 4. This is not acceptable. A
better solution is required, e.g. reducing rw_queues if the user has not
set this kernel module parameter.
Thanks,
Bart.
Powered by blists - more mailing lists