public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix
Date: Fri, 10 Jun 2011 02:23:31 +0000	[thread overview]
Message-ID: <20110610022325.GB643@verge.net.au> (raw)
In-Reply-To: <20110609064913.2219.62039.sendpatchset@t400s>

On Thu, Jun 09, 2011 at 03:49:13PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Update the sh7372 FSIDIV clock code to bail out
> with -EINVAL in case of rate is zero.
> 
> Without this fix divide-by-zero is triggering
> on sh7372 platforms during system wide resume
> of Suspend-to-RAM.

Hi Magnus,

I'm unsure that I understand how rate ends up being
zero in the situation you describe.

> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  arch/arm/mach-shmobile/clock-sh7372.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- 0001/arch/arm/mach-shmobile/clock-sh7372.c
> +++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-06-09 15:45:41.000000000 +0900
> @@ -460,6 +460,9 @@ static int fsidiv_set_rate(struct clk *c
>  {
>  	int idx;
>  
> +	if (!rate)
> +		return -EINVAL;
> +
>  	idx = (clk->parent->rate / rate) & 0xffff;
>  	if (idx < 2)
>  		return -EINVAL;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2011-06-10  2:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  6:49 [PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix Magnus Damm
2011-06-10  2:23 ` Simon Horman [this message]
2011-06-10  4:54 ` Magnus Damm
2011-06-10  6:01 ` Simon Horman

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=20110610022325.GB643@verge.net.au \
    --to=horms@verge.net.au \
    --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