RE: Re: [PATCH v8 3/3] mmc: sdhci-esdhc-imx: remove redundant mx25 handling and consolidate soc data

From: Luke Wang

Date: Sun Mar 22 2026 - 22:40:57 EST




> -----Original Message-----
> From: Fabio Estevam <festevam@xxxxxxxxx>
> Sent: Friday, March 20, 2026 4:37 AM
> To: Adrián García Casado <adriangarciacasado42@xxxxxxxxx>
> Cc: Ulf Hansson <ulf.hansson@xxxxxxxxxx>; Bough Chen
> <haibo.chen@xxxxxxx>; Frank Li <frank.li@xxxxxxx>; Sascha Hauer
> <s.hauer@xxxxxxxxxxxxxx>; linux-mmc@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx;
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Miguel
> Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
> Subject: [EXT] Re: [PATCH v8 3/3] mmc: sdhci-esdhc-imx: remove redundant
> mx25 handling and consolidate soc data
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> On Thu, Mar 19, 2026 at 5:10 PM Adrián García Casado
> <adriangarciacasado42@xxxxxxxxx> wrote:
>
> > @@ -873,11 +865,8 @@ static void esdhc_writeb_le(struct sdhci_host
> *host, u8 val, int reg)
> > new_val = val & SDHCI_CTRL_LED;
> > /* ensure the endianness */
> > new_val |= ESDHC_HOST_CONTROL_LE;
> > - /* bits 8&9 are reserved on mx25 */
> > - if (!is_imx25_esdhc(imx_data)) {
> > - /* DMA mode bits are shifted */
> > - new_val |= (val & SDHCI_CTRL_DMA_MASK) << 5;
> > - }
>
> This removal of the i.MX25 check does not look correct.

Hi Fabio,

The option to remove the imx25-related code was actually suggested by me during the v4 patch discussion.

"
The original use of is_imx25_esdhc() to avoid setting DMA SELECT bits was because mx25 doesn't support ADMA, introduced in commit 9a0985b78d70.

However, before that commit, imx25 was already using SDHCI_QUIRK_BROKEN_ADMA to disable ADMA (commit 97e4ba6a5ea9), which theoretically should prevent the DMA SELECT bits from being set.

The actual reason DMA SELECT was being set incorrectly was due to a bug: u32 new_val was used without being initialized, causing DMA SELECT to potentially be set to random values.

The new_val initialization issue was fixed in commit 81a0a8bc380d, but that fix was made for a different reason - it was not recognized at that time that the DMA SELECT issue was also caused by the uninitialized new_val. As a result, the is_imx25_esdhc() check was preserved.

After the new_val initialization fix, is_imx25_esdhc() should no longer be necessary. So merging mx25 and mx35 is indeed valid. If you'd like, you can go further and remove the is_imx25_esdhc() related code entirely.
"

Regards,
Luke