[RFC,PATCH 1/2] Add a common struct clk

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Jun 14 05:22:58 EDT 2010


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.





More information about the linux-arm-kernel mailing list