]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
USB-BKL: Convert usb_driver ioctl to unlocked_ioctl
authorAndi Kleen <ak@linux.intel.com>
Tue, 1 Jun 2010 21:04:41 +0000 (23:04 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 21:35:35 +0000 (14:35 -0700)
And audit all the users. None needed the BKL.  That was easy
because there was only very few around.

Tested with allmodconfig build on x86-64

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
From: Andi Kleen <ak@linux.intel.com>

drivers/usb/core/devio.c
drivers/usb/core/hub.c
drivers/usb/misc/usbtest.c
include/linux/usb.h

index c2f62a3993d2bc3a109bc583fc8489f9b2027fb5..f1aaff6202a58bb386a2947d0df2047322c8c43f 100644 (file)
@@ -1668,13 +1668,10 @@ static int proc_ioctl(struct dev_state *ps, struct usbdevfs_ioctl *ctl)
        default:
                if (intf->dev.driver)
                        driver = to_usb_driver(intf->dev.driver);
-               if (driver == NULL || driver->ioctl == NULL) {
+               if (driver == NULL || driver->unlocked_ioctl == NULL) {
                        retval = -ENOTTY;
                } else {
-                       /* keep API that guarantees BKL */
-                       lock_kernel();
-                       retval = driver->ioctl(intf, ctl->ioctl_code, buf);
-                       unlock_kernel();
+                       retval = driver->unlocked_ioctl(intf, ctl->ioctl_code, buf);
                        if (retval == -ENOIOCTLCMD)
                                retval = -ENOTTY;
                }
index 9cd77a2af821f05902e80c72f1dd988002e251c0..d337ef80bf4341bc16807d725f27ee9e50b4df53 100644 (file)
@@ -1294,6 +1294,7 @@ descriptor_error:
        return -ENODEV;
 }
 
+/* No BKL needed */
 static int
 hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
 {
@@ -3465,7 +3466,7 @@ static struct usb_driver hub_driver = {
        .reset_resume = hub_reset_resume,
        .pre_reset =    hub_pre_reset,
        .post_reset =   hub_post_reset,
-       .ioctl =        hub_ioctl,
+       .unlocked_ioctl = hub_ioctl,
        .id_table =     hub_id_table,
        .supports_autosuspend = 1,
 };
index 16dffe99d9f1c754c006c42d02a9ac33abb363ff..0cfbd789ddf27a1aea685ad4a1264c76c3cbae4c 100644 (file)
@@ -1548,6 +1548,7 @@ fail:
  * off just killing the userspace task and waiting for it to exit.
  */
 
+/* No BKL needed */
 static int
 usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
 {
@@ -2170,7 +2171,7 @@ static struct usb_driver usbtest_driver = {
        .name =         "usbtest",
        .id_table =     id_table,
        .probe =        usbtest_probe,
-       .ioctl =        usbtest_ioctl,
+       .unlocked_ioctl = usbtest_ioctl,
        .disconnect =   usbtest_disconnect,
        .suspend =      usbtest_suspend,
        .resume =       usbtest_resume,
index d5922a8779945cf43654dd0bbb287e5468e6921b..e6cbc34901f47469f5afba66130eaf2d8d4f8409 100644 (file)
@@ -843,7 +843,7 @@ struct usb_driver {
 
        void (*disconnect) (struct usb_interface *intf);
 
-       int (*ioctl) (struct usb_interface *intf, unsigned int code,
+       int (*unlocked_ioctl) (struct usb_interface *intf, unsigned int code,
                        void *buf);
 
        int (*suspend) (struct usb_interface *intf, pm_message_t message);