Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3933ba3d authored by Nitin Rawat's avatar Nitin Rawat
Browse files

scsi: ufs: Don't skip UFS probe in emmc based bootdevice



As a part of sync-state callback feature introduced in 5.4, clocks
which are enabled by default with the hold-state mechanism during
bootloader will be automatically disabled when the clock provider’s
i.e gcc sync-state callback triggers. So clocks enabled from boot
will be cleaned up in sync-state call back.

The sync-state callback is triggered when all consumers of a given
supplier(gcc here) have successfully probed. In current implementation,
in emmc based bootdevice, we return UFS platform driver probe failure
with reason as ENODEV which will cause the GCC sync-state callback not
getting fired and hence leaving the ufs clocks in enabled state.

So for the gcc sync state to be successful so as to remove proxy vote
for all gcc consumer ,we must not bail out and let UFS platform
driver probes successfully. Later as a part of async scan, when
UFS device detection and initialisation fails, we can turn off
power/clocks as a part of hba exit.

Change-Id: Icfcc8ceb76399f6e37454d356a5f9767f30dd4b3
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
parent 423554d6
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@
#define UFS_QCOM_DEFAULT_DBG_PRINT_EN	\
	(UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN)

#define	ANDROID_BOOT_DEV_MAX	30
static char android_boot_dev[ANDROID_BOOT_DEV_MAX];

enum {
	TSTBUS_UAWM,
	TSTBUS_UARM,
@@ -975,9 +978,14 @@ static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
	int err = 0;
	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
	struct phy *phy = host->generic_phy;
	struct device *dev = hba->dev;

	switch (status) {
	case PRE_CHANGE:
		if (strlen(android_boot_dev) && strcmp(android_boot_dev, dev_name(dev))) {
			return -ENODEV;
		}

		if (ufs_qcom_cfg_timers(hba, UFS_PWM_G1, SLOWAUTO_MODE,
					0, true)) {
			dev_err(hba->dev, "%s: ufs_qcom_cfg_timers() failed\n",
@@ -2051,9 +2059,6 @@ static const struct reset_control_ops ufs_qcom_reset_ops = {
	.deassert = ufs_qcom_reset_deassert,
};

#define	ANDROID_BOOT_DEV_MAX	30
static char android_boot_dev[ANDROID_BOOT_DEV_MAX];

#ifndef MODULE
static int __init get_android_boot_dev(char *str)
{
@@ -2640,9 +2645,6 @@ static int ufs_qcom_init(struct ufs_hba *hba)
	struct ufs_qcom_host *host;
	struct resource *res;

	if (strlen(android_boot_dev) && strcmp(android_boot_dev, dev_name(dev)))
		return -ENODEV;

	host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
	if (!host) {
		err = -ENOMEM;
+3 −1
Original line number Diff line number Diff line
@@ -4687,7 +4687,9 @@ static int ufshcd_link_startup(struct ufs_hba *hba)

link_startup:
	do {
		ufshcd_vops_link_startup_notify(hba, PRE_CHANGE);
		ret = ufshcd_vops_link_startup_notify(hba, PRE_CHANGE);
		if (ret == -ENODEV)
			return ret;

		ret = ufshcd_dme_link_startup(hba);