RE: [PATCH] mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> Sent: 2022年10月13日 17:33
> To: linux-mmc@xxxxxxxxxxxxxxx
> Cc: Bough Chen <haibo.chen@xxxxxxx>; Adrian Hunter
> <adrian.hunter@xxxxxxxxx>; Ulf Hansson <ulf.hansson@xxxxxxxxxx>;
> Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>; dl-linux-imx
> <linux-imx@xxxxxxx>; Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> Subject: [PATCH] mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only
> on 8bit bus
> 
> The core issues the warning "drop HS400 support since no 8-bit bus" when one
> of the ESDHC_FLAG_HS400* flags is set on a non 8bit capable host. To avoid this
> warning set these flags only on hosts that actually can do 8bit, i.e. have
> bus-width = <8> set in the device tree.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Reviewed-by: Haibo Chen <haibo.chen@xxxxxxx>

Best Regards
Haibo Chen
> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c
> b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 3f4eb49afa025..003534b78493b 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1663,6 +1663,10 @@ static int sdhci_esdhc_imx_probe(struct
> platform_device *pdev)
>  		host->mmc_host_ops.execute_tuning = usdhc_execute_tuning;
>  	}
> 
> +	err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
> +	if (err)
> +		goto disable_ahb_clk;
> +
>  	if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
>  		sdhci_esdhc_ops.platform_execute_tuning =
>  					esdhc_executing_tuning;
> @@ -1670,13 +1674,15 @@ static int sdhci_esdhc_imx_probe(struct
> platform_device *pdev)
>  	if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
>  		host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
> 
> -	if (imx_data->socdata->flags & ESDHC_FLAG_HS400)
> +	if (host->caps & MMC_CAP_8_BIT_DATA &&
> +	    imx_data->socdata->flags & ESDHC_FLAG_HS400)
>  		host->mmc->caps2 |= MMC_CAP2_HS400;
> 
>  	if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
>  		host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
> 
> -	if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
> +	if (host->caps & MMC_CAP_8_BIT_DATA &&
> +	    imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
>  		host->mmc->caps2 |= MMC_CAP2_HS400_ES;
>  		host->mmc_host_ops.hs400_enhanced_strobe =
>  					esdhc_hs400_enhanced_strobe;
> @@ -1698,10 +1704,6 @@ static int sdhci_esdhc_imx_probe(struct
> platform_device *pdev)
>  			goto disable_ahb_clk;
>  	}
> 
> -	err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
> -	if (err)
> -		goto disable_ahb_clk;
> -
>  	sdhci_esdhc_imx_hwinit(host);
> 
>  	err = sdhci_add_host(host);
> --
> 2.30.2





[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux