[PATCH v2] mmc: Remove alignment hole for cmdidx in struct mmc_cmd

Ferass El Hafidi funderscore at postmarketos.org
Tue Jan 21 18:05:14 CET 2025


On Sun Jan 19, 2025 at 11:35 PM UTC, Jonas Karlman wrote:
> <...>
> On 2024-04-03 02:00, Jaehoon Chung wrote:
> <...>
> > On 1/28/24 01:29, Jonas Karlman wrote:
> >> The alignment hole caused by cmdidx in struct mmc_cmd cause strange
> >> issues together with the peephole2 optimization on Amlogic SoCs.
> >> Following was observed while working on SPL support for Amlogic SoCs.
> >>
> >> sd_get_capabilities() normally issue a CMD55 followed by a CMD51.
> >> However, on at least Amlogic S905 (Cortex-A53) and S905X3 (Cortex-A55),
> >> CMD55 was instead followed by CMD8 (and a few reties) in SPL.
> > 
> > I read your RFC "https://patchwork.ozlabs.org/patch/1841495/
> > 
> > First, I will retry to reproduce your case with other compiler. 
> > After that, I will inform again about this patch.
>
> Gentle ping, this patch has been on list for almost a year now.
>
> Have you had any time to reproduce this or can this be merged as-is?
>
> For some reason only Amlogic seem to be affected by this issue.

It is somewhat reproducible with gcc 14 on Amlogic S905X (Libre Computer
lepotato), except instead of CMD55 followed by CMD8, I get CMD0 followed
by CMD8 directly:

[...]
<debug_uart>

U-Boot SPL 2025.01-00633-gf79293cffe53 (Jan 19 2025 - 14:59:34 +0000)
Trying to boot from MMC1
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:8
                ARG                      0x000001aa
                MMC_RSP_R1,5,6,7         0x000001aa 
CMD_SEND:0
                ARG                      0x00000000
                RET                      -110
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:0
                ARG                      0x00000000
                RET                      -110
Card did not respond to voltage select! : -110
[...]

And the board refuses to boot afterwards.  Changing cmdidx type to uint 
fixes my issue as well.


More information about the U-Boot mailing list