]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2012 18:58:55 +0000 (11:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2012 18:58:55 +0000 (11:58 -0700)
added patches:
davinci_mdio-fix-mdio-timeout-check.patch
usb-yurex-fix-missing-urb_no_transfer_dma_map-flag-in-urb.patch
usb-yurex-remove-allocation-of-coherent-buffer-for-setup-packet-buffer.patch
uwb-fix-error-handling.patch
uwb-fix-use-of-del_timer_sync-in-interrupt.patch
xen-gntdev-do-not-set-vm_pfnmap.patch
xen-xenbus-add-quirk-to-deal-with-misconfigured-backends.patch

queue-3.0/davinci_mdio-fix-mdio-timeout-check.patch [new file with mode: 0644]
queue-3.0/series
queue-3.0/usb-yurex-fix-missing-urb_no_transfer_dma_map-flag-in-urb.patch [new file with mode: 0644]
queue-3.0/usb-yurex-remove-allocation-of-coherent-buffer-for-setup-packet-buffer.patch [new file with mode: 0644]
queue-3.0/uwb-fix-error-handling.patch [new file with mode: 0644]
queue-3.0/uwb-fix-use-of-del_timer_sync-in-interrupt.patch [new file with mode: 0644]
queue-3.0/xen-gntdev-do-not-set-vm_pfnmap.patch [new file with mode: 0644]
queue-3.0/xen-xenbus-add-quirk-to-deal-with-misconfigured-backends.patch [new file with mode: 0644]

diff --git a/queue-3.0/davinci_mdio-fix-mdio-timeout-check.patch b/queue-3.0/davinci_mdio-fix-mdio-timeout-check.patch
new file mode 100644 (file)
index 0000000..4e0f5fc
--- /dev/null
@@ -0,0 +1,42 @@
+From 5b76d0600b2b08eef77f8e9226938b7b6bde3099 Mon Sep 17 00:00:00 2001
+From: Christian Riesch <christian.riesch@omicron.at>
+Date: Mon, 16 Apr 2012 04:35:25 +0000
+Subject: davinci_mdio: Fix MDIO timeout check
+
+From: Christian Riesch <christian.riesch@omicron.at>
+
+commit 5b76d0600b2b08eef77f8e9226938b7b6bde3099 upstream.
+
+Under heavy load (flood ping) it is possible for the MDIO timeout to
+expire before the loop checks the GO bit again. This patch adds an
+additional check whether the operation was done before actually
+returning -ETIMEDOUT.
+
+To reproduce this bug, flood ping the device, e.g., ping -f -l 1000
+After some time, a "timed out waiting for user access" warning
+may appear. And even worse, link may go down since the PHY reported a
+timeout.
+
+Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
+Cc: Cyril Chemparathy <cyril@ti.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/davinci_mdio.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/net/davinci_mdio.c
++++ b/drivers/net/davinci_mdio.c
+@@ -181,6 +181,11 @@ static inline int wait_for_user_access(s
+               __davinci_mdio_reset(data);
+               return -EAGAIN;
+       }
++
++      reg = __raw_readl(&regs->user[0].access);
++      if ((reg & USERACCESS_GO) == 0)
++              return 0;
++
+       dev_err(data->dev, "timed out waiting for user access\n");
+       return -ETIMEDOUT;
+ }
index 999ecd934d0c81a43a0566d4fa9c0adc726127db..82ab2db56f6984ebfa7f0778db6e9c4217226fb7 100644 (file)
@@ -3,3 +3,10 @@ crypto-sha512-fix-byte-counter-overflow-in-sha-512.patch
 hwmon-fam15h_power-fix-bogus-values-with-current-bioses.patch
 alsa-hda-conexant-don-t-set-hp-pin-control-bit.patch
 arm-clps711x-serial-driver-hungs-are-a-result-of-call-disable_irq-within-isr.patch
