devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Gautier <yann.gautier@foss.st.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Russell King <linux@armlinux.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	"linux-stm32@st-md-mailman.stormreply.com" 
	<linux-stm32@st-md-mailman.stormreply.com>,
	DTML <devicetree@vger.kernel.org>,
	Ludovic BARRE - foss <ludovic.barre@foss.st.com>,
	Christophe ROULLIER-SCND-02 <christophe.roullier@foss.st.com>
Subject: Re: Question about MMC_PM_KEEP_POWER in MMCI driver
Date: Wed, 1 Sep 2021 09:32:46 +0200	[thread overview]
Message-ID: <8b2f3a6a-150d-4e78-7bbc-6d1de9fae000@foss.st.com> (raw)
In-Reply-To: <CAPDyKFqMJmJRLNYF=gWvAEH8wtJzrxrZ9KLz62t4XNsD84vr=Q@mail.gmail.com>

On 8/30/21 3:43 PM, Ulf Hansson wrote:
> On Wed, 25 Aug 2021 at 16:34, Yann Gautier <yann.gautier@foss.st.com> wrote:
>>
>> Hi,
>>

Hi Linus,

Thanks for the advice.

>> In drivers/mmc/host/mmci.c, MMC_PM_KEEP_POWER is unconditionally enabled.
>> This prevents correct low-power sequence on STM32MP157C-DK2 board which
>> embeds a Wifi chip brcm,bcm4329-fmac (this wifi part has not yet been
>> sent upstream).
> 
> Exactly why doesn't this work with the STM32MP157C-DK2 board?
> 
It is more the opposite.
We had that patch in our downstream for a while, and this was possible 
due to changes in wifi driver.
But I'll check all that precisely, and make some more tests.

>>
>> This MMC_PM_KEEP_POWER can be taken from DT with the property
>> keep-power-in-suspend. This is what is done for other MMC drivers.
> 
> The DT property is what should have been used for mmci as well.
> 
>>
>> I wonder what should be the best solution for this.
>>
>> 1) Remove MMC_PM_KEEP_POWER from the driver, and modify all SoC device
>> tree files embedding a arm,pl18x with adding keep-power-in-suspend;
>> property (except stm32mp151.dtsi file).
>> This can be easy to do (~10 files to modify). But that could be more
>> board dependent, if an SDIO chip is plugged on this MMC IP.
>> And the name keep-power-in-suspend can be misleading as it only applies
>> to SDIO.
>>
>> 2) Remove MMC_PM_KEEP_POWER from the driver, and modify board DT files
>> with the property. This could be a difficult task to find all those
>> boards. And this should be applied only for SDIO configs.
>>
>> 3) Just modify the driver to apply this capability for all MMCI chips
>> but STM32. This could be done in the dedicated file, in
>> sdmmc_variant_init() function. But some boards based on STM32MP15 chip
>> might want to keep this capability.
> 
> I would suggest option 3).
> 
> As a matter of fact, we also allow MMC_PM_KEEP_POWER to become set
> when parsing the DTB via calling mmc_of_parse(). So just changing the
> default value (don't set MMC_PM_KEEP_POWER) for the stm32 variant,
> would do the trick I think.
> 
OK, I'll do that, in mmci.c file, keeping the possibility to have the DT 
property set even for stm32 variant.

> Kind regards
> Uffe
> 
Best regards,
Yann

      reply	other threads:[~2021-09-01  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 14:34 Question about MMC_PM_KEEP_POWER in MMCI driver Yann Gautier
2021-08-30 13:43 ` Ulf Hansson
2021-09-01  7:32   ` Yann Gautier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b2f3a6a-150d-4e78-7bbc-6d1de9fae000@foss.st.com \
    --to=yann.gautier@foss.st.com \
    --cc=christophe.roullier@foss.st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.barre@foss.st.com \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).