Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver
From: Ohad Ben-Cohen
Date: Tue Oct 19 2010 - 16:21:37 EST
On Tue, Oct 19, 2010 at 6:58 PM, Kevin Hilman
<khilman@xxxxxxxxxxxxxxxxxxx> wrote:
>> + * This spin_trylock_irqsave serves two purposes:
>> +
>> + * 1. Disable local interrupts and preemption, in order to
>> + * minimize the period of time in which the hwspinlock
>> + * is taken (so caller will not preempted). This is
>> + * important in order to minimize the possible polling on
>> + * the hardware interconnect by a remote user of this lock.
>> + *
>> + * 2. Make this hwspinlock primitive SMP-safe (so we can try to
>> + * take it from additional contexts on the local cpu)
>> + */
>
> 3. Ensures that in_atomic/might_sleep checks catch potential problems
> with hwspinlock usage (e.g. scheduler checks like 'scheduling while
> atomic' etc.)
Nice one. Added.
>> +/**
>> + * omap_hwspinlock_unlock() - unlock a specific hwspinlock
>
> minor nit: s/lock_unlock/_unlock/ to match name below
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/