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>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Arthur Simchaev <Arthur.Simchaev@wdc.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Jinyoung Choi <j-young.choi@samsung.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 05/16] ufs: core: mcq: Add Multi Circular Queue support
Date: Wed, 9 Nov 2022 13:16:16 -0800	[thread overview]
Message-ID: <e92d248b-6041-49bc-a3dd-1e17abf0fb26@acm.org> (raw)
In-Reply-To: <5f3cfdaee098ef245e19824b45c092acd8cc48c8.1668022680.git.quic_asutoshd@quicinc.com>

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.

  reply	other threads:[~2022-11-09 21:16 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 [this message]
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
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=e92d248b-6041-49bc-a3dd-1e17abf0fb26@acm.org \
    --to=bvanassche@acm.org \
    --cc=Arthur.Simchaev@wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --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=krzysztof.kozlowski@linaro.org \
    --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®