From: Greg Kroah-Hartman Date: Fri, 17 Jul 2015 02:00:10 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v4.0.9~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6486f33b4cf3de547c98679f795f97d507a6c1e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches 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 --- 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 index 00000000000..9cb0fd31279 --- /dev/null +++ b/queue-3.10/mtd-dc21285-use-raw-spinlock-functions-for-nw_gpio_lock.patch @@ -0,0 +1,63 @@ +From e5babdf928e5d0c432a8d4b99f20421ce14d1ab6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +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?= + +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 +Signed-off-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..a8410e5a747 --- /dev/null +++ b/queue-3.10/mtd-fix-avoid-race-condition-when-accessing-mtd-usecount.patch @@ -0,0 +1,96 @@ +From 073db4a51ee43ccb827f54a4261c0583b028d5ab Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Thu, 7 May 2015 17:55:16 -0700 +Subject: mtd: fix: avoid race condition when accessing mtd->usecount + +From: Brian Norris + +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: [] __put_mtd_device+0x20/0x50 +kernel: [] blktrans_release+0x8c/0xd8 +kernel: [] __blkdev_put+0x1a8/0x200 +kernel: [] blkdev_close+0x1c/0x30 +kernel: [] __fput+0xac/0x250 +kernel: [] task_work_run+0xd8/0x120 +kernel: [] 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 +Reported-by: Giuseppe Cantavenera +Tested-by: Giuseppe Cantavenera +Acked-by: Alexander Sverdlin +Signed-off-by: Brian Norris +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..0c3c332b49e --- /dev/null +++ b/queue-3.10/regmap-fix-regmap_bulk_read-in-be-mode.patch @@ -0,0 +1,35 @@ +From 15b8d2c41fe5839582029f65c5f7004db451cc2b Mon Sep 17 00:00:00 2001 +From: Arun Chandran +Date: Mon, 15 Jun 2015 15:59:02 +0530 +Subject: regmap: Fix regmap_bulk_read in BE mode + +From: Arun Chandran + +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 +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..c0ad1df8490 --- /dev/null +++ b/queue-3.10/regulator-core-fix-constraints-output-buffer.patch @@ -0,0 +1,31 @@ +From a7068e3932eee8268c4ce4e080a338ee7b8a27bf Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Tue, 9 Jun 2015 20:09:42 +0000 +Subject: regulator: core: fix constraints output buffer + +From: Stefan Wahren + +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 +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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; + diff --git a/queue-3.10/series b/queue-3.10/series index a8c74223e0e..fd5a324ec4a 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -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 index 00000000000..16b8a7c4058 --- /dev/null +++ b/queue-3.10/spi-pl022-specify-num-cs-property-as-required-in-devicetree-binding.patch @@ -0,0 +1,37 @@ +From ea6055c46eda1e19e02209814955e13f334bbe1b Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia +Date: Mon, 11 May 2015 12:20:18 -0300 +Subject: spi: pl022: Specify 'num-cs' property as required in devicetree binding + +From: Ezequiel Garcia + +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 +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 = in the SPI child nodes. + If unspecified, a single SPI device without a chip select can be used.