]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.79/mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.79 / mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch
1 From 4e93b9a6abc0d028daf3c8a00cb77b679d8a4df4 Mon Sep 17 00:00:00 2001
2 From: Chuanxiao Dong <chuanxiao.dong@intel.com>
3 Date: Tue, 12 Aug 2014 12:01:30 +0800
4 Subject: mmc: card: Don't access RPMB partitions for normal read/write
5
6 From: Chuanxiao Dong <chuanxiao.dong@intel.com>
7
8 commit 4e93b9a6abc0d028daf3c8a00cb77b679d8a4df4 upstream.
9
10 During kernel boot, it will try to read some logical sectors
11 of each block device node for the possible partition table.
12
13 But since RPMB partition is special and can not be accessed
14 by normal eMMC read / write CMDs, it will cause below error
15 messages during kernel boot:
16 ...
17 mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
18 mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
19 mmcblk0rpmb: retrying using single block read
20 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
21 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
22 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
23 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
24 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
25 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
26 end_request: I/O error, dev mmcblk0rpmb, sector 0
27 Buffer I/O error on device mmcblk0rpmb, logical block 0
28 end_request: I/O error, dev mmcblk0rpmb, sector 8
29 Buffer I/O error on device mmcblk0rpmb, logical block 1
30 end_request: I/O error, dev mmcblk0rpmb, sector 16
31 Buffer I/O error on device mmcblk0rpmb, logical block 2
32 end_request: I/O error, dev mmcblk0rpmb, sector 24
33 Buffer I/O error on device mmcblk0rpmb, logical block 3
34 ...
35
36 This patch will discard the access request in eMMC queue if
37 it is RPMB partition access request. By this way, it avoids
38 trigger above error messages.
39
40 Fixes: 090d25fe224c ("mmc: core: Expose access to RPMB partition")
41 Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
42 Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
43 Tested-by: Michael Shigorin <mike@altlinux.org>
44 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
45 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
46
47 ---
48 drivers/mmc/card/block.c | 12 ++++++++++++
49 drivers/mmc/card/queue.c | 2 +-
50 drivers/mmc/card/queue.h | 2 ++
51 3 files changed, 15 insertions(+), 1 deletion(-)
52
53 --- a/drivers/mmc/card/block.c
54 +++ b/drivers/mmc/card/block.c
55 @@ -908,6 +908,18 @@ static inline void mmc_blk_reset_success
56 md->reset_done &= ~type;
57 }
58
59 +int mmc_access_rpmb(struct mmc_queue *mq)
60 +{
61 + struct mmc_blk_data *md = mq->data;
62 + /*
63 + * If this is a RPMB partition access, return ture
64 + */
65 + if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
66 + return true;
67 +
68 + return false;
69 +}
70 +
71 static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
72 {
73 struct mmc_blk_data *md = mq->data;
74 --- a/drivers/mmc/card/queue.c
75 +++ b/drivers/mmc/card/queue.c
76 @@ -37,7 +37,7 @@ static int mmc_prep_request(struct reque
77 return BLKPREP_KILL;
78 }
79
80 - if (mq && mmc_card_removed(mq->card))
81 + if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
82 return BLKPREP_KILL;
83
84 req->cmd_flags |= REQ_DONTPREP;
85 --- a/drivers/mmc/card/queue.h
86 +++ b/drivers/mmc/card/queue.h
87 @@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct
88 extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
89 extern void mmc_packed_clean(struct mmc_queue *);
90
91 +extern int mmc_access_rpmb(struct mmc_queue *);
92 +
93 #endif