提交 2076f57f 编写于 作者: A Asutosh Das 提交者: Martin K. Petersen

scsi: ufs: mcq: Fix incorrectly set queue depth

ufshcd_config_mcq() may change the can_queue value. The current code
invokes scsi_add_host() before ufshcd_config_mcq() so the tags are
limited to the original can_queue value.

Fix this by invoking scsi_add_host() after ufshcd_config_mcq().

Link: https://lore.kernel.org/r/8840cea4a57b46dabce18acc39afc50ab826330f.1676567593.git.quic_asutoshd@quicinc.com
Fixes: 2468da61 ("scsi: ufs: core: mcq: Configure operation and runtime interface")
Signed-off-by: NAsutosh Das <quic_asutoshd@quicinc.com>
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Reviewed-by: NManivannan Sadhasivam <mani@kernel.org>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 19873b03
...@@ -8521,7 +8521,9 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params) ...@@ -8521,7 +8521,9 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
return ret; return ret;
if (is_mcq_supported(hba) && !hba->scsi_host_added) { if (is_mcq_supported(hba) && !hba->scsi_host_added) {
ret = ufshcd_alloc_mcq(hba); ret = ufshcd_alloc_mcq(hba);
if (ret) { if (!ret) {
ufshcd_config_mcq(hba);
} else {
/* Continue with SDB mode */ /* Continue with SDB mode */
use_mcq_mode = false; use_mcq_mode = false;
dev_err(hba->dev, "MCQ mode is disabled, err=%d\n", dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
...@@ -8533,10 +8535,10 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params) ...@@ -8533,10 +8535,10 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
return ret; return ret;
} }
hba->scsi_host_added = true; hba->scsi_host_added = true;
} } else if (is_mcq_supported(hba)) {
/* MCQ may be disabled if ufshcd_alloc_mcq() fails */ /* UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH is set */
if (is_mcq_supported(hba) && use_mcq_mode)
ufshcd_config_mcq(hba); ufshcd_config_mcq(hba);
}
} }
ufshcd_tune_unipro_params(hba); ufshcd_tune_unipro_params(hba);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册