]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jul 2015 02:00:10 +0000 (19:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jul 2015 02:00:10 +0000 (19:00 -0700)
added patches:
mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch
mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch
regmap-fix-regmap_bulk_read-in-be-mode.patch
regulator-core-fix-constraints-output-buffer.patch
spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch

queue-3.10/mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch [new file with mode: 0644]
queue-3.10/mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch [new file with mode: 0644]
queue-3.10/regmap-fix-regmap_bulk_read-in-be-mode.patch [new file with mode: 0644]
queue-3.10/regulator-core-fix-constraints-output-buffer.patch [new file with mode: 0644]
queue-3.10/series
queue-3.10/spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch [new file with mode: 0644]

diff --git a/queue-3.10/mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch b/queue-3.10/mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch
new file mode 100644 (file)
index 0000000..9cb0fd3
--- /dev/null
@@ -0,0 +1,63 @@
+From e5babdf928e5d0c432a8d4b99f20421ce14d1ab6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Thu, 28 May 2015 10:22:10 +0200
+Subject: mtd: dc21285: use raw spinlock functions for nw_gpio_lock
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+
+commit e5babdf928e5d0c432a8d4b99f20421ce14d1ab6 upstream.
+
+Since commit bd31b85960a7 (which is in 3.2-rc1) nw_gpio_lock is a raw spinlock
+that needs usage of the corresponding raw functions.
+
+This fixes:
+
+  drivers/mtd/maps/dc21285.c: In function 'nw_en_write':
+  drivers/mtd/maps/dc21285.c:41:340: warning: passing argument 1 of 'spinlock_check' from incompatible pointer type
+    spin_lock_irqsave(&nw_gpio_lock, flags);
+
+  In file included from include/linux/seqlock.h:35:0,
+                   from include/linux/time.h:5,
+                   from include/linux/stat.h:18,
+                   from include/linux/module.h:10,
+                   from drivers/mtd/maps/dc21285.c:8:
+  include/linux/spinlock.h:299:102: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
+   static inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
+                                                                                                        ^
+  drivers/mtd/maps/dc21285.c:43:25: warning: passing argument 1 of 'spin_unlock_irqrestore' from incompatible pointer type
+    spin_unlock_irqrestore(&nw_gpio_lock, flags);
+                           ^
+  In file included from include/linux/seqlock.h:35:0,
+                   from include/linux/time.h:5,
+                   from include/linux/stat.h:18,
+                   from include/linux/module.h:10,
+                   from drivers/mtd/maps/dc21285.c:8:
+  include/linux/spinlock.h:370:91: note: expected 'struct spinlock_t *' but argument is of type 'struct raw_spinlock_t *'
+   static inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
+
+Fixes: bd31b85960a7 ("locking, ARM: Annotate low level hw locks as raw")
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/maps/dc21285.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/maps/dc21285.c
++++ b/drivers/mtd/maps/dc21285.c
+@@ -38,9 +38,9 @@ static void nw_en_write(void)
+        * we want to write a bit pattern XXX1 to Xilinx to enable
+        * the write gate, which will be open for about the next 2ms.
+        */
+-      spin_lock_irqsave(&nw_gpio_lock, flags);
++      raw_spin_lock_irqsave(&nw_gpio_lock, flags);
+       nw_cpld_modify(CPLD_FLASH_WR_ENABLE, CPLD_FLASH_WR_ENABLE);
+-      spin_unlock_irqrestore(&nw_gpio_lock, flags);
++      raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
+       /*
+        * let the ISA bus to catch on...
diff --git a/queue-3.10/mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch b/queue-3.10/mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch
new file mode 100644 (file)
index 0000000..a8410e5
--- /dev/null
@@ -0,0 +1,96 @@
+From 073db4a51ee43ccb827f54a4261c0583b028d5ab Mon Sep 17 00:00:00 2001
+From: Brian Norris <computersforpeace@gmail.com>
+Date: Thu, 7 May 2015 17:55:16 -0700
+Subject: mtd: fix: avoid race condition when accessing mtd->usecount
+
+From: Brian Norris <computersforpeace@gmail.com>
+
+commit 073db4a51ee43ccb827f54a4261c0583b028d5ab upstream.
+
+On A MIPS 32-cores machine a BUG_ON was triggered because some acesses to
+mtd->usecount were done without taking mtd_table_mutex.
+kernel: Call Trace:
+kernel: [<ffffffff80401818>] __put_mtd_device+0x20/0x50
+kernel: [<ffffffff804086f4>] blktrans_release+0x8c/0xd8
+kernel: [<ffffffff802577e0>] __blkdev_put+0x1a8/0x200
+kernel: [<ffffffff802579a4>] blkdev_close+0x1c/0x30
+kernel: [<ffffffff8022006c>] __fput+0xac/0x250
+kernel: [<ffffffff80171208>] task_work_run+0xd8/0x120
+kernel: [<ffffffff8012c23c>] work_notifysig+0x10/0x18
+kernel:
+kernel:
+        Code: 2442ffff  ac8202d8  000217fe <00020336> dc820128  10400003
+               00000000  0040f809  00000000
+kernel: ---[ end trace 080fbb4579b47a73 ]---
+
+Fixed by taking the mutex in blktrans_open and blktrans_release.
+
+Note that this locking is already suggested in
+include/linux/mtd/blktrans.h:
+
+struct mtd_blktrans_ops {
+...
+       /* Called with mtd_table_mutex held; no race with add/remove */
+       int (*open)(struct mtd_blktrans_dev *dev);
+       void (*release)(struct mtd_blktrans_dev *dev);
+...
+};
+
+But we weren't following it.
+
+Originally reported by (and patched by) Zhang and Giuseppe,
+independently. Improved and rewritten.
+
+Reported-by: Zhang Xingcai <zhangxingcai@huawei.com>
+Reported-by: Giuseppe Cantavenera <giuseppe.cantavenera.ext@nokia.com>
+Tested-by: Giuseppe Cantavenera <giuseppe.cantavenera.ext@nokia.com>
+Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/mtd_blkdevs.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/mtd/mtd_blkdevs.c
++++ b/drivers/mtd/mtd_blkdevs.c
+@@ -199,6 +199,7 @@ static int blktrans_open(struct block_de
+               return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
+       mutex_lock(&dev->lock);
++      mutex_lock(&mtd_table_mutex);
+       if (dev->open)
+               goto unlock;
+@@ -222,6 +223,7 @@ static int blktrans_open(struct block_de
+ unlock:
+       dev->open++;
++      mutex_unlock(&mtd_table_mutex);
+       mutex_unlock(&dev->lock);
+       blktrans_dev_put(dev);
+       return ret;
+@@ -232,6 +234,7 @@ error_release:
+ error_put:
+       module_put(dev->tr->owner);
+       kref_put(&dev->ref, blktrans_dev_release);
++      mutex_unlock(&mtd_table_mutex);
+       mutex_unlock(&dev->lock);
+       blktrans_dev_put(dev);
+       return ret;
+@@ -245,6 +248,7 @@ static void blktrans_release(struct gend
+               return;
+       mutex_lock(&dev->lock);
++      mutex_lock(&mtd_table_mutex);
+       if (--dev->open)
+               goto unlock;
+@@ -258,6 +262,7 @@ static void blktrans_release(struct gend
+               __put_mtd_device(dev->mtd);
+       }
+ unlock:
++      mutex_unlock(&mtd_table_mutex);
+       mutex_unlock(&dev->lock);
+       blktrans_dev_put(dev);
+ }
diff --git a/queue-3.10/regmap-fix-regmap_bulk_read-in-be-mode.patch b/queue-3.10/regmap-fix-regmap_bulk_read-in-be-mode.patch
new file mode 100644 (file)
index 0000000..0c3c332
--- /dev/null
@@ -0,0 +1,35 @@
+From 15b8d2c41fe5839582029f65c5f7004db451cc2b Mon Sep 17 00:00:00 2001
+From: Arun Chandran <achandran@mvista.com>
+Date: Mon, 15 Jun 2015 15:59:02 +0530
+Subject: regmap: Fix regmap_bulk_read in BE mode
+
+From: Arun Chandran <achandran@mvista.com>
+
+commit 15b8d2c41fe5839582029f65c5f7004db451cc2b upstream.
+
+In big endian mode regmap_bulk_read gives incorrect data
+for byte reads.
+
+This is because memcpy of a single byte from an address
+after full word read gives different results when
+endianness differs. ie. we get little-end in LE and big-end in BE.
+
+Signed-off-by: Arun Chandran <achandran@mvista.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/regmap/regmap.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/base/regmap/regmap.c
++++ b/drivers/base/regmap/regmap.c
+@@ -1586,7 +1586,7 @@ int regmap_bulk_read(struct regmap *map,
+                                         &ival);
+                       if (ret != 0)
+                               return ret;
+-                      memcpy(val + (i * val_bytes), &ival, val_bytes);
++                      map->format.format_val(val + (i * val_bytes), ival, 0);
+               }
+       }
diff --git a/queue-3.10/regulator-core-fix-constraints-output-buffer.patch b/queue-3.10/regulator-core-fix-constraints-output-buffer.patch
new file mode 100644 (file)
index 0000000..c0ad1df
--- /dev/null
@@ -0,0 +1,31 @@
+From a7068e3932eee8268c4ce4e080a338ee7b8a27bf Mon Sep 17 00:00:00 2001
+From: Stefan Wahren <stefan.wahren@i2se.com>
+Date: Tue, 9 Jun 2015 20:09:42 +0000
+Subject: regulator: core: fix constraints output buffer
+
+From: Stefan Wahren <stefan.wahren@i2se.com>
+
+commit a7068e3932eee8268c4ce4e080a338ee7b8a27bf upstream.
+
+The buffer for condtraints debug isn't big enough to hold the output
+in all cases. So fix this issue by increasing the buffer.
+
+Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/regulator/core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -769,7 +769,7 @@ static int suspend_prepare(struct regula
+ static void print_constraints(struct regulator_dev *rdev)
+ {
+       struct regulation_constraints *constraints = rdev->constraints;
+-      char buf[80] = "";
++      char buf[160] = "";
+       int count = 0;
+       int ret;
index a8c74223e0eb899b973a1f57b9e2b19acdf8bcba..fd5a324ec4ad4ab4d5180cca2edb848167777731 100644 (file)
@@ -7,3 +7,8 @@ arm64-do-not-attempt-to-use-init_mm-in-reset_context.patch
 arm64-mm-fix-freeing-of-the-wrong-memmap-entries-with-sparsemem_vmemmap.patch
 arm64-vdso-work-around-broken-elf-toolchains-in-makefile.patch
 cpuidle-menu-return-1-if-there-are-no-suitable-states.patch
+regmap-fix-regmap_bulk_read-in-be-mode.patch
+regulator-core-fix-constraints-output-buffer.patch
+spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch
+mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch
+mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch
diff --git a/queue-3.10/spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch b/queue-3.10/spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch
new file mode 100644 (file)
index 0000000..16b8a7c
--- /dev/null
@@ -0,0 +1,37 @@
+From ea6055c46eda1e19e02209814955e13f334bbe1b Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
+Date: Mon, 11 May 2015 12:20:18 -0300
+Subject: spi: pl022: Specify 'num-cs' property as required in devicetree binding
+
+From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
+
+commit ea6055c46eda1e19e02209814955e13f334bbe1b upstream.
+
+Since commit 39a6ac11df65 ("spi/pl022: Devicetree support w/o platform data")
+the 'num-cs' parameter cannot be passed through platform data when probing
+with devicetree. Instead, it's a required devicetree property.
+
+Fix the binding documentation so the property is properly specified.
+
+Fixes: 39a6ac11df65 ("spi/pl022: Devicetree support w/o platform data")
+Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/spi/spi_pl022.txt |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Documentation/devicetree/bindings/spi/spi_pl022.txt
++++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt
+@@ -4,9 +4,9 @@ Required properties:
+ - compatible : "arm,pl022", "arm,primecell"
+ - reg : Offset and length of the register set for the device
+ - interrupts : Should contain SPI controller interrupt
++- num-cs : total number of chipselects
+ Optional properties:
+-- num-cs : total number of chipselects
+ - cs-gpios : should specify GPIOs used for chipselects.
+   The gpios will be referred to as reg = <index> in the SPI child nodes.
+   If unspecified, a single SPI device without a chip select can be used.