Skip to content

Commit ee229e7

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Configure MCQ after link startup
Commit f46b9a5 ("scsi: ufs: core: Allocate the SCSI host earlier") did not only cause scsi_add_host() to be called earlier. It also swapped the order of link startup and enabling and configuring MCQ mode. Before that commit, the call chains for link startup and enabling MCQ were as follows: ufshcd_init() ufshcd_link_startup() ufshcd_add_scsi_host() ufshcd_mcq_enable() Apparently this change causes link startup to fail. Fix this by configuring MCQ after link startup has completed. Reported-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com> Fixes: f46b9a5 ("scsi: ufs: core: Allocate the SCSI host earlier") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Link: https://patch.msgid.link/20251218230741.2661049-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 9a49157 commit ee229e7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10736,9 +10736,7 @@ static int ufshcd_add_scsi_host(struct ufs_hba *hba)
1073610736
if (is_mcq_supported(hba)) {
1073710737
ufshcd_mcq_enable(hba);
1073810738
err = ufshcd_alloc_mcq(hba);
10739-
if (!err) {
10740-
ufshcd_config_mcq(hba);
10741-
} else {
10739+
if (err) {
1074210740
/* Continue with SDB mode */
1074310741
ufshcd_mcq_disable(hba);
1074410742
use_mcq_mode = false;
@@ -11011,6 +11009,9 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
1101111009
if (err)
1101211010
goto out_disable;
1101311011

11012+
if (hba->mcq_enabled)
11013+
ufshcd_config_mcq(hba);
11014+
1101411015
if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION)
1101511016
goto initialized;
1101611017

0 commit comments

Comments
 (0)