Linux: sdtweak poll_once doesn't work on Pi 4

Created on 14 Oct 2019  ·  6Comments  ·  Source: raspberrypi/linux

When network booting a pi for with dtoverlay=sdtweak,poll_once, the card is still polled, causing log spam every 10 seconds:

[  144.474158] mmc0: Timeout waiting for hardware cmd interrupt.
[  144.474182] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[  144.474199] mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
[  144.474205] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[  144.474213] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[  144.474221] mmc0: sdhci: Present:   0x1fff0001 | Host ctl: 0x00000001
[  144.474228] mmc0: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
[  144.474234] mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x0000f447
[  144.474242] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[  144.474250] mmc0: sdhci: Int enab:  0x00ff1003 | Sig enab: 0x00ff1003
[  144.474257] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[  144.474262] mmc0: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
[  144.474267] mmc0: sdhci: Cmd:       0x0000371a | Max curr: 0x00080008
[  144.474275] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[  144.474280] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[  144.474284] mmc0: sdhci: Host ctl2: 0x00000000
[  144.474288] mmc0: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
[  144.474293] mmc0: sdhci: ============================================

All 6 comments

The immediate cause of sdtweak's failure to set the non-removable flag on pi4 is that it isn't meant to:

pi@raspberrypi:~ $ dtoverlay -h sdtweak
Name:   sdtweak

Info:   Tunes the bcm2835-sdhost SD/MMC driver
        N.B. This functionality is now available via the sd_* dtparams in the
        base DTB.
...

What is needed is a generic sd_pollonce dtparam, which is easy enough to add. However, it might not be what you want in that may not react well when an SD card is removed (or inserted late).

Perhaps what is really needed, in addition to sd_pollonce, is a driver change to reduce the log spam, perhaps making it conditional on sd_debug.

can this be resolved, please?

I've pushed updated .dts files to rpi-4.19.y that add sd_poll_once dtparams to all downstream .dtbs. You can grab a pre-built version of bcm2711-rpi-4-b.dtb here. Use with dtparam=sd_poll_once.

After using sd_poll_once now the green LED does not work

Hi @pelwell you pushed a build to Google Drive back in January that fixed this issue. Any chance you can post the patch here?

As the sdtweak documentation says, the functionality it provides is now available via the board-specific dtparams:

dtparam=sd_poll_once

sdtweak is effectively deprecated, and will be formally deprecated and removed.

Was this page helpful?
0 / 5 - 0 ratings