]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2013 04:53:47 +0000 (12:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2013 04:53:47 +0000 (12:53 +0800)
added patches:
hw_random-make-buffer-usable-in-scatterlist.patch
mwifiex-correct-sleep-delay-counter.patch

queue-3.4/hw_random-make-buffer-usable-in-scatterlist.patch [new file with mode: 0644]
queue-3.4/mwifiex-correct-sleep-delay-counter.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/hw_random-make-buffer-usable-in-scatterlist.patch b/queue-3.4/hw_random-make-buffer-usable-in-scatterlist.patch
new file mode 100644 (file)
index 0000000..1f537b9
--- /dev/null
@@ -0,0 +1,75 @@
+From f7f154f1246ccc5a0a7e9ce50932627d60a0c878 Mon Sep 17 00:00:00 2001
+From: Rusty Russell <rusty@rustcorp.com.au>
+Date: Tue, 5 Mar 2013 10:07:08 +1030
+Subject: hw_random: make buffer usable in scatterlist.
+
+From: Rusty Russell <rusty@rustcorp.com.au>
+
+commit f7f154f1246ccc5a0a7e9ce50932627d60a0c878 upstream.
+
+virtio_rng feeds the randomness buffer handed by the core directly
+into the scatterlist, since commit bb347d98079a547e80bd4722dee1de61e4dca0e8.
+
+However, if CONFIG_HW_RANDOM=m, the static buffer isn't a linear address
+(at least on most archs).  We could fix this in virtio_rng, but it's actually
+far easier to just do it in the core as virtio_rng would have to allocate
+a buffer every time (it doesn't know how much the core will want to read).
+
+Reported-by: Aurelien Jarno <aurelien@aurel32.net>
+Tested-by: Aurelien Jarno <aurelien@aurel32.net>
+Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/hw_random/core.c |   19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+--- a/drivers/char/hw_random/core.c
++++ b/drivers/char/hw_random/core.c
+@@ -40,6 +40,7 @@
+ #include <linux/init.h>
+ #include <linux/miscdevice.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ #include <asm/uaccess.h>
+@@ -52,8 +53,12 @@ static struct hwrng *current_rng;
+ static LIST_HEAD(rng_list);
+ static DEFINE_MUTEX(rng_mutex);
+ static int data_avail;
+-static u8 rng_buffer[SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES]
+-      __cacheline_aligned;
++static u8 *rng_buffer;
++
++static size_t rng_buffer_size(void)
++{
++      return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES;
++}
+ static inline int hwrng_init(struct hwrng *rng)
+ {
+@@ -116,7 +121,7 @@ static ssize_t rng_dev_read(struct file
+               if (!data_avail) {
+                       bytes_read = rng_get_data(current_rng, rng_buffer,
+-                              sizeof(rng_buffer),
++                              rng_buffer_size(),
+                               !(filp->f_flags & O_NONBLOCK));
+                       if (bytes_read < 0) {
+                               err = bytes_read;
+@@ -307,6 +312,14 @@ int hwrng_register(struct hwrng *rng)
+       mutex_lock(&rng_mutex);
++      /* kmalloc makes this safe for virt_to_page() in virtio_rng.c */
++      err = -ENOMEM;
++      if (!rng_buffer) {
++              rng_buffer = kmalloc(rng_buffer_size(), GFP_KERNEL);
++              if (!rng_buffer)
++                      goto out_unlock;
++      }
++
+       /* Must not register two RNGs with the same name. */
+       err = -EEXIST;
+       list_for_each_entry(tmp, &rng_list, list) {
diff --git a/queue-3.4/mwifiex-correct-sleep-delay-counter.patch b/queue-3.4/mwifiex-correct-sleep-delay-counter.patch
new file mode 100644 (file)
index 0000000..6565f14
--- /dev/null
@@ -0,0 +1,34 @@
+From 3e7a4ff7c5b6423ddb644df9c41b8b6d2fb79d30 Mon Sep 17 00:00:00 2001
+From: Avinash Patil <patila@marvell.com>
+Date: Mon, 25 Feb 2013 16:01:34 -0800
+Subject: mwifiex: correct sleep delay counter
+
+From: Avinash Patil <patila@marvell.com>
+
+commit 3e7a4ff7c5b6423ddb644df9c41b8b6d2fb79d30 upstream.
+
+Maximum delay for waking up card is 50 ms. Because of typo in
+counter, this delay goes to 500ms. This patch fixes the bug.
+
+Signed-off-by: Avinash Patil <patila@marvell.com>
+Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
+Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
+Signed-off-by: Bing Zhao <bzhao@marvell.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/mwifiex/pcie.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/mwifiex/pcie.c
++++ b/drivers/net/wireless/mwifiex/pcie.c
+@@ -288,7 +288,7 @@ static int mwifiex_pm_wakeup_card(struct
+               i++;
+               usleep_range(10, 20);
+               /* 50ms max wait */
+-              if (i == 50000)
++              if (i == 5000)
+                       break;
+       }
index 26efbc2b4b279ad959b0d18dac95d17a77197b2e..2e795103eb25e82522a7630a5b478e9c306a9580 100644 (file)
@@ -9,3 +9,5 @@ cifs-ensure-that-cifs_get_root-only-traverses-directories.patch
 nfs-don-t-allow-nfs-silly-renamed-files-to-be-deleted-no-signal.patch
 sunrpc-don-t-start-the-retransmission-timer-when-out-of-socket-space.patch
 ata_piix-reenable-ms-virtual-pc-guests.patch
+hw_random-make-buffer-usable-in-scatterlist.patch
+mwifiex-correct-sleep-delay-counter.patch