U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de,
	Lukasz Majewski <lukma@denx.de>,
	Casey Connolly <casey.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	Aswin Murugan <aswin.murugan@oss.qualcomm.com>,
	Stephan Gerhold <stephan.gerhold@linaro.org>,
	Varadarajan Narayanan <quic_varada@quicinc.com>,
	Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Paul Sajna <sajattack@postmarketos.org>,
	Abbarapu Venkatesh Yadav <venkyada@qti.qualcomm.com>,
	Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/3] drivers: mmc: uclass: Set removable flag based on device tree property
Date: Fri, 1 May 2026 12:27:48 +0530	[thread overview]
Message-ID: <afRO7KbCEm1SdG0d@sumit-xelite> (raw)
In-Reply-To: <20260421-emmc-v2-2-0ebd3322b676@oss.qualcomm.com>

On Tue, Apr 21, 2026 at 06:30:09PM +0530, Balaji Selvanathan wrote:
> The block device removable flag should reflect whether the MMC
> device is physically removable (SD card) or soldered (eMMC). This
> information is specified in the device tree via the "non-removable"
> property and stored in the MMC_CAP_NONREMOVABLE capability flag.
> 
> Update the removable flag in the block device descriptor during
> controller probe to properly reflect the device's removable status.
> This allows the block layer and upper layers (particularly EFI boot
> manager) to distinguish between eMMC and SD cards for appropriate
> handling.
> 
> The default removable=1 is set in mmc_bind(), and this change
> overrides it only for non-removable devices after mmc_of_parse()
> has set the MMC_CAP_NONREMOVABLE capability from the device tree.
> 
> Reviewed-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
> ---
> Changes in v2:
> - Moved removable flag update from generic mmc-uclass.c to platform-
>   specific msm_sdhci.c driver

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-Sumit

> ---
>  drivers/mmc/msm_sdhci.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
> index 66f3cf2de4f..13fd4ae8a7d 100644
> --- a/drivers/mmc/msm_sdhci.c
> +++ b/drivers/mmc/msm_sdhci.c
> @@ -189,6 +189,7 @@ static int msm_sdc_probe(struct udevice *dev)
>  	struct sdhci_host *host = &prv->host;
>  	u32 core_version, core_minor, core_major;
>  	struct reset_ctl bcr_rst;
> +	struct blk_desc *bdesc;
>  	u32 caps;
>  	int ret;
>  
> @@ -252,6 +253,12 @@ static int msm_sdc_probe(struct udevice *dev)
>  	if (ret)
>  		return ret;
>  
> +	if (plat->cfg.host_caps & MMC_CAP_NONREMOVABLE) {
> +		bdesc = mmc_get_blk_desc(&plat->mmc);
> +		if (bdesc)
> +			bdesc->removable = 0;
> +	}
> +
>  	host->mmc = &plat->mmc;
>  	host->mmc->dev = dev;
>  	host->ops = &msm_sdhci_ops;
> 
> -- 
> 2.34.1
> 

  reply	other threads:[~2026-05-01  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 13:00 [PATCH v2 0/3] Enable eMMC and SD card support for QCS615 Balaji Selvanathan
2026-04-21 13:00 ` [PATCH v2 1/3] clk: qcom: qcs615: Add SDCC1 and SDCC2 clock support Balaji Selvanathan
2026-04-21 13:00 ` [PATCH v2 2/3] drivers: mmc: uclass: Set removable flag based on device tree property Balaji Selvanathan
2026-05-01  6:57   ` Sumit Garg [this message]
2026-05-05 13:45   ` Casey Connolly
2026-04-21 13:00 ` [PATCH v2 3/3] configs: qcom_defconfig: Limit MMC transfer size to prevent controller timeout Balaji Selvanathan
2026-05-01  6:58   ` Sumit Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afRO7KbCEm1SdG0d@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=aswin.murugan@oss.qualcomm.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=jh80.chung@samsung.com \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=lukma@denx.de \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=quic_varada@quicinc.com \
    --cc=sajattack@postmarketos.org \
    --cc=stephan.gerhold@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=varadarajan.narayanan@oss.qualcomm.com \
    --cc=venkyada@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox