am 4e226a50: am ba9025ce: am 253e27ac: Optimize set_sched_policy(), which gets called in every binder call.
diff --git a/fastboot/engine.c b/fastboot/engine.c
index 6d62c6e..f29cc03 100644
--- a/fastboot/engine.c
+++ b/fastboot/engine.c
@@ -271,11 +271,11 @@
     a->data = (void*) notice;
 }
 
-void fb_execute_queue(usb_handle *usb)
+int fb_execute_queue(usb_handle *usb)
 {
     Action *a;
     char resp[FB_RESPONSE_SZ+1];
-    int status;
+    int status = 0;
 
     a = action_list;
     resp[FB_RESPONSE_SZ] = 0;
@@ -307,5 +307,5 @@
     }
 
     fprintf(stderr,"finished. total time: %.3fs\n", (now() - start));
+    return status;
 }
-
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index bed30b2..5389351 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -550,11 +550,12 @@
     void *data;
     unsigned sz;
     unsigned page_size = 2048;
+    int status;
 
     skip(1);
     if (argc == 0) {
         usage();
-        return 0;
+        return 1;
     }
 
     if (!strcmp(*argv, "devices")) {
@@ -686,6 +687,7 @@
             argc = do_oem_command(argc, argv);
         } else {
             usage();
+	    return 1;
         }
     }
 
@@ -701,6 +703,6 @@
 
     usb = open_device();
 
-    fb_execute_queue(usb);
-    return 0;
+    status = fb_execute_queue(usb);
+    return (status) ? 1 : 0;
 }
diff --git a/fastboot/fastboot.h b/fastboot/fastboot.h
index a36c569..a4b27a0 100644
--- a/fastboot/fastboot.h
+++ b/fastboot/fastboot.h
@@ -49,7 +49,7 @@
 void fb_queue_command(const char *cmd, const char *msg);
 void fb_queue_download(const char *name, void *data, unsigned size);
 void fb_queue_notice(const char *notice);
-void fb_execute_queue(usb_handle *usb);
+int fb_execute_queue(usb_handle *usb);
 
 /* util stuff */
 void die(const char *fmt, ...);
diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h
index 474cfac..1dbe171 100644
--- a/include/private/android_filesystem_config.h
+++ b/include/private/android_filesystem_config.h
@@ -51,6 +51,7 @@
 #define AID_SDCARD_RW     1015  /* external storage write access */
 #define AID_VPN           1016  /* vpn system */
 #define AID_KEYSTORE      1017  /* keystore subsystem */
+#define AID_USB           1018  /* USB devices */
 
 #define AID_SHELL         2000  /* adb and debug shell user */
 #define AID_CACHE         2001  /* cache access */
@@ -100,6 +101,7 @@
     { "sdcard_rw", AID_SDCARD_RW, },
     { "vpn",       AID_VPN, },
     { "keystore",  AID_KEYSTORE, },
+    { "usb",       AID_USB, },
     { "inet",      AID_INET, },
     { "net_raw",   AID_NET_RAW, },
     { "net_admin", AID_NET_ADMIN, },
diff --git a/init/devices.c b/init/devices.c
index fa96f7c..663cdfe 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -327,6 +327,7 @@
 static void handle_device_event(struct uevent *uevent)
 {
     char devpath[96];
+    int devpath_ready = 0;
     char *base, *name;
     char **links = NULL;
     int block;
@@ -356,7 +357,26 @@
     } else {
         block = 0;
             /* this should probably be configurable somehow */
-        if(!strncmp(uevent->subsystem, "graphics", 8)) {
+        if (!strncmp(uevent->subsystem, "usb", 3)) {
+            if (!strcmp(uevent->subsystem, "usb")) {
+                /* This imitates the file system that would be created
+                 * if we were using devfs instead.
+                 * Minors are broken up into groups of 128, starting at "001"
+                 */
+                int bus_id = uevent->minor / 128 + 1;
+                int device_id = uevent->minor % 128 + 1;
+                /* build directories */
+                mkdir("/dev/bus", 0755);
+                mkdir("/dev/bus/usb", 0755);
+                snprintf(devpath, sizeof(devpath), "/dev/bus/usb/%03d", bus_id);
+                mkdir(devpath, 0755);
+                snprintf(devpath, sizeof(devpath), "/dev/bus/usb/%03d/%03d", bus_id, device_id);
+                devpath_ready = 1;
+            } else {
+                /* ignore other USB events */
+                return;
+            }
+        } else if (!strncmp(uevent->subsystem, "graphics", 8)) {
             base = "/dev/graphics/";
             mkdir(base, 0755);
         } else if (!strncmp(uevent->subsystem, "oncrpc", 6)) {
@@ -386,7 +406,8 @@
             base = "/dev/";
     }
 
-    snprintf(devpath, sizeof(devpath), "%s%s", base, name);
+    if (!devpath_ready)
+        snprintf(devpath, sizeof(devpath), "%s%s", base, name);
 
     if(!strcmp(uevent->action, "add")) {
         make_device(devpath, block, uevent->major, uevent->minor);
diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc
index 46f640f..7845eb9 100644
--- a/rootdir/ueventd.rc
+++ b/rootdir/ueventd.rc
@@ -69,6 +69,7 @@
 /dev/qmi0                 0640   radio      radio
 /dev/qmi1                 0640   radio      radio
 /dev/qmi2                 0640   radio      radio
+/dev/bus/usb/*            0660   root       usb
 
 # CDMA radio interface MUX
 /dev/ts0710mux*           0640   radio      radio