From: Ulf Hansson <ulf.hansson@stericsson.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Sebastian Rasmussen <sebras@gmail.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mmc: mmci: Improve runtime PM support
Date: Mon, 24 Oct 2011 17:34:53 +0200 [thread overview]
Message-ID: <4EA5859D.80602@stericsson.com> (raw)
In-Reply-To: <4EA58368.6050704@stericsson.com>
Ulf Hansson wrote:
> Linus Walleij wrote:
>> On Mon, Oct 24, 2011 at 1:48 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
>>> [Russell]
>>>> The MCIPWR signal controls the external power switch. This is the only
>>>> signal for it. This is the only connection for it. There is no other
>>>> control form for this power switch.
>>>>
>>> Then we are only left to use the variant struct I believe. In principle, a
>>> flag in the variant struct, could indicate whether it is OK to disable the
>>> vcore regulator and thus clear the MCIPWR when doing runtime_suspend.
>> Yep I think the best could be to add some variant named
>> bool external_card_power; and then document in the kerneldoc that this
>> means the driver can clear MMCIPWR without risk of cutting the power
>> to the card.
>>
>> This should be true for Ux500, U300 and Nomadik (just checked the designs -
>> they all have external regulators).
>>
>
> Could we assume that all boards which utilizes the ARM PL180 are using
> the MMCIPWR register to control power the card? Or should we add a new
> amba mmci platform member so this is configurable for each board?
>
> An option could also be if we might want to simplify code to just skip
> the entire runtime_suspend|idle|resume function (ie stubb it or
> something) for these kind of boards?
>
> What do you prefer?
By the way, there is also another option. In the runtime_suspend
function for ARM PL180 block we can use mmc_power_save_host (and then
also disable vcore etc) and vice verse in runtime_resume with
mmc_power_restore_host.
Of course, these kind of operations takes quite some time to execute and
therefore we use a much bigger timeout than 50 ms (for example 10 s
instead) for ARM PL180.
Just an idea...
>
>> So the state save/restore and amba_vcore_disable(adev); should be done
>> only for those variants.
>>
>> However this:
>>
>> clk_disable(host->clk);
>>
>> We ought to be able to do for *all* variants, provided we can create
>> pm_runtime_get/put and delay properly to cover all bus traffic
>> (looks like the patch already does that), plus all the time the card is
>> signalling busy. The best I can think of is to just return -EBUSY to runtime
>> PM like this:
>>
>> if ((readl(base + MMCISTATUS) & (MCI_CMDACTIVE | MCI_TXACTIVE| MCI_RXACTIVE))
>> return -EBUSY;
>>
>> Yours,
>> Linus Walleij
>>
>
>
WARNING: multiple messages have this Message-ID (diff)
From: ulf.hansson@stericsson.com (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mmci: Improve runtime PM support
Date: Mon, 24 Oct 2011 17:34:53 +0200 [thread overview]
Message-ID: <4EA5859D.80602@stericsson.com> (raw)
In-Reply-To: <4EA58368.6050704@stericsson.com>
Ulf Hansson wrote:
> Linus Walleij wrote:
>> On Mon, Oct 24, 2011 at 1:48 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
>>> [Russell]
>>>> The MCIPWR signal controls the external power switch. This is the only
>>>> signal for it. This is the only connection for it. There is no other
>>>> control form for this power switch.
>>>>
>>> Then we are only left to use the variant struct I believe. In principle, a
>>> flag in the variant struct, could indicate whether it is OK to disable the
>>> vcore regulator and thus clear the MCIPWR when doing runtime_suspend.
>> Yep I think the best could be to add some variant named
>> bool external_card_power; and then document in the kerneldoc that this
>> means the driver can clear MMCIPWR without risk of cutting the power
>> to the card.
>>
>> This should be true for Ux500, U300 and Nomadik (just checked the designs -
>> they all have external regulators).
>>
>
> Could we assume that all boards which utilizes the ARM PL180 are using
> the MMCIPWR register to control power the card? Or should we add a new
> amba mmci platform member so this is configurable for each board?
>
> An option could also be if we might want to simplify code to just skip
> the entire runtime_suspend|idle|resume function (ie stubb it or
> something) for these kind of boards?
>
> What do you prefer?
By the way, there is also another option. In the runtime_suspend
function for ARM PL180 block we can use mmc_power_save_host (and then
also disable vcore etc) and vice verse in runtime_resume with
mmc_power_restore_host.
Of course, these kind of operations takes quite some time to execute and
therefore we use a much bigger timeout than 50 ms (for example 10 s
instead) for ARM PL180.
Just an idea...
>
>> So the state save/restore and amba_vcore_disable(adev); should be done
>> only for those variants.
>>
>> However this:
>>
>> clk_disable(host->clk);
>>
>> We ought to be able to do for *all* variants, provided we can create
>> pm_runtime_get/put and delay properly to cover all bus traffic
>> (looks like the patch already does that), plus all the time the card is
>> signalling busy. The best I can think of is to just return -EBUSY to runtime
>> PM like this:
>>
>> if ((readl(base + MMCISTATUS) & (MCI_CMDACTIVE | MCI_TXACTIVE| MCI_RXACTIVE))
>> return -EBUSY;
>>
>> Yours,
>> Linus Walleij
>>
>
>
next prev parent reply other threads:[~2011-10-24 15:35 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 15:25 [PATCH] mmc: mmci: Improve runtime PM support Ulf Hansson
2011-10-21 15:25 ` Ulf Hansson
2011-10-21 17:36 ` Russell King - ARM Linux
2011-10-21 17:36 ` Russell King - ARM Linux
[not found] ` <CAKnu2MrOriMzJH9NcwUivWa0cinASa6wrRf4a69si4WUs-aTrQ@mail.gmail.com>
2011-10-23 0:31 ` Sebastian Rasmussen
2011-10-23 0:31 ` Sebastian Rasmussen
2011-10-24 8:05 ` Ulf Hansson
2011-10-24 8:05 ` Ulf Hansson
2011-10-24 9:04 ` Russell King - ARM Linux
2011-10-24 9:04 ` Russell King - ARM Linux
2011-10-24 9:36 ` Ulf Hansson
2011-10-24 9:36 ` Ulf Hansson
2011-10-24 9:42 ` Russell King - ARM Linux
2011-10-24 9:42 ` Russell King - ARM Linux
2011-10-24 10:06 ` Ulf Hansson
2011-10-24 10:06 ` Ulf Hansson
2011-10-24 10:14 ` Russell King - ARM Linux
2011-10-24 10:14 ` Russell King - ARM Linux
2011-10-24 11:48 ` Ulf Hansson
2011-10-24 11:48 ` Ulf Hansson
2011-10-24 12:18 ` Linus Walleij
2011-10-24 12:18 ` Linus Walleij
2011-10-24 15:25 ` Ulf Hansson
2011-10-24 15:25 ` Ulf Hansson
2011-10-24 15:34 ` Ulf Hansson [this message]
2011-10-24 15:34 ` Ulf Hansson
2011-10-25 7:12 ` Linus Walleij
2011-10-25 7:12 ` Linus Walleij
2011-10-25 7:39 ` Ulf Hansson
2011-10-25 7:39 ` Ulf Hansson
2011-10-24 9:11 ` Sebastian Rasmussen
2011-10-24 9:11 ` Sebastian Rasmussen
2011-10-24 9:14 ` Linus Walleij
2011-10-24 9:14 ` Linus Walleij
2011-10-24 9:36 ` Russell King - ARM Linux
2011-10-24 9:36 ` Russell King - ARM Linux
2011-10-24 9:54 ` Linus Walleij
2011-10-24 9:54 ` Linus Walleij
2011-10-24 9:56 ` Russell King - ARM Linux
2011-10-24 9:56 ` Russell King - ARM Linux
2011-10-24 10:17 ` Ulf Hansson
2011-10-24 10:17 ` Ulf Hansson
2011-10-24 11:49 ` Linus Walleij
2011-10-24 11:49 ` Linus Walleij
2011-10-25 8:05 ` Adrian Hunter
2011-10-25 8:05 ` Adrian Hunter
2011-10-25 8:53 ` Linus Walleij
2011-10-25 8:53 ` Linus Walleij
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=4EA5859D.80602@stericsson.com \
--to=ulf.hansson@stericsson.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=sebras@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.