Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654538

Re: [PATCH] enic: Fix a sleep-in-atomic bug

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] enic: Fix a sleep-in-atomic bug
Date 2017-05-31 20:40 +0200
Message-ID <tNgHf-8pT-11@gated-at.bofh.it> (permalink)
References <tN1Id-79y-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Wed, 31 May 2017 10:34:49 +0800

> The driver may sleep under a spin lock in some function call paths.
> The 1st function call path is:
> enic_reset (acquire the lock by spin_lock)
>   enic_stop
>     enic_synchronize_irqs
>       synchronize_irq --> may sleep
> The 2nd function call path is:
> enic_reset (acquire the lock by spin_lock)
>   enic_dev_soft_reset
>     enic_dev_wait
>       schedule_timeout_uninterruptible --> may sleep
> The 3rd function call path is:
> enic_reset (acquire the lock by spin_lock)
>   enic_open
>     enic_request_intr
>       enic_set_rx_cpu_rmap
>         enic_free_rx_cpu_rmap
>           free_irq_cpu_rmap --> may sleep
> 
> To fix it, the "spin_lock" and "spin_unlock" are removed in enic_reset.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

That's not necessarily safe at all, the lock is probably needed for
synchronization.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] enic: Fix a sleep-in-atomic bug Jia-Ju Bai <baijiaju1990@163.com> - 2017-05-31 04:40 +0200
  Re: [PATCH] enic: Fix a sleep-in-atomic bug David Miller <davem@davemloft.net> - 2017-05-31 20:40 +0200

csiph-web