Re: [PATCH V22 07/22] mmc: core: Support UHS-II card control and access

From: Ulf Hansson
Date: Thu Oct 10 2024 - 07:22:43 EST


[...]

> > > +
> > > + /*
> > > + * NOTE:
> > > + * Should we read Externsion Register to check power notification feature here?
> > > + */
> >
> > Yes, this is needed too.
> >
>
> Hi, Ulf
>
> We have the call sd_can_poweroff_notify() in the _mmc_sd_suspend() and
> _sd_uhs2_suspend.
> If we need to check the power notification feature here,
> do you have any suggestions for the type of power notification that
> needs to be confirmed?

Right, I see what you mean! It's been a while since I read these parts
of the SD spec, apologize for my ignorance.

In UHS-II mode, the power-off-notification is *not* supported. This
means that we should not use it from _sd_uhs2_suspend().

In UHS-II mode we should instead use the so-called "hibernate" mode
(hbr bit in the GO_DORMANT command), which allows us to turn off
clocks and VDD1 (corresponds to the vmmc regulator). Note that the
support for hibernate mode is optional for an UHS-II SD card. Thus,
the support must be checked via the corresponding field in the PHY
capabilities, before we try to use it.

That said, to not make it more complicated for you to get the basic
UHS-II support landed upstream, I am fine if you decide to defer the
support for hibernate mode to later. Instead, it seems like we should
just do a regular power-off in _sd_uhs2_suspend(). In other words,
just call sd_uhs2_power_off() from there.

Moreover, reading the SD Extension Registers would still be valuable
during the UHS-II card initialization (even if hibernate isn't
supported), as it allows us to support the "cache maintenance"
feature, for example. However, the support for these features are
optional too for SD cards, so I am fine if you decide to defer this to
a later improvement too.

Does this make sense to you?

[...]

Kind regards
Uffe