+xen-gntdev-do-not-set-vm_pfnmap.patch
+xen-xenbus-add-quirk-to-deal-with-misconfigured-backends.patch
+usb-yurex-remove-allocation-of-coherent-buffer-for-setup-packet-buffer.patch
+usb-yurex-fix-missing-urb_no_transfer_dma_map-flag-in-urb.patch
+uwb-fix-use-of-del_timer_sync-in-interrupt.patch
+uwb-fix-error-handling.patch
+davinci_mdio-fix-mdio-timeout-check.patch
diff --git a/queue-3.0/usb-yurex-fix-missing-urb_no_transfer_dma_map-flag-in-urb.patch b/queue-3.0/usb-yurex-fix-missing-urb_no_transfer_dma_map-flag-in-urb.patch
new file mode 100644 (file)
index 0000000..de968dc
--- /dev/null
@@ -0,0 +1,31 @@
+From 532f17b5d59bf0deb6f1ff9bc1fb27d5b5011c09 Mon Sep 17 00:00:00 2001
+From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+Date: Fri, 30 Mar 2012 08:51:36 +0900
+Subject: USB: yurex: Fix missing URB_NO_TRANSFER_DMA_MAP flag in urb
+
+From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+
+commit 532f17b5d59bf0deb6f1ff9bc1fb27d5b5011c09 upstream.
+
+Current probing code is setting URB_NO_TRANSFER_DMA_MAP flag into a wrong urb
+structure, and this causes BUG_ON with some USB host implementations.
+This patch fixes the issue.
+
+Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/misc/yurex.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/misc/yurex.c
++++ b/drivers/usb/misc/yurex.c
+@@ -282,7 +282,7 @@ static int yurex_probe(struct usb_interf
+                        usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
+                        dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt,
+                        dev, 1);
+-      dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
++      dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+       if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
+               retval = -EIO;
+               err("Could not submitting URB");
diff --git a/queue-3.0/usb-yurex-remove-allocation-of-coherent-buffer-for-setup-packet-buffer.patch b/queue-3.0/usb-yurex-remove-allocation-of-coherent-buffer-for-setup-packet-buffer.patch
new file mode 100644 (file)
index 0000000..690412e
--- /dev/null
@@ -0,0 +1,44 @@
+From 523fc5c14f6cad283e5a266eba0e343aed6e73d5 Mon Sep 17 00:00:00 2001
+From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+Date: Fri, 30 Mar 2012 08:51:28 +0900
+Subject: USB: yurex: Remove allocation of coherent buffer for setup-packet buffer
+
+From: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+
+commit 523fc5c14f6cad283e5a266eba0e343aed6e73d5 upstream.
+
+Removes allocation of coherent buffer for the control-request setup-packet
+buffer from the yurex driver. Using coherent buffers for setup-packet is
+obsolete and does not work with some USB host implementations.
+
+Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/misc/yurex.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/misc/yurex.c
++++ b/drivers/usb/misc/yurex.c
+@@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kr
+       usb_put_dev(dev->udev);
+       if (dev->cntl_urb) {
+               usb_kill_urb(dev->cntl_urb);
+-              if (dev->cntl_req)
+-                      usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
+-                              dev->cntl_req, dev->cntl_urb->setup_dma);
++              kfree(dev->cntl_req);
+               if (dev->cntl_buffer)
+                       usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
+                               dev->cntl_buffer, dev->cntl_urb->transfer_dma);
+@@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interf
+       }
+       /* allocate buffer for control req */
+-      dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
+-                                         GFP_KERNEL,
+-                                         &dev->cntl_urb->setup_dma);
++      dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
+       if (!dev->cntl_req) {
+               err("Could not allocate cntl_req");
+               goto error;
diff --git a/queue-3.0/uwb-fix-error-handling.patch b/queue-3.0/uwb-fix-error-handling.patch
new file mode 100644 (file)
index 0000000..0de2e8b
--- /dev/null
@@ -0,0 +1,31 @@
+From 5bd7b419ef2eb4989b207753e088c3437159618a Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oliver@neukum.org>
+Date: Wed, 18 Apr 2012 10:05:55 +0200
+Subject: uwb: fix error handling
+
+From: Oliver Neukum <oliver@neukum.org>
+
+commit 5bd7b419ef2eb4989b207753e088c3437159618a upstream.
+
+Fatal errors such as a device disconnect must not trigger
+error handling. The error returns must be checked.
+
+Signed-off-by: Oliver Neukum <oneukum@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/uwb/hwa-rc.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/uwb/hwa-rc.c
++++ b/drivers/uwb/hwa-rc.c
+@@ -645,7 +645,8 @@ void hwarc_neep_cb(struct urb *urb)
+               dev_err(dev, "NEEP: URB error %d\n", urb->status);
+       }
+       result = usb_submit_urb(urb, GFP_ATOMIC);
+-      if (result < 0) {
++      if (result < 0 && result != -ENODEV && result != -EPERM) {
++              /* ignoring unrecoverable errors */
+               dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n",
+                       result);
+               goto error;
diff --git a/queue-3.0/uwb-fix-use-of-del_timer_sync-in-interrupt.patch b/queue-3.0/uwb-fix-use-of-del_timer_sync-in-interrupt.patch
new file mode 100644 (file)
index 0000000..d575774
--- /dev/null
@@ -0,0 +1,61 @@
+From 9426cd05682745d1024dbabdec5631309bd2f480 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oliver@neukum.org>
+Date: Mon, 16 Apr 2012 15:28:28 +0200
+Subject: uwb: fix use of del_timer_sync() in interrupt
+
+From: Oliver Neukum <oliver@neukum.org>
+
+commit 9426cd05682745d1024dbabdec5631309bd2f480 upstream.
+
+del_timer_sync() cannot be used in interrupt.
+Replace it with del_timer() and a flag
+
+Signed-off-by: Oliver Neukum <oneukum@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/uwb/neh.c |   12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/drivers/uwb/neh.c
++++ b/drivers/uwb/neh.c
+@@ -106,6 +106,7 @@ struct uwb_rc_neh {
+       u8 evt_type;
+       __le16 evt;
+       u8 context;
++      u8 completed;
+       uwb_rc_cmd_cb_f cb;
+       void *arg;
+@@ -408,6 +409,7 @@ static void uwb_rc_neh_grok_event(struct
+       struct device *dev = &rc->uwb_dev.dev;
+       struct uwb_rc_neh *neh;
+       struct uwb_rceb *notif;
++      unsigned long flags;
+       if (rceb->bEventContext == 0) {
+               notif = kmalloc(size, GFP_ATOMIC);
+@@ -421,7 +423,11 @@ static void uwb_rc_neh_grok_event(struct
+       } else {
+               neh = uwb_rc_neh_lookup(rc, rceb);
+               if (neh) {
+-                      del_timer_sync(&neh->timer);
++                      spin_lock_irqsave(&rc->neh_lock, flags);
++                      /* to guard against a timeout */
++                      neh->completed = 1;
++                      del_timer(&neh->timer);
++                      spin_unlock_irqrestore(&rc->neh_lock, flags);
+                       uwb_rc_neh_cb(neh, rceb, size);
+               } else
+                       dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n",
+@@ -567,6 +573,10 @@ static void uwb_rc_neh_timer(unsigned lo
+       unsigned long flags;
+       spin_lock_irqsave(&rc->neh_lock, flags);
++      if (neh->completed) {
++              spin_unlock_irqrestore(&rc->neh_lock, flags);
++              return;
++      }
+       if (neh->context)
+               __uwb_rc_neh_rm(rc, neh);
+       else
diff --git a/queue-3.0/xen-gntdev-do-not-set-vm_pfnmap.patch b/queue-3.0/xen-gntdev-do-not-set-vm_pfnmap.patch
new file mode 100644 (file)
index 0000000..86ebf4f
--- /dev/null
@@ -0,0 +1,35 @@
+From e8e937be971d706061dc56220ff3605ab77622a7 Mon Sep 17 00:00:00 2001
+From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+Date: Tue, 3 Apr 2012 18:05:47 +0100
+Subject: xen/gntdev: do not set VM_PFNMAP
+
+From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+
+commit e8e937be971d706061dc56220ff3605ab77622a7 upstream.
+
+Since we are using the m2p_override we do have struct pages
+corresponding to the user vma mmap'ed by gntdev.
+
+Removing the VM_PFNMAP flag makes get_user_pages work on that vma.
+An example test case would be using a Xen userspace block backend
+(QDISK) on a file on NFS using O_DIRECT.
+
+Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/gntdev.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/xen/gntdev.c
++++ b/drivers/xen/gntdev.c
+@@ -664,7 +664,7 @@ static int gntdev_mmap(struct file *flip
+       vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND;
+       if (use_ptemod)
+-              vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP;
++              vma->vm_flags |= VM_DONTCOPY;
+       vma->vm_private_data = map;
diff --git a/queue-3.0/xen-xenbus-add-quirk-to-deal-with-misconfigured-backends.patch b/queue-3.0/xen-xenbus-add-quirk-to-deal-with-misconfigured-backends.patch
new file mode 100644 (file)
index 0000000..026ce94
--- /dev/null
@@ -0,0 +1,148 @@
+From 3066616ce23aad5719c23a0f21f32676402cb44b Mon Sep 17 00:00:00 2001
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Tue, 17 Apr 2012 22:21:38 -0400
+Subject: xen/xenbus: Add quirk to deal with misconfigured backends.
+
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+
+commit 3066616ce23aad5719c23a0f21f32676402cb44b upstream.
+
+A rather annoying and common case is when booting a PVonHVM guest
+and exposing the PV KBD and PV VFB - as broken toolstacks don't
+always initialize the backends correctly.
+
+Normally The HVM guest is using the VGA driver and the emulated
+keyboard for this (though upstream version of QEMU implements
+PV KBD, but still uses a VGA driver). We provide a very basic
+two-stage wait mechanism - where we wait for 30 seconds for all
+devices, and then for 270 for all them except the two mentioned.
+
+That allows us to wait for the essential devices, like network
+or disk for the full 6 minutes.
+
+To trigger this, put this in your guest config:
+
+vfb = [ 'vnc=1, vnclisten=0.0.0.0 ,vncunused=1']
+
+instead of this:
+vnc=1
+vnclisten="0.0.0.0"
+
+Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+[v3: Split delay in non-essential (30 seconds) and essential
+ devices per Ian and Stefano suggestion]
+[v4: Added comments per Stefano suggestion]
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/xenbus/xenbus_probe_frontend.c |   69 ++++++++++++++++++++++-------
+ 1 file changed, 53 insertions(+), 16 deletions(-)
+
+--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
++++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
+@@ -132,7 +132,7 @@ static int read_backend_details(struct x
+       return xenbus_read_otherend_details(xendev, "backend-id", "backend");
+ }
+-static int is_device_connecting(struct device *dev, void *data)
++static int is_device_connecting(struct device *dev, void *data, bool ignore_nonessential)
+ {
+       struct xenbus_device *xendev = to_xenbus_device(dev);
+       struct device_driver *drv = data;
+@@ -149,16 +149,41 @@ static int is_device_connecting(struct d
+       if (drv && (dev->driver != drv))
+               return 0;
++      if (ignore_nonessential) {
++              /* With older QEMU, for PVonHVM guests the guest config files
++               * could contain: vfb = [ 'vnc=1, vnclisten=0.0.0.0']
++               * which is nonsensical as there is no PV FB (there can be
++               * a PVKB) running as HVM guest. */
++
++              if ((strncmp(xendev->nodename, "device/vkbd", 11) == 0))
++                      return 0;
++
++              if ((strncmp(xendev->nodename, "device/vfb", 10) == 0))
++                      return 0;
++      }
+       xendrv = to_xenbus_driver(dev->driver);
+       return (xendev->state < XenbusStateConnected ||
+               (xendev->state == XenbusStateConnected &&
+                xendrv->is_ready && !xendrv->is_ready(xendev)));
+ }
++static int essential_device_connecting(struct device *dev, void *data)
++{
++      return is_device_connecting(dev, data, true /* ignore PV[KBB+FB] */);
++}
++static int non_essential_device_connecting(struct device *dev, void *data)
++{
++      return is_device_connecting(dev, data, false);
++}
+-static int exists_connecting_device(struct device_driver *drv)
++static int exists_essential_connecting_device(struct device_driver *drv)
+ {
+       return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
+-                              is_device_connecting);
++                              essential_device_connecting);
++}
++static int exists_non_essential_connecting_device(struct device_driver *drv)
++{
++      return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
++                              non_essential_device_connecting);
+ }
+ static int print_device_status(struct device *dev, void *data)
+@@ -189,6 +214,23 @@ static int print_device_status(struct de
+ /* We only wait for device setup after most initcalls have run. */
+ static int ready_to_wait_for_devices;
++static bool wait_loop(unsigned long start, unsigned int max_delay,
++                   unsigned int *seconds_waited)
++{
++      if (time_after(jiffies, start + (*seconds_waited+5)*HZ)) {
++              if (!*seconds_waited)
++                      printk(KERN_WARNING "XENBUS: Waiting for "
++                             "devices to initialise: ");
++              *seconds_waited += 5;
++              printk("%us...", max_delay - *seconds_waited);
++              if (*seconds_waited == max_delay)
++                      return true;
++      }
++
++      schedule_timeout_interruptible(HZ/10);
++
++      return false;
++}
+ /*
+  * On a 5-minute timeout, wait for all devices currently configured.  We need
+  * to do this to guarantee that the filesystems and / or network devices
+@@ -212,19 +254,14 @@ static void wait_for_devices(struct xenb
+       if (!ready_to_wait_for_devices || !xen_domain())
+               return;
+-      while (exists_connecting_device(drv)) {
+-              if (time_after(jiffies, start + (seconds_waited+5)*HZ)) {
+-                      if (!seconds_waited)
+-                              printk(KERN_WARNING "XENBUS: Waiting for "
+-                                     "devices to initialise: ");
+-                      seconds_waited += 5;
+-                      printk("%us...", 300 - seconds_waited);
+-                      if (seconds_waited == 300)
+-                              break;
+-              }
+-
+-              schedule_timeout_interruptible(HZ/10);
+-      }
++      while (exists_non_essential_connecting_device(drv))
++              if (wait_loop(start, 30, &seconds_waited))
++                      break;
++
++      /* Skips PVKB and PVFB check.*/
++      while (exists_essential_connecting_device(drv))
++              if (wait_loop(start, 270, &seconds_waited))
++                      break;
+       if (seconds_waited)
+               printk("\n");