lkml.org 
[lkml]   [2012]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] printk: replacing the raw_spin_lock/unlock with raw_spin_lock_irqsave/irqrestore
On Tue, Jul 3, 2012 at 12:01 AM, Liu, Chuansheng
<chuansheng.liu@intel.com> wrote:
> Thanks your pointing out. New patch as below:
>
> From: liu chuansheng <chuansheng.liu@intel.com>
> Subject: [PATCH] printk: replacing the raw_spin_lock/unlock with raw_spin_lock/unlock_irq
>
> In function devkmsg_read/writev/llseek/poll/open()..., the function
> raw_spin_lock/unlock is used, there is potential deadlock case happening.
> CPU1: thread1 doing the cat /dev/kmsg:
> raw_spin_lock(&logbuf_lock);
> while (user->seq == log_next_seq) {
> when thread1 run here, at this time one interrupt is coming on CPU1 and running
> based on this thread,if the interrupt handle called the printk which need the
> logbuf_lock spin also, it will cause deadlock.
>
> So we should use raw_spin_lock/unlock_irq here.
>
> Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>

Acked-By: Kay Sievers <kay@vrfy.org>

Kay


\
 
 \ /
  Last update: 2012-07-03 20:41    [W:0.211 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site