[PATCH] mmc: dw_mmc: rockchip: Keep controller working for card detect

Ulf Hansson ulf.hansson at linaro.org
Wed Oct 2 14:55:29 PDT 2024


On Sat, 14 Sept 2024 at 13:52, Heiko Stübner <heiko at sntech.de> wrote:
>
> Am Donnerstag, 12. September 2024, 09:26:14 CEST schrieb Kever Yang:
> > In order to make the SD card hotplug working we need the card detect
> > function logic inside the controller always working. The runtime PM will
> > gate the clock and the power domain, which stops controller working when
> > no data transfer happen.
> >
> > So lets skip enable runtime PM when the card needs to detected by the
> > controller and the card is removable.
> >
> > Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
>
> So for the change itself this looks good, i.e. it fixes an issue for baords relying
> on the on-chip-card-detect.
>
>
> But for boards doing that, the controller will be running _all the time_
> even if there is never any card inserted.
>
> So relying on the on-soc card-detect will effectively increase the power-
> consumption of the board - even it it'll never use any sd-card?

Good point! A better option is to use a polling based mechanism - and
we have MMC_CAP_NEEDS_POLL for exactly that.

Moreover, on DT based platforms one can even use the "broken-cd"
property to indicate this.

[...]

Kind regards
Uffe



More information about the Linux-rockchip mailing list