]> git.baikalelectronics.ru Git - kernel.git/commit
pps: make idr lock a mutex and protect idr_pre_get
authorAlexander Gordeev <lasaine@lvk.cs.msu.su>
Thu, 13 Jan 2011 01:00:53 +0000 (17:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 16:03:20 +0000 (08:03 -0800)
commit0e7d78cfa562e6b8ad4adad66323f407d0d0ade0
tree14082324f971c3d8af26840caf9d68a4524269b7
parent30c220910798a4cda2d6fda0acc72c2f2723d734
pps: make idr lock a mutex and protect idr_pre_get

Now pps_idr_lock is never used in interrupt context so we can replace
spin_lock_irq/spin_unlock_irq with plain spin_lock/spin_unlock. But
there is also a potential race condition when someone can steal an id
which was allocated by idr_pre_get before it is used. So convert spin
lock to mutex and protect the whole id generation process.

Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
Cc: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pps/pps.c