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

Commit 73c6fde4 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

mmc: sdhci-msm: skip eMMC slot probe if eMMC isn't a bootdevice



If eMMC is not a primary bootdevice, there isn't any point of probing
eMMC device hence disable the probing in such case.

Change-Id: I92fa8c2ef373fd8a9140dbfb41356684aaa28e4e
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent d3846f3c
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -2927,6 +2927,28 @@ static void sdhci_msm_cmdq_init(struct sdhci_host *host,
}
#endif

static bool sdhci_msm_is_bootdevice(struct device *dev)
{
	if (strnstr(saved_command_line, "androidboot.bootdevice=",
		    strlen(saved_command_line))) {
		char search_string[50];

		snprintf(search_string, ARRAY_SIZE(search_string),
			"androidboot.bootdevice=%s", dev_name(dev));
		if (strnstr(saved_command_line, search_string,
		    strlen(saved_command_line)))
			return true;
		else
			return false;
	}

	/*
	 * "androidboot.bootdevice=" argument is not present then
	 * return true as we don't know the boot device anyways.
	 */
	return true;
}

static int sdhci_msm_probe(struct platform_device *pdev)
{
	struct sdhci_host *host;
@@ -2990,6 +3012,11 @@ static int sdhci_msm_probe(struct platform_device *pdev)
				ret);
			goto pltfm_free;
		}

		/* skip the probe if eMMC isn't a boot device */
		if ((ret == 1) && !sdhci_msm_is_bootdevice(&pdev->dev))
			goto pltfm_free;

		if (disable_slots & (1 << (ret - 1))) {
			dev_info(&pdev->dev, "%s: Slot %d disabled\n", __func__,
				ret);
+3 −0
Original line number Diff line number Diff line
@@ -159,4 +159,7 @@ struct sdhci_msm_host {
	struct sdhci_msm_ice_data ice;
	u32 ice_clk_rate;
};

extern char *saved_command_line;

#endif /* __SDHCI_MSM_H__ */