linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: mach-shmobile: fix Oops during system wake up
Date: Mon, 18 Apr 2011 09:13:37 +0000	[thread overview]
Message-ID: <BANLkTinv6hMsi6BaeUWsrV49Hqq93ogogg@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1104152009080.18593@axis700.grange>

On Mon, Apr 18, 2011 at 6:09 PM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Fri, Apr 15, 2011 at 08:37:55PM +0200, Guennadi Liakhovetski wrote:
>> On Fri, 15 Apr 2011, Guennadi Liakhovetski wrote:
>>
>> > During system resume the clock subsystem is restoring all clock rates,
>> > if sound has not been used before suspend, the rate remains 0 and
>> > the wake up Oopses with division by zero.
>>
>> Right, I see now. Magnus had a more general solution for this problem,
>> which I accidentally dropped in my tests, which caused this Oops. So,
>> maybe his patch to check rate in clks_core_resume() is a better fix for
>> this problem. Feel free to ignore this then.
>>
> Having a solution that doesn't exist in the list archives is effectively
> the same as not having a solution at all.

Sure. I suppose Guennadi is referring to a hunk in a local patch that
doesn't exist in list archives.

> From your description I imagine you mean something like checking if
> clkp->rate is set prior to calling in to ->set_rate, however this
> probably needs a bit more of a think. Your example stipulates that we're
> resuming clocks that haven't been "used", which suggests that we're
> probably better off simply not touching the clock at all in the resume
> path. I expect if you were to set the rate via the recalc path instead it
> also wouldn't have the desired effect for your case.
>
> In any event, it's quite obvious that clks_core_resume() is going to need
> to be reworked a bit.

I ran across this, not sure if it's the right way to fix this.

--- 0001/drivers/sh/clk/core.c
+++ work/drivers/sh/clk/core.c  2011-04-18 08:46:43.000000000 +0900
@@ -641,7 +641,7 @@ static void clks_core_resume(void)
                        if (likely(clkp->ops->set_parent))
                                clkp->ops->set_parent(clkp,
                                        clkp->parent);
-                       if (likely(clkp->ops->set_rate))
+                       if (rate && likely(clkp->ops->set_rate))
                                clkp->ops->set_rate(clkp, rate);
                        else if (likely(clkp->ops->recalc))
                                clkp->rate = clkp->ops->recalc(clkp);

This does not trigger on mainline SH-Mobile ARM since we don't support
system wide suspend.

/ magnus

      parent reply	other threads:[~2011-04-18  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 18:10 [PATCH] ARM: mach-shmobile: fix Oops during system wake up Guennadi Liakhovetski
2011-04-15 18:37 ` Guennadi Liakhovetski
2011-04-16 10:38 ` Simon Horman
2011-04-18  9:09 ` Paul Mundt
2011-04-18  9:13 ` Magnus Damm [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=BANLkTinv6hMsi6BaeUWsrV49Hqq93ogogg@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.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).