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

Commit 59e5f511 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufs-msm: probe UFS only if it is the boot device



Boot device can be either UFS or eMMC which means if eMMC is the boot
device, probing UFS device is not desirable as it's not going to be
used after probing. Kernel command line parameter "android.bootdevice"
tells the kernel about the boot device so look at this boot device
parameter to know whether to probe UFS device or not.

Change-Id: I053b9611088263cd8de64085754c00d082aec3ed
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent ffc9b693
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2792,6 +2792,15 @@ out:
	return err;
}

#define	ANDROID_BOOT_DEV_MAX	30
static char android_boot_dev[ANDROID_BOOT_DEV_MAX];
static int get_android_boot_dev(char *str)
{
	strlcpy(android_boot_dev, str, ANDROID_BOOT_DEV_MAX);
	return 1;
}
__setup("androidboot.bootdevice=", get_android_boot_dev);

/**
 * msm_ufs_init - bind phy with controller
 * @hba: host controller instance
@@ -2809,6 +2818,9 @@ static int msm_ufs_init(struct ufs_hba *hba)
	struct msm_ufs_phy *phy = msm_get_ufs_phy(hba->dev);
	struct msm_ufs_host *host;

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

	if (IS_ERR(phy)) {
		err = PTR_ERR(phy);
		goto out;