]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2015 18:13:56 +0000 (11:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 May 2015 18:13:56 +0000 (11:13 -0700)
added patches:
mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch
pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch

queue-3.10/mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch [new file with mode: 0644]
queue-3.10/pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch b/queue-3.10/mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch
new file mode 100644 (file)
index 0000000..24f39ec
--- /dev/null
@@ -0,0 +1,93 @@
+From 4e93b9a6abc0d028daf3c8a00cb77b679d8a4df4 Mon Sep 17 00:00:00 2001
+From: Chuanxiao Dong <chuanxiao.dong@intel.com>
+Date: Tue, 12 Aug 2014 12:01:30 +0800
+Subject: mmc: card: Don't access RPMB partitions for normal read/write
+
+From: Chuanxiao Dong <chuanxiao.dong@intel.com>
+
+commit 4e93b9a6abc0d028daf3c8a00cb77b679d8a4df4 upstream.
+
+During kernel boot, it will try to read some logical sectors
+of each block device node for the possible partition table.
+
+But since RPMB partition is special and can not be accessed
+by normal eMMC read / write CMDs, it will cause below error
+messages during kernel boot:
+...
+ mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
+ mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
+ mmcblk0rpmb: retrying using single block read
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
+ end_request: I/O error, dev mmcblk0rpmb, sector 0
+ Buffer I/O error on device mmcblk0rpmb, logical block 0
+ end_request: I/O error, dev mmcblk0rpmb, sector 8
+ Buffer I/O error on device mmcblk0rpmb, logical block 1
+ end_request: I/O error, dev mmcblk0rpmb, sector 16
+ Buffer I/O error on device mmcblk0rpmb, logical block 2
+ end_request: I/O error, dev mmcblk0rpmb, sector 24
+ Buffer I/O error on device mmcblk0rpmb, logical block 3
+...
+
+This patch will discard the access request in eMMC queue if
+it is RPMB partition access request. By this way, it avoids
+trigger above error messages.
+
+Fixes: 090d25fe224c ("mmc: core: Expose access to RPMB partition")
+Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
+Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
+Tested-by: Michael Shigorin <mike@altlinux.org>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/card/block.c |   12 ++++++++++++
+ drivers/mmc/card/queue.c |    2 +-
+ drivers/mmc/card/queue.h |    2 ++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/card/block.c
++++ b/drivers/mmc/card/block.c
+@@ -908,6 +908,18 @@ static inline void mmc_blk_reset_success
+       md->reset_done &= ~type;
+ }
++int mmc_access_rpmb(struct mmc_queue *mq)
++{
++      struct mmc_blk_data *md = mq->data;
++      /*
++       * If this is a RPMB partition access, return ture
++       */
++      if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
++              return true;
++
++      return false;
++}
++
+ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
+ {
+       struct mmc_blk_data *md = mq->data;
+--- a/drivers/mmc/card/queue.c
++++ b/drivers/mmc/card/queue.c
+@@ -37,7 +37,7 @@ static int mmc_prep_request(struct reque
+               return BLKPREP_KILL;
+       }
+-      if (mq && mmc_card_removed(mq->card))
++      if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
+               return BLKPREP_KILL;
+       req->cmd_flags |= REQ_DONTPREP;
+--- a/drivers/mmc/card/queue.h
++++ b/drivers/mmc/card/queue.h
+@@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct
+ extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
+ extern void mmc_packed_clean(struct mmc_queue *);
++extern int mmc_access_rpmb(struct mmc_queue *);
++
+ #endif
diff --git a/queue-3.10/pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch b/queue-3.10/pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch
new file mode 100644 (file)
index 0000000..84b17f6
--- /dev/null
@@ -0,0 +1,103 @@
+From c5272a28566b00cce79127ad382406e0a8650690 Mon Sep 17 00:00:00 2001
+From: Doug Anderson <dianders@chromium.org>
+Date: Fri, 1 May 2015 09:01:27 -0700
+Subject: pinctrl: Don't just pretend to protect pinctrl_maps, do it for real
+
+From: Doug Anderson <dianders@chromium.org>
+
+commit c5272a28566b00cce79127ad382406e0a8650690 upstream.
+
+Way back, when the world was a simpler place and there was no war, no
+evil, and no kernel bugs, there was just a single pinctrl lock.  That
+was how the world was when (57291ce pinctrl: core device tree mapping
+table parsing support) was written.  In that case, there were
+instances where the pinctrl mutex was already held when
+pinctrl_register_map() was called, hence a "locked" parameter was
+passed to the function to indicate that the mutex was already locked
+(so we shouldn't lock it again).
+
+A few years ago in (42fed7b pinctrl: move subsystem mutex to
+pinctrl_dev struct), we switched to a separate pinctrl_maps_mutex.
+...but (oops) we forgot to re-think about the whole "locked" parameter
+for pinctrl_register_map().  Basically the "locked" parameter appears
+to still refer to whether the bigger pinctrl_dev mutex is locked, but
+we're using it to skip locks of our (now separate) pinctrl_maps_mutex.
+
+That's kind of a bad thing(TM).  Probably nobody noticed because most
+of the calls to pinctrl_register_map happen at boot time and we've got
+synchronous device probing.  ...and even cases where we're
+asynchronous don't end up actually hitting the race too often.  ...but
+after banging my head against the wall for a bug that reproduced 1 out
+of 1000 reboots and lots of looking through kgdb, I finally noticed
+this.
+
+Anyway, we can now safely remove the "locked" parameter and go back to
+a war-free, evil-free, and kernel-bug-free world.
+
+Fixes: 42fed7ba44e4 ("pinctrl: move subsystem mutex to pinctrl_dev struct")
+Signed-off-by: Doug Anderson <dianders@chromium.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/core.c       |   10 ++++------
+ drivers/pinctrl/core.h       |    2 +-
+ drivers/pinctrl/devicetree.c |    2 +-
+ 3 files changed, 6 insertions(+), 8 deletions(-)
+
+--- a/drivers/pinctrl/core.c
++++ b/drivers/pinctrl/core.c
+@@ -1077,7 +1077,7 @@ void devm_pinctrl_put(struct pinctrl *p)
+ EXPORT_SYMBOL_GPL(devm_pinctrl_put);
+ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
+-                       bool dup, bool locked)
++                       bool dup)
+ {
+       int i, ret;
+       struct pinctrl_maps *maps_node;
+@@ -1145,11 +1145,9 @@ int pinctrl_register_map(struct pinctrl_
+               maps_node->maps = maps;
+       }
+-      if (!locked)
+-              mutex_lock(&pinctrl_maps_mutex);
++      mutex_lock(&pinctrl_maps_mutex);
+       list_add_tail(&maps_node->node, &pinctrl_maps);
+-      if (!locked)
+-              mutex_unlock(&pinctrl_maps_mutex);
++      mutex_unlock(&pinctrl_maps_mutex);
+       return 0;
+ }
+@@ -1164,7 +1162,7 @@ int pinctrl_register_map(struct pinctrl_
+ int pinctrl_register_mappings(struct pinctrl_map const *maps,
+                             unsigned num_maps)
+ {
+-      return pinctrl_register_map(maps, num_maps, true, false);
++      return pinctrl_register_map(maps, num_maps, true);
+ }
+ void pinctrl_unregister_map(struct pinctrl_map const *map)
+--- a/drivers/pinctrl/core.h
++++ b/drivers/pinctrl/core.h
+@@ -183,7 +183,7 @@ static inline struct pin_desc *pin_desc_
+ }
+ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
+-                       bool dup, bool locked);
++                       bool dup);
+ void pinctrl_unregister_map(struct pinctrl_map const *map);
+ extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
+--- a/drivers/pinctrl/devicetree.c
++++ b/drivers/pinctrl/devicetree.c
+@@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struc
+       dt_map->num_maps = num_maps;
+       list_add_tail(&dt_map->node, &p->dt_maps);
+-      return pinctrl_register_map(map, num_maps, false, true);
++      return pinctrl_register_map(map, num_maps, false);
+ }
+ struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
index 4a1e62ce061d4667cca5feccc67aeffc9ac30506..b9837664e5b8b97bedbdb521881385eecca83e6f 100644 (file)
@@ -9,3 +9,5 @@ arm-dts-imx28-fix-auart4-tx-dma-interrupt-name.patch
 arm-dts-imx23-olinuxino-fix-dr_mode-of-usb0.patch
 arm-mvebu-armada-xp-openblocks-ax3-4-disable-internal-rtc.patch
 drm-i915-add-missing-macbook-pro-models-with-dual-channel-lvds.patch
+pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch
+mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch