Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ohad Ben-Cohen
Date: Wednesday, October 20, 2010 - 3:43 pm

On Tue, Oct 19, 2010 at 11:08 PM, Arnd Bergmann <arnd@arndb.de> wrote:

To do this we need to introduce a new set of API which will not
disable interrupts, and which should only be used when the caller
knows that interrupts are already disabled.

This will save some cycles, but my concern is that this API will be
abused by drivers, and will eventually be used to take the hwspinlocks
for lengthy period of times (which might even involve sleeping).

Given that the access to the L4 interconnect is anyway slow I also
feel that the gain is negligible.

Nevertheless, it's a viable way to squeeze some cycles.

We don't have a use case in which we know the interrupts are already
disabled, but when we will, we will consider adding such API.


This sounds like adding a set of API that resembles spin_{unlock,lock}_irq.

My gut feeling here is that while this may be useful and simple at
certain places, it is somewhat error prone; a driver which would
erroneously use this at the wrong place will end up enabling
interrupts where it really shouldn't.

Don't you feel that proving a simple spin_lock_irqsave-like API is
actually safer and less error prone ?

I guess that is one of the reasons why spin_lock_irqsave is much more
popular than spin_lock_irq - people just know it will never screw up.

Thanks,
Ohad.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Mon Oct 18, 12:44 am)
[PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Mon Oct 18, 12:44 am)
[PATCH 2/3] OMAP4: hwmod data: Add hwspinlock, Ohad Ben-Cohen, (Mon Oct 18, 12:44 am)
[PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Mon Oct 18, 12:44 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 5:46 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Russell King - ARM Linux, (Mon Oct 18, 6:35 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 6:43 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Mon Oct 18, 7:28 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 7:33 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Mon Oct 18, 7:39 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Catalin Marinas, (Mon Oct 18, 8:27 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 8:32 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Mon Oct 18, 8:35 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 8:48 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Catalin Marinas, (Mon Oct 18, 8:51 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Peter Zijlstra, (Mon Oct 18, 8:58 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Grant Likely, (Tue Oct 19, 10:01 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Kevin Hilman, (Tue Oct 19, 10:03 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Grant Likely, (Tue Oct 19, 10:05 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Kevin Hilman, (Tue Oct 19, 10:16 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Arnd Bergmann, (Tue Oct 19, 10:21 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Tue Oct 19, 1:18 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Tue Oct 19, 1:21 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Tue Oct 19, 1:43 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Tue Oct 19, 1:51 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Arnd Bergmann, (Tue Oct 19, 1:58 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Tue Oct 19, 2:02 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Arnd Bergmann, (Tue Oct 19, 2:08 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Tue Oct 19, 2:57 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Grant Likely, (Tue Oct 19, 4:12 pm)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Daniel Walker, (Tue Oct 19, 4:31 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Kevin Hilman, (Tue Oct 19, 4:53 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Ryan Mallon, (Tue Oct 19, 6:20 pm)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Tue Oct 19, 11:13 pm)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Russell King - ARM Linux, (Wed Oct 20, 2:53 am)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Ohad Ben-Cohen, (Wed Oct 20, 3:00 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Wed Oct 20, 6:00 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Wed Oct 20, 7:09 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Wed Oct 20, 7:38 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Grant Likely, (Wed Oct 20, 8:51 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Grant Likely, (Wed Oct 20, 8:55 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Kevin Hilman, (Wed Oct 20, 11:18 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Kevin Hilman, (Wed Oct 20, 11:37 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Wed Oct 20, 12:21 pm)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Daniel Walker, (Wed Oct 20, 3:15 pm)
Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver, Bryan Huntsman, (Wed Oct 20, 3:29 pm)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Wed Oct 20, 3:43 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Kevin Hilman, (Wed Oct 20, 4:58 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Wed Oct 20, 11:11 pm)
RE: [PATCH 3/3] omap: add hwspinlock device, Kamoolkar, Mugdha, (Thu Oct 21, 1:36 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Arnd Bergmann, (Thu Oct 21, 2:04 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Thu Oct 21, 2:06 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Ohad Ben-Cohen, (Thu Oct 21, 3:13 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Arnd Bergmann, (Thu Oct 21, 5:02 am)
RE: [PATCH 3/3] omap: add hwspinlock device, Kanigeri, Hari, (Thu Oct 21, 5:26 am)
RE: [PATCH 3/3] omap: add hwspinlock device, Kamoolkar, Mugdha, (Fri Oct 22, 2:59 am)
RE: [PATCH 3/3] omap: add hwspinlock device, Kamoolkar, Mugdha, (Fri Oct 22, 3:14 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Fri Oct 22, 4:16 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Tony Lindgren, (Fri Oct 22, 9:56 am)
Re: [PATCH 1/3] drivers: misc: add omap_hwspinlock driver, Tony Lindgren, (Fri Oct 22, 10:00 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Grant Likely, (Fri Oct 22, 10:03 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Tony Lindgren, (Fri Oct 22, 10:28 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Sun Oct 24, 10:54 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Tony Lindgren, (Mon Oct 25, 12:02 pm)
Re: [PATCH 3/3] omap: add hwspinlock device, Ohad Ben-Cohen, (Tue Oct 26, 4:54 am)
Re: [PATCH 3/3] omap: add hwspinlock device, Tony Lindgren, (Tue Oct 26, 12:06 pm)