[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100613222715.GF31045@fluff.org.uk>
Date: Sun, 13 Jun 2010 23:27:15 +0100
From: Ben Dooks <ben-linux@...ff.org>
To: Lothar Wa?mann <LW@...O-electronics.de>
Cc: Uwe Kleine-K?nig <u.kleine-koenig@...gutronix.de>,
Jeremy Kerr <jeremy.kerr@...onical.com>,
linux-arm-kernel@...ts.infradead.org,
Ben Herrenchmidt <benh@...nel.crashing.org>,
linux-kernel@...r.kernel.org, Ben Dooks <ben-linux@...ff.org>
Subject: Re: [RFC,PATCH 1/2] Add a common struct clk
On Fri, Jun 11, 2010 at 12:08:01PM +0200, Lothar Wa?mann wrote:
> Hi,
>
> > > > > Using a mutex in clk_enable()/clk_disable() is a bad idea, since that
> > > > > makes it impossible to call those functions in interrupt context.
> > IMHO if a device generates an irq its clock should already be on. This
> > way you don't need to enable or disable a clock in irq context.
> >
> You may want to disable a clock in the IRQ handler. The VPU driver in
> the Freescale BSP for i.MX51 does exactly this.
> Anyway I don't see any reason for using a mutex here instead of
> spin_lock_irq_save() as all other implementations do.
Hmm, then again the VPU driver may just be a bit wrong here.
We could protect each clock with a spinlock, but that would end up
with a problem of spinning where we have clocks that takes 100s of
usec or so to init. See all PLLs on S3C devices, where it can take
100-300uS to get a stable clock out of the device.
--
Ben (ben@...ff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists