Re: [PATCH] uas: fix GFP_NOIO under spinlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 03/28/2014 09:45 AM, oliver@xxxxxxxxxx wrote:
> From: Oliver Neukum <oneukum@xxxxxxx>
> 
> Quote Dan:
> 
> The patch e36e64930cff: "uas: Use GFP_NOIO rather then GFP_ATOMIC
> where possible" from Nov 7, 2013, leads to the following static
> checker warning:
> 
>         drivers/usb/storage/uas.c:806 uas_eh_task_mgmt()
>         error: scheduling with locks held: 'spin_lock:lock'
> The fix is obvious.
> 
> Signed-off-by: Oliver Neukum <oliver@xxxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Dan, thanks for catching this, Oliver thanks for fixing this.

Looks good to me, Greg can you please add this to usb-next?
It fixes a regression my uas set has introduced there.

Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>

Regards,

Hans


> ---
>  drivers/usb/storage/uas.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
> index a7ac97c..befa0c0 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -803,7 +803,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd,
>  
>  	devinfo->running_task = 1;
>  	memset(&devinfo->response, 0, sizeof(devinfo->response));
> -	sense_urb = uas_submit_sense_urb(cmnd, GFP_NOIO,
> +	sense_urb = uas_submit_sense_urb(cmnd, GFP_ATOMIC,
>  					 devinfo->use_streams ? tag : 0);
>  	if (!sense_urb) {
>  		shost_printk(KERN_INFO, shost,
> @@ -813,7 +813,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd,
>  		spin_unlock_irqrestore(&devinfo->lock, flags);
>  		return FAILED;
>  	}
> -	if (uas_submit_task_urb(cmnd, GFP_NOIO, function, tag)) {
> +	if (uas_submit_task_urb(cmnd, GFP_ATOMIC, function, tag)) {
>  		shost_printk(KERN_INFO, shost,
>  			     "%s: %s: submit task mgmt urb failed\n",
>  			     __func__, fname);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux