All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: "Langsdorf, Mark" <mark.langsdorf@amd.com>
Cc: Eric Sesterhenn <eric.sesterhenn@lsexperts.de>,
	linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
	rusty@rustcorp.com.au
Subject: Re: Warning during suspend with MS-7310 mainboard
Date: Thu, 30 Jul 2009 12:46:29 -0400	[thread overview]
Message-ID: <20090730164629.GC2593@redhat.com> (raw)
In-Reply-To: <6453C3CB8E2B3646B0D020C11261327303620A01@sausexmb4.amd.com>

On Thu, Jul 30, 2009 at 11:38:22AM -0500, Langsdorf, Mark wrote:
 > I'll look into it.
 > 
 > First time I've had this bug reported, though.
 > 

It's happening because the suspend code runs with interrupts disabled,
and the powerpc workaround we do in the cpufreq suspend hook
calls the drivers ->get method.

powernow-k8's ->get does an smp_call_function_single
which needs interrupts enabled

If we just make the suspend code conditional on ppc, this whole problem
goes away.

Something like the patch below..

	Dave

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 5cc77fb..8d3b3d1 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1288,6 +1288,14 @@ static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg)
 
 	dprintk("suspending cpu %u\n", cpu);
 
+	/*
+	 * This whole bogosity is here because Powerbooks are made of fail.
+	 * No sane platform should need any of the code below to be run.
+	 * (it's entirely the wrong thing to do, as driver->get may
+	 *  reenable interrupts on some architectures).
+	 */
+
+#ifdef __powerpc__
 	if (!cpu_online(cpu))
 		return 0;
 
@@ -1346,6 +1354,7 @@ static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg)
 
 out:
 	cpufreq_cpu_put(cpu_policy);
+#endif	/* __powerpc__ */
 	return ret;
 }
 
@@ -1365,6 +1374,11 @@ static int cpufreq_resume(struct sys_device *sysdev)
 
 	dprintk("resuming cpu %u\n", cpu);
 
+	/* As with the ->suspend method, all the code below is
+	 * only necessary because Powerbooks suck.
+	 * See commit 42d4dc3f4e1e for jokes. */
+#ifdef __powerpc__
+
 	if (!cpu_online(cpu))
 		return 0;
 
@@ -1428,6 +1442,7 @@ out:
 	schedule_work(&cpu_policy->update);
 fail:
 	cpufreq_cpu_put(cpu_policy);
+#endif	/* __powerpc__ */
 	return ret;
 }
 

  reply	other threads:[~2009-07-30 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  6:50 Warning during suspend with MS-7310 mainboard Eric Sesterhenn
2009-07-30 10:27 ` Eric Sesterhenn
2009-07-30 15:47   ` Dave Jones
2009-07-30 16:38     ` Langsdorf, Mark
2009-07-30 16:46       ` Dave Jones [this message]
2009-07-30 17:11         ` Langsdorf, Mark
2009-07-30 23:07         ` Rusty Russell
2009-07-30 23:17           ` Dave Jones
2009-08-03  6:34             ` Rusty Russell

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=20090730164629.GC2593@redhat.com \
    --to=davej@redhat.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=eric.sesterhenn@lsexperts.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@amd.com \
    --cc=rusty@rustcorp.com.au \
    /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.