]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Aug 2012 15:42:34 +0000 (08:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Aug 2012 15:42:34 +0000 (08:42 -0700)
added patches:
usbdevfs-correct-amount-of-data-copied-to-user-in-processcompl_compat.patch
usb-gadget-fix-g_ether-interface-link-status.patch

queue-3.0/series
queue-3.0/usb-gadget-fix-g_ether-interface-link-status.patch [new file with mode: 0644]
queue-3.0/usbdevfs-correct-amount-of-data-copied-to-user-in-processcompl_compat.patch [new file with mode: 0644]

index f92646dfb942134e07ce4a96277142922010084a..9a4978330a5d27e203e07936ec7700e68daf8a64 100644 (file)
@@ -9,3 +9,5 @@ scsi-fix-hot-unplug-vs-async-scan-race.patch
 scsi-avoid-dangling-pointer-in-scsi_requeue_command.patch
 arm-omap2-opp-fix-to-ensure-check-of-right-oppdef-after-bad-one.patch
 alsa-hda-add-support-for-realtek-alc282.patch
+usbdevfs-correct-amount-of-data-copied-to-user-in-processcompl_compat.patch
+usb-gadget-fix-g_ether-interface-link-status.patch
diff --git a/queue-3.0/usb-gadget-fix-g_ether-interface-link-status.patch b/queue-3.0/usb-gadget-fix-g_ether-interface-link-status.patch
new file mode 100644 (file)
index 0000000..6f504b8
--- /dev/null
@@ -0,0 +1,59 @@
+From 31bde1ceaa873bcaecd49e829bfabceacc4c512d Mon Sep 17 00:00:00 2001
+From: Kevin Cernekee <cernekee@gmail.com>
+Date: Sun, 24 Jun 2012 21:11:22 -0700
+Subject: usb: gadget: Fix g_ether interface link status
+
+From: Kevin Cernekee <cernekee@gmail.com>
+
+commit 31bde1ceaa873bcaecd49e829bfabceacc4c512d upstream.
+
+A "usb0" interface that has never been connected to a host has an unknown
+operstate, and therefore the IFF_RUNNING flag is (incorrectly) asserted
+when queried by ifconfig, ifplugd, etc.  This is a result of calling
+netif_carrier_off() too early in the probe function; it should be called
+after register_netdev().
+
+Similar problems have been fixed in many other drivers, e.g.:
+
+    e826eafa6 (bonding: Call netif_carrier_off after register_netdevice)
+    0d672e9f8 (drivers/net: Call netif_carrier_off at the end of the probe)
+    6a3c869a6 (cxgb4: fix reported state of interfaces without link)
+
+Fix is to move netif_carrier_off() to the end of the function.
+
+Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/u_ether.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/gadget/u_ether.c
++++ b/drivers/usb/gadget/u_ether.c
+@@ -803,12 +803,6 @@ int gether_setup(struct usb_gadget *g, u
+       SET_ETHTOOL_OPS(net, &ops);
+-      /* two kinds of host-initiated state changes:
+-       *  - iff DATA transfer is active, carrier is "on"
+-       *  - tx queueing enabled if open *and* carrier is "on"
+-       */
+-      netif_carrier_off(net);
+-
+       dev->gadget = g;
+       SET_NETDEV_DEV(net, &g->dev);
+       SET_NETDEV_DEVTYPE(net, &gadget_type);
+@@ -822,6 +816,12 @@ int gether_setup(struct usb_gadget *g, u
+               INFO(dev, "HOST MAC %pM\n", dev->host_mac);
+               the_dev = dev;
++
++              /* two kinds of host-initiated state changes:
++               *  - iff DATA transfer is active, carrier is "on"
++               *  - tx queueing enabled if open *and* carrier is "on"
++               */
++              netif_carrier_off(net);
+       }
+       return status;
diff --git a/queue-3.0/usbdevfs-correct-amount-of-data-copied-to-user-in-processcompl_compat.patch b/queue-3.0/usbdevfs-correct-amount-of-data-copied-to-user-in-processcompl_compat.patch
new file mode 100644 (file)
index 0000000..cb4e684
--- /dev/null
@@ -0,0 +1,41 @@
+From 2102e06a5f2e414694921f23591f072a5ba7db9f Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Wed, 4 Jul 2012 09:18:01 +0200
+Subject: usbdevfs: Correct amount of data copied to user in processcompl_compat
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 2102e06a5f2e414694921f23591f072a5ba7db9f upstream.
+
+iso data buffers may have holes in them if some packets were short, so for
+iso urbs we should always copy the entire buffer, just like the regular
+processcompl does.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/core/devio.c |   10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/devio.c
++++ b/drivers/usb/core/devio.c
+@@ -1557,10 +1557,14 @@ static int processcompl_compat(struct as
+       void __user *addr = as->userurb;
+       unsigned int i;
+-      if (as->userbuffer && urb->actual_length)
+-              if (copy_to_user(as->userbuffer, urb->transfer_buffer,
+-                               urb->actual_length))
++      if (as->userbuffer && urb->actual_length) {
++              if (urb->number_of_packets > 0)         /* Isochronous */
++                      i = urb->transfer_buffer_length;
++              else                                    /* Non-Isoc */
++                      i = urb->actual_length;
++              if (copy_to_user(as->userbuffer, urb->transfer_buffer, i))
+                       return -EFAULT;
++      }
+       if (put_user(as->status, &userurb->status))
+               return -EFAULT;
+       if (put_user(urb->actual_length, &userurb->actual_length))