Re: [PATCH] drivers: usb: host: Fix GFP_KERNEL in spinlock context
From: Shrikant Maurya
Date: Fri Dec 22 2017 - 02:51:08 EST
On Friday 22 December 2017 12:43 PM, Greg KH wrote:
> On Fri, Dec 22, 2017 at 11:19:24AM +0530, shrikant.maurya@xxxxxxxxxxxx wrote:
>> From: Shrikant Maurya <shrikant.maurya@xxxxxxxxxxxx>
>>
>> As reported by Jia-Ju Bai (https://lkml.org/lkml/2017/12/11/872):
>> API's are using GFP_KERNEL to allocate memory, which may sleep.
>> To ensure atomicity such allocations must be avoided in critical
>> sections under spinlock.
>> Fixed by moving part of the code which is using GFP_KERNEL for
>> memory allocation out of spinlock.
>>
>> Reported-by: Jia-Ju Bai <baijiaju1990@xxxxxxxxx>
>> Signed-off-by: Shrikant Maurya <shrikant.maurya@xxxxxxxxxxxx>
>> Signed-off-by: Suniel Mahesh <sunil.m@xxxxxxxxxxxx>
>> Signed-off-by: Raghu Bharadwaj <raghu@xxxxxxxxxxxx>
>> Signed-off-by: Karthik Tummala <karthik@xxxxxxxxxxxx>
>> ---
>> Note:
>> - trace of device_init_wakeup() leads to creation of a struct
>> wakeup_source object and addition of the object to the list
>> of wakeup sources. While allocating wakeup_source object, API
>> is using GFP_KERNEL. This particular section is removed out of
>> spinlock.
>> - Changeset was compile tested and built(ARCH=arm) on linux-next
>> (latest).
>> - No build issues reported.
>> - Changeset was not tested on hardware.
> No one was able to test on the hardware itself? Ideally I'd like to see
> that happen to verify nothing breaks here. No one has this chip on any
> devices?
>
> thanks,
Sorry Greg, we dont have the chip / hardware, and we are aware that it should
be hardware tested. we were looking at the software aspect.
thanks,
shrikanth
> greg k-h