diff options
author | Oliver Neukum <oneukum@suse.de> | 2014-03-28 06:10:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-16 17:04:59 -0400 |
commit | e7eda9329372f5e436e5a9291eb115eab0feae02 (patch) | |
tree | e882eb775c1d6c0a5751f35e7b347034a777b548 /drivers/usb/storage | |
parent | f7a87195603ae9db133ddd393169dd6c1d45b4a3 (diff) |
uas: fix GFP_NOIO under spinlock
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'
Some other allocations under spinlock are not caught.
The fix essentially reverts e36e64930cffd94e1c37fdb82f35989384aa946b
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/uas.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index a7ac97cc5949..8f4222640bd6 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -137,7 +137,7 @@ static void uas_do_work(struct work_struct *work) | |||
137 | if (!(cmdinfo->state & IS_IN_WORK_LIST)) | 137 | if (!(cmdinfo->state & IS_IN_WORK_LIST)) |
138 | continue; | 138 | continue; |
139 | 139 | ||
140 | err = uas_submit_urbs(cmnd, cmnd->device->hostdata, GFP_NOIO); | 140 | err = uas_submit_urbs(cmnd, cmnd->device->hostdata, GFP_ATOMIC); |
141 | if (!err) | 141 | if (!err) |
142 | cmdinfo->state &= ~IS_IN_WORK_LIST; | 142 | cmdinfo->state &= ~IS_IN_WORK_LIST; |
143 | else | 143 | else |
@@ -803,7 +803,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd, | |||
803 | 803 | ||
804 | devinfo->running_task = 1; | 804 | devinfo->running_task = 1; |
805 | memset(&devinfo->response, 0, sizeof(devinfo->response)); | 805 | memset(&devinfo->response, 0, sizeof(devinfo->response)); |
806 | sense_urb = uas_submit_sense_urb(cmnd, GFP_NOIO, | 806 | sense_urb = uas_submit_sense_urb(cmnd, GFP_ATOMIC, |
807 | devinfo->use_streams ? tag : 0); | 807 | devinfo->use_streams ? tag : 0); |
808 | if (!sense_urb) { | 808 | if (!sense_urb) { |
809 | shost_printk(KERN_INFO, shost, | 809 | shost_printk(KERN_INFO, shost, |
@@ -813,7 +813,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd, | |||
813 | spin_unlock_irqrestore(&devinfo->lock, flags); | 813 | spin_unlock_irqrestore(&devinfo->lock, flags); |
814 | return FAILED; | 814 | return FAILED; |
815 | } | 815 | } |
816 | if (uas_submit_task_urb(cmnd, GFP_NOIO, function, tag)) { | 816 | if (uas_submit_task_urb(cmnd, GFP_ATOMIC, function, tag)) { |
817 | shost_printk(KERN_INFO, shost, | 817 | shost_printk(KERN_INFO, shost, |
818 | "%s: %s: submit task mgmt urb failed\n", | 818 | "%s: %s: submit task mgmt urb failed\n", |
819 | __func__, fname); | 819 | __func__, fname); |