linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/8] imx: BUG in clk_disable if the clock isn't enabled
Date: Tue, 2 Feb 2010 09:04:12 +0100	[thread overview]
Message-ID: <20100202080412.GA3048@pengutronix.de> (raw)
In-Reply-To: <20100202075401.GA13952@jasper.tkos.co.il>

Hi Baruch,

On Tue, Feb 02, 2010 at 09:54:02AM +0200, Baruch Siach wrote:
> On Mon, Feb 01, 2010 at 05:01:30PM +0100, Uwe Kleine-K?nig wrote:
> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> > Cc: Sascha Hauer <kernel@pengutronix.de>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > ---
> >  arch/arm/plat-mxc/clock.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
> > index 9e8fbd5..de99681 100644
> > --- a/arch/arm/plat-mxc/clock.c
> > +++ b/arch/arm/plat-mxc/clock.c
> > @@ -56,6 +56,7 @@ static void __clk_disable(struct clk *clk)
> >  	__clk_disable(clk->parent);
> >  	__clk_disable(clk->secondary);
> >  
> > +	BUG_ON(!clk->usecount);
> >  	if (!(--clk->usecount) && clk->disable)
> >  		clk->disable(clk);
> 
> Is this necessary? Shouldn't WARN_ON be used instead?
> 
> Citing include/asm-generic/bug.h: "Don't use BUG() or BUG_ON() unless there's 
> really no way out..."
I don't care much.  AFAIK nothing grave happens if a disabled clock is
disabled again provided the disable has a balancing enable.  So the only
reason to use BUG_ON is that it hurts more :-)

I will change it,
thanks Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

  reply	other threads:[~2010-02-02  8:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 15:56 my imx changes for 2.6.34 Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 1/8] mx1: prefix SOC specific defines with MX1_ and deprecate old names Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 2/8] mx25: deprecate UART1_BASE_ADDR and UART2_BASE_ADDR Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 3/8] imx: BUG in clk_disable if the clock isn't enabled Uwe Kleine-König
2010-02-02  7:54   ` Baruch Siach
2010-02-02  8:04     ` Uwe Kleine-König [this message]
2010-02-01 16:01 ` [PATCH 4/8] mxc91231: use MXC91231_IO_ADDRESS instead of MXC91231_AIPS1_IO_ADDRESS Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 5/8] mxc91231: redefine MXC91231_IO_ADDRESS using IMX_IO_ADDRESS Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 6/8] imx2x: convert serial.c to use soc-prefixed constants Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 7/8] imx: define per SOC ..._PHYS_OFFSET and use these in favour of PHYS_OFFSET Uwe Kleine-König
2010-02-01 16:01 ` [PATCH 8/8] imx/mx25: rename files defining a machine to mach-$mach.c Uwe Kleine-König

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=20100202080412.GA3048@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).