lkml.org 
[lkml]   [2016]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Change the spin_lock/unlock_irq interface in proc_alloc_inum() function
On Wed, Mar 02, 2016 at 10:47:59AM +0800, MaJun wrote:
> From: Ma Jun <majun258@huawei.com>
>
> The spin_lock/unlock_irq interface is not safe when this function is called
> at some case which need irq disabled.

> For example:
> spin_lock_irqsave()
> |
> request_irq() --> proc_alloc_inum()
> |
> spin_unlock_irqrestore()

Do you even read your own patch?

> if (!ida_pre_get(&proc_inum_ida, GFP_KERNEL))
^^^^^^^^^^
This.

It can block. You *can't* call that under spin_lock_irqsave(). At all.
You also can't do request_irq() under a spinlock, no matter whether you
disable irqs or not - it also blocks. So does proc_mkdir(), for that
matter, and not only in proc_alloc_inum().

NAKed. Don't do it. request_irq() is not to be called under spinlocks,
with or without irqs disabled.

\
 
 \ /
  Last update: 2016-03-02 04:41    [W:0.072 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site