Re: MMC_CAP_POWER_OFF_CARD, MMC_PM_KEEP_POWER - when to set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 May 2012, Ohad Ben-Cohen wrote:

> Hi Guennadi,
> 
> On Thu, May 24, 2012 at 4:07 PM, Guennadi Liakhovetski
> <g.liakhovetski@xxxxxx> wrote:
> > How do you know, if this is a normal sd-card slot?
> 
> Not sure I follow the question.

Sorry, I mean - you don't know what card will be plugged in, so, you 
cannot know, whether that specific card and its driver can be safely 
powered off.

> But if you ask whether we can dynamically set MMC_CAP_POWER_OFF_CARD,
> then we can't (with what we know today).
> 
> This CAP is dealing with issues of specific boards which,
> unfortunately, we have no way (today) to dynamically probe.
> 
> >> No, MMC_PM_KEEP_POWER is different: it is a dynamic user decision
> >> controlling whether the card should stay on while the system is
> >> suspended,
> >
> > Isn't it both?
> 
> Yes, you're right - we need host support to keep the card powered
> while the system is suspended.
> 
> > A complete board reset in this case will differ from the card power-off
> > only in the state of the rest of the SD-card ping, e.g., the clock. So,
> > additionally switching off the clock in this case should be equivalent to
> > the board reset?
> 
> Not really - consider the example I gave you, where you are required
> to toggle a card reset pin after you power cycle it, but there's no
> way to control that pin. In that case, only a complete board reset can
> help you.
> 
> > Given the above, wouldn't it be sufficient to test (mmc->pm_flags &
> > MMC_PM_KEEP_POWER) to decide, whether the card can be suspended?
> 
> No,
> 
> MMC_PM_KEEP_POWER is about the ability (and desire) to keep the card
> powered while the system is suspended.
> 
> MMC_CAP_POWER_OFF_CARD is about the ability to power off the card
> without killing it completely until the next board reset.

Ok, I think, it's this: MMC_PM_KEEP_POWER is for system-wide suspend / 
resume, whereas MMC_CAP_POWER_OFF_CARD is for runtime PM. Am I right? In 
that case, I think, they also should function similar - wouldn't it make 
sense to use MMC_CAP_POWER_OFF_CARD similar to MMC_PM_KEEP_POWER - as a 
static capability flag (meaning, whether the board is physically able to 
switch power) and a dynamic flag, that, say, an SDIO function driver could 
set if it knows, that it cannot handle runtime power switching properly?

Thanks
Guennadi

> These two flags really address completely different problems, despite
> the similar nomenclature.
> 
> Thanks,
> Ohad.

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux