* [PATCH] mmc: print debug messages for runtime PM actions
@ 2011-07-17 15:38 Daniel Drake
2011-07-19 2:31 ` Chris Ball
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Drake @ 2011-07-17 15:38 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, ohad
At
http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg08371.html
we found and fixed a bug where mmc's runtime power management functions
were not being called. We have now also made improvements to the SDIO
powerup routine which could possibly mask this kind of issue in future.
Add debug messages to the runtime PM hooks so that it is easy to verify
if and when runtime PM is happening.
Signed-off-by: Daniel Drake <dsd@laptop.org>
---
drivers/mmc/core/core.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
For linux-3.1.
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0a04886..ad0c55a 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1664,6 +1664,10 @@ int mmc_power_save_host(struct mmc_host *host)
{
int ret = 0;
+#ifdef CONFIG_MMC_DEBUG
+ pr_info("%s: %s: powering down\n", mmc_hostname(host), __func__);
+#endif
+
mmc_bus_get(host);
if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
@@ -1686,6 +1690,10 @@ int mmc_power_restore_host(struct mmc_host *host)
{
int ret;
+#ifdef CONFIG_MMC_DEBUG
+ pr_info("%s: %s: powering up\n", mmc_hostname(host), __func__);
+#endif
+
mmc_bus_get(host);
if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mmc: print debug messages for runtime PM actions
2011-07-17 15:38 [PATCH] mmc: print debug messages for runtime PM actions Daniel Drake
@ 2011-07-19 2:31 ` Chris Ball
2011-07-20 16:36 ` Daniel Drake
0 siblings, 1 reply; 4+ messages in thread
From: Chris Ball @ 2011-07-19 2:31 UTC (permalink / raw)
To: Daniel Drake; +Cc: linux-mmc
Hi Dan,
On Sun, Jul 17 2011, Daniel Drake wrote:
> At
> http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg08371.html
> we found and fixed a bug where mmc's runtime power management functions
> were not being called. We have now also made improvements to the SDIO
> powerup routine which could possibly mask this kind of issue in future.
>
> Add debug messages to the runtime PM hooks so that it is easy to verify
> if and when runtime PM is happening.
>
> Signed-off-by: Daniel Drake <dsd@laptop.org>
> ---
> drivers/mmc/core/core.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> For linux-3.1.
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 0a04886..ad0c55a 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1664,6 +1664,10 @@ int mmc_power_save_host(struct mmc_host *host)
> {
> int ret = 0;
>
> +#ifdef CONFIG_MMC_DEBUG
> + pr_info("%s: %s: powering down\n", mmc_hostname(host), __func__);
> +#endif
> +
Did you consider just:
pr_debug("%s: %s: powering down\n", mmc_hostname(host), __func__);
which gets you the same CONFIG_MMC_DEBUG semantics? (The messages will
be at the debug loglevel rather than info, but that sounds right to me.)
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mmc: print debug messages for runtime PM actions
2011-07-19 2:31 ` Chris Ball
@ 2011-07-20 16:36 ` Daniel Drake
2011-07-20 16:44 ` Chris Ball
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Drake @ 2011-07-20 16:36 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc
On 19 July 2011 03:31, Chris Ball <cjb@laptop.org> wrote:
> Did you consider just:
>
> pr_debug("%s: %s: powering down\n", mmc_hostname(host), __func__);
>
> which gets you the same CONFIG_MMC_DEBUG semantics? (The messages will
> be at the debug loglevel rather than info, but that sounds right to me.)
I did, and that would probably be fine (assuming that CONFIG_MMC_DEBUG
would actually turn it on? I can't see where that would happen), but I
was trying to make it a bit more prominent and appear the same as the
debug message from mmc_rescan_try_freq() which does it in this way.
Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mmc: print debug messages for runtime PM actions
2011-07-20 16:36 ` Daniel Drake
@ 2011-07-20 16:44 ` Chris Ball
0 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2011-07-20 16:44 UTC (permalink / raw)
To: Daniel Drake; +Cc: linux-mmc
Hi,
On Wed, Jul 20 2011, Daniel Drake wrote:
>> pr_debug("%s: %s: powering down\n", mmc_hostname(host), __func__);
>>
>> which gets you the same CONFIG_MMC_DEBUG semantics? (The messages will
>> be at the debug loglevel rather than info, but that sounds right to me.)
>
> I did, and that would probably be fine (assuming that CONFIG_MMC_DEBUG
> would actually turn it on? I can't see where that would happen)
It's in drivers/mmc/Makefile:
subdir-ccflags-$(CONFIG_MMC_DEBUG) := -DDEBUG
include/linux/printk.h:
#if defined(DEBUG)
#define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
> was trying to make it a bit more prominent and appear the same as the
> debug message from mmc_rescan_try_freq() which does it in this way.
Ah, okay, seems reasonable -- I'll merge the original patch for 3.1.
Thanks!
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-20 16:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17 15:38 [PATCH] mmc: print debug messages for runtime PM actions Daniel Drake
2011-07-19 2:31 ` Chris Ball
2011-07-20 16:36 ` Daniel Drake
2011-07-20 16:44 ` Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox