* [PATCH] mmc: core: Add option to prevent eMMC sleep command
@ 2011-12-14 15:20 Ulf Hansson
2011-12-14 15:25 ` Subhash Jadavani
0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2011-12-14 15:20 UTC (permalink / raw)
To: linux-mmc, Chris Ball; +Cc: Per Forlin, Ulf Hansson, Johan Rudholm, Lee Jones
Host may now use MMC_CAP2_NOSLEEP to disable the use of
eMMC sleep/awake command.
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
---
drivers/mmc/core/core.c | 6 ++++++
include/linux/mmc/host.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a2aa860..5a1ce37 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2246,6 +2246,9 @@ int mmc_card_awake(struct mmc_host *host)
{
int err = -ENOSYS;
+ if (host->caps2 & MMC_CAP2_NOSLEEP)
+ return 0;
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
@@ -2261,6 +2264,9 @@ int mmc_card_sleep(struct mmc_host *host)
{
int err = -ENOSYS;
+ if (host->caps2 & MMC_CAP2_NOSLEEP)
+ return 0;
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9a03d03..d07fb27 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -242,6 +242,7 @@ struct mmc_host {
#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */
#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
+#define MMC_CAP2_NOSLEEP (1 << 4) /* Don't allow sleep command */
mmc_pm_flag_t pm_caps; /* supported pm features */
unsigned int power_notify_type;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] mmc: core: Add option to prevent eMMC sleep command
2011-12-14 15:20 [PATCH] mmc: core: Add option to prevent eMMC sleep command Ulf Hansson
@ 2011-12-14 15:25 ` Subhash Jadavani
2011-12-14 15:34 ` Ulf Hansson
0 siblings, 1 reply; 5+ messages in thread
From: Subhash Jadavani @ 2011-12-14 15:25 UTC (permalink / raw)
To: 'Ulf Hansson', linux-mmc, 'Chris Ball'
Cc: 'Per Forlin', 'Johan Rudholm',
'Lee Jones'
Why is this patch needed? Do you see any issue with eMMC sleep on particular
cards?
Regards,
Subhash
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Ulf Hansson
> Sent: Wednesday, December 14, 2011 8:51 PM
> To: linux-mmc@vger.kernel.org; Chris Ball
> Cc: Per Forlin; Ulf Hansson; Johan Rudholm; Lee Jones
> Subject: [PATCH] mmc: core: Add option to prevent eMMC sleep command
>
> Host may now use MMC_CAP2_NOSLEEP to disable the use of
> eMMC sleep/awake command.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
> Reviewed-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
> ---
> drivers/mmc/core/core.c | 6 ++++++
> include/linux/mmc/host.h | 1 +
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index a2aa860..5a1ce37 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2246,6 +2246,9 @@ int mmc_card_awake(struct mmc_host *host)
> {
> int err = -ENOSYS;
>
> + if (host->caps2 & MMC_CAP2_NOSLEEP)
> + return 0;
> +
> mmc_bus_get(host);
>
> if (host->bus_ops && !host->bus_dead && host->bus_ops->awake)
> @@ -2261,6 +2264,9 @@ int mmc_card_sleep(struct mmc_host *host)
> {
> int err = -ENOSYS;
>
> + if (host->caps2 & MMC_CAP2_NOSLEEP)
> + return 0;
> +
> mmc_bus_get(host);
>
> if (host->bus_ops && !host->bus_dead && host->bus_ops->sleep)
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 9a03d03..d07fb27 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -242,6 +242,7 @@ struct mmc_host {
> #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
> #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff
> supported */
> #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads
> don't work */
> +#define MMC_CAP2_NOSLEEP (1 << 4) /* Don't allow sleep command
> */
>
> mmc_pm_flag_t pm_caps; /* supported pm features */
> unsigned int power_notify_type;
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: core: Add option to prevent eMMC sleep command
2011-12-14 15:25 ` Subhash Jadavani
@ 2011-12-14 15:34 ` Ulf Hansson
2011-12-14 15:38 ` Subhash Jadavani
0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2011-12-14 15:34 UTC (permalink / raw)
To: Subhash Jadavani
Cc: linux-mmc@vger.kernel.org, 'Chris Ball', Per FORLIN,
Johan RUDHOLM, 'Lee Jones'
Subhash Jadavani wrote:
> Why is this patch needed? Do you see any issue with eMMC sleep on particular
> cards?
>
> Regards,
> Subhash
Suppose the eMMC is put in sleep state when doing suspend, at that point
the kernel crashes. The kernel crash is supposed to be dumped to the
same eMMC by some other software than the kernel itself. But this
software do not have support for waking up the eMMC from sleep and is
thus not able to store the dump.
Br
Ulf Hansson
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] mmc: core: Add option to prevent eMMC sleep command
2011-12-14 15:34 ` Ulf Hansson
@ 2011-12-14 15:38 ` Subhash Jadavani
2011-12-14 16:48 ` Ulf Hansson
0 siblings, 1 reply; 5+ messages in thread
From: Subhash Jadavani @ 2011-12-14 15:38 UTC (permalink / raw)
To: 'Ulf Hansson'
Cc: linux-mmc, 'Chris Ball', 'Per FORLIN',
'Johan RUDHOLM', 'Lee Jones'
> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@stericsson.com]
> Sent: Wednesday, December 14, 2011 9:04 PM
> To: Subhash Jadavani
> Cc: linux-mmc@vger.kernel.org; 'Chris Ball'; Per FORLIN; Johan RUDHOLM;
> 'Lee Jones'
> Subject: Re: [PATCH] mmc: core: Add option to prevent eMMC sleep
> command
>
> Subhash Jadavani wrote:
> > Why is this patch needed? Do you see any issue with eMMC sleep on
> particular
> > cards?
> >
> > Regards,
> > Subhash
>
> Suppose the eMMC is put in sleep state when doing suspend, at that
> point
> the kernel crashes. The kernel crash is supposed to be dumped to the
> same eMMC by some other software than the kernel itself. But this
> software do not have support for waking up the eMMC from sleep and is
> thus not able to store the dump.
Ok. This means that SW still has some support to read/write eMMC. As part of
suspend, we also deselect the card. So does that SW is capable of
re-selecting the card and the do read/write transfer? I know this discussion
might not be required. But still it's good to know.
As far as patch is concerned, it looks good. You might want to mention the
motivation for this patch in commit text.
>
> Br
> Ulf Hansson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: core: Add option to prevent eMMC sleep command
2011-12-14 15:38 ` Subhash Jadavani
@ 2011-12-14 16:48 ` Ulf Hansson
0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2011-12-14 16:48 UTC (permalink / raw)
To: Subhash Jadavani
Cc: linux-mmc@vger.kernel.org, 'Chris Ball', Per FORLIN,
Johan RUDHOLM, 'Lee Jones'
Subhash Jadavani wrote:
>
>> -----Original Message-----
>> From: Ulf Hansson [mailto:ulf.hansson@stericsson.com]
>> Sent: Wednesday, December 14, 2011 9:04 PM
>> To: Subhash Jadavani
>> Cc: linux-mmc@vger.kernel.org; 'Chris Ball'; Per FORLIN; Johan RUDHOLM;
>> 'Lee Jones'
>> Subject: Re: [PATCH] mmc: core: Add option to prevent eMMC sleep
>> command
>>
>> Subhash Jadavani wrote:
>>> Why is this patch needed? Do you see any issue with eMMC sleep on
>> particular
>>> cards?
>>>
>>> Regards,
>>> Subhash
>> Suppose the eMMC is put in sleep state when doing suspend, at that
>> point
>> the kernel crashes. The kernel crash is supposed to be dumped to the
>> same eMMC by some other software than the kernel itself. But this
>> software do not have support for waking up the eMMC from sleep and is
>> thus not able to store the dump.
>
> Ok. This means that SW still has some support to read/write eMMC. As part of
> suspend, we also deselect the card. So does that SW is capable of
> re-selecting the card and the do read/write transfer? I know this discussion
> might not be required. But still it's good to know.
Sorry, but I can't go into too much details, since this software is
proprietary. :-)
>
> As far as patch is concerned, it looks good. You might want to mention the
> motivation for this patch in commit text.
I fix in a V2 patch.
>
>> Br
>> Ulf Hansson
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-14 16:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 15:20 [PATCH] mmc: core: Add option to prevent eMMC sleep command Ulf Hansson
2011-12-14 15:25 ` Subhash Jadavani
2011-12-14 15:34 ` Ulf Hansson
2011-12-14 15:38 ` Subhash Jadavani
2011-12-14 16:48 ` Ulf Hansson
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).