[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1276507378.2552.39.camel@pasglop>
Date: Mon, 14 Jun 2010 19:22:58 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Lothar Waßmann <LW@...O-electronics.de>
Cc: Jeremy Kerr <jeremy.kerr@...onical.com>,
Ben Dooks <ben-linux@...ff.org>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Subject: Re: [RFC,PATCH 1/2] Add a common struct clk
On Mon, 2010-06-14 at 08:39 +0200, Lothar Waßmann wrote:
> All implementations so far use spin_lock_irq_save()!
Nothing prevents your implementation to be a tad smarter.
> How would you be able to sleep with a mutex held?
> If you hold a lock you must not sleep, no matter what sort of lock it
> is.
You can perfectly sleep with a mutex held. You -do- have to be careful
of course to ensure you aren't going to do silly thing like re-enter and
try to take it twice, or A->B B->A deadlocks, but in the typical case of
wanting to use a msleep rather than udelay, it works very well :-)
Cheers,
Ben.
--
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