[lkml]   [2018]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2] usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()

On 2018/9/11 15:49, Sebastian Andrzej Siewior wrote:
> On 2018-09-01 16:12:10 [+0800], Jia-Ju Bai wrote:
>> wdm_in_callback() is a completion handler function for the USB driver.
>> So it should not sleep. But it calls service_outstanding_interrupt(),
>> which calls usb_submit_urb() with GFP_KERNEL.
> At which point does wdm_in_callback() invoke
> service_outstanding_interrupt()? I don't see it. I see one invocation
> from wdm_read() and another from service_interrupt_work().
> Also, if that would be the case, then spin_unlock_irq() in an USB
> completion handler (which might run in IRQ context with interrupts
> disabled) would be wrong.

Yes, you are right.
I checked an old kernel version Linux-4.16 and got this report.
The current code looks much different from the code that I checked.
Sorry for my false report, and thanks for your correction.

Best wishes,
Jia-Ju Bai

 \ /
  Last update: 2018-09-11 10:26    [W:0.038 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site