Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Expand the ufshcd_device_init(hba, true) call

Expand the ufshcd_device_init(hba, true) call and remove all code that
depends on init_dev_params == false. This change prepares for combining
the two scsi_add_host() calls.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20241016201249.2256266-9-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
a390e667 69f5eb78

+55 -1
+55 -1
drivers/ufs/core/ufshcd.c
··· 10593 10593 ufshcd_set_ufs_dev_active(hba); 10594 10594 10595 10595 /* Initialize hba, detect and initialize UFS device */ 10596 - err = ufshcd_device_init(hba, /*init_dev_params=*/true); 10596 + ktime_t probe_start = ktime_get(); 10597 + 10598 + hba->ufshcd_state = UFSHCD_STATE_RESET; 10599 + 10600 + err = ufshcd_link_startup(hba); 10601 + if (err) 10602 + goto out_disable; 10603 + 10604 + if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION) 10605 + goto initialized; 10606 + 10607 + /* Debug counters initialization */ 10608 + ufshcd_clear_dbg_ufs_stats(hba); 10609 + 10610 + /* UniPro link is active now */ 10611 + ufshcd_set_link_active(hba); 10612 + 10613 + /* Verify device initialization by sending NOP OUT UPIU */ 10614 + err = ufshcd_verify_dev_init(hba); 10615 + if (err) 10616 + goto out_disable; 10617 + 10618 + /* Initiate UFS initialization, and waiting until completion */ 10619 + err = ufshcd_complete_dev_init(hba); 10620 + if (err) 10621 + goto out_disable; 10622 + 10623 + err = ufshcd_device_params_init(hba); 10624 + if (err) 10625 + goto out_disable; 10626 + 10627 + if (is_mcq_supported(hba)) { 10628 + ufshcd_mcq_enable(hba); 10629 + err = ufshcd_alloc_mcq(hba); 10630 + if (!err) { 10631 + ufshcd_config_mcq(hba); 10632 + } else { 10633 + /* Continue with SDB mode */ 10634 + ufshcd_mcq_disable(hba); 10635 + use_mcq_mode = false; 10636 + dev_err(hba->dev, "MCQ mode is disabled, err=%d\n", 10637 + err); 10638 + } 10639 + err = scsi_add_host(host, hba->dev); 10640 + if (err) { 10641 + dev_err(hba->dev, "scsi_add_host failed\n"); 10642 + goto out_disable; 10643 + } 10644 + hba->scsi_host_added = true; 10645 + } 10646 + 10647 + err = ufshcd_post_device_init(hba); 10648 + 10649 + initialized: 10650 + ufshcd_process_probe_result(hba, probe_start, err); 10597 10651 if (err) 10598 10652 goto out_disable; 10599 10653