All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: card: not access RPMB partition for normal read and write
@ 2014-08-12  4:01 Yunpeng Gao
  2014-08-12  8:36 ` Ulf Hansson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yunpeng Gao @ 2014-08-12  4:01 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chuanxiao Dong, Yunpeng Gao

From: Chuanxiao Dong <chuanxiao.dong@intel.com>

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:
...
<3>[    4.890052] mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
<3>[    4.892160] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
<4>[    4.892165] mmcblk0rpmb: retrying using single block read
<3>[    4.895727] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.899269] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.901466] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.905106] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.907166] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.909235] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
<3>[    4.909241] end_request: I/O error, dev mmcblk0rpmb, sector 0
<3>[    4.909247] Buffer I/O error on device mmcblk0rpmb, logical block 0
<3>[    4.909263] end_request: I/O error, dev mmcblk0rpmb, sector 8
<3>[    4.909267] Buffer I/O error on device mmcblk0rpmb, logical block 1
<3>[    4.909272] end_request: I/O error, dev mmcblk0rpmb, sector 16
<3>[    4.909275] Buffer I/O error on device mmcblk0rpmb, logical block 2
<3>[    4.909280] end_request: I/O error, dev mmcblk0rpmb, sector 24
<3>[    4.909283] 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.

Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
 drivers/mmc/card/block.c |   13 +++++++++++++
 drivers/mmc/card/queue.c |    2 +-
 drivers/mmc/card/queue.h |    2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..4b79592 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1025,6 +1025,19 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
 	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;
+}
+EXPORT_SYMBOL_GPL(mmc_access_rpmb);
+
 static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
 {
 	struct mmc_blk_data *md = mq->data;
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 3e049c1..6ceede0 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
 		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;
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index 5752d50..99e6521 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
 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
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2014-08-12  4:01 [PATCH] mmc: card: not access RPMB partition for normal read and write Yunpeng Gao
@ 2014-08-12  8:36 ` Ulf Hansson
  2014-08-12 10:54   ` Gao, Yunpeng
  2014-10-01 13:53 ` Michael Shigorin
  2015-05-06 13:06 ` Ulf Hansson
  2 siblings, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2014-08-12  8:36 UTC (permalink / raw)
  To: Yunpeng Gao; +Cc: linux-mmc, Chuanxiao Dong

On 12 August 2014 06:01, Yunpeng Gao <yunpeng.gao@intel.com> wrote:
> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>
> 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:

The following patch were included in 3.8, does this solve your issue?

53d8f97 mmc: card: Do not scan RPMB partitions

Kind regards
Uffe

> ...
> <3>[    4.890052] mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
> <3>[    4.892160] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
> <4>[    4.892165] mmcblk0rpmb: retrying using single block read
> <3>[    4.895727] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.899269] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.901466] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.905106] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.907166] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909235] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909241] end_request: I/O error, dev mmcblk0rpmb, sector 0
> <3>[    4.909247] Buffer I/O error on device mmcblk0rpmb, logical block 0
> <3>[    4.909263] end_request: I/O error, dev mmcblk0rpmb, sector 8
> <3>[    4.909267] Buffer I/O error on device mmcblk0rpmb, logical block 1
> <3>[    4.909272] end_request: I/O error, dev mmcblk0rpmb, sector 16
> <3>[    4.909275] Buffer I/O error on device mmcblk0rpmb, logical block 2
> <3>[    4.909280] end_request: I/O error, dev mmcblk0rpmb, sector 24
> <3>[    4.909283] 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.
>
> Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> ---
>  drivers/mmc/card/block.c |   13 +++++++++++++
>  drivers/mmc/card/queue.c |    2 +-
>  drivers/mmc/card/queue.h |    2 ++
>  3 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 452782b..4b79592 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1025,6 +1025,19 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
>         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;
> +}
> +EXPORT_SYMBOL_GPL(mmc_access_rpmb);
> +
>  static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
>  {
>         struct mmc_blk_data *md = mq->data;
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 3e049c1..6ceede0 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
>                 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;
> diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
> index 5752d50..99e6521 100644
> --- a/drivers/mmc/card/queue.h
> +++ b/drivers/mmc/card/queue.h
> @@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
>  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
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2014-08-12  8:36 ` Ulf Hansson
@ 2014-08-12 10:54   ` Gao, Yunpeng
  0 siblings, 0 replies; 8+ messages in thread
From: Gao, Yunpeng @ 2014-08-12 10:54 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Dong, Chuanxiao

Thanks for the reminder.

I confirmed patch 53d8f97462b0bbb51150f4d6bc2fd45336a008b9 - ' mmc: card: Do not scan RPMB partitions' has already been in the kernel mmc driver I’m using.
But seems it does not fix this issue.

Actually, after adding debug output for 'md->disk->flags' when error happened, below error message captured:
...
<3>[    5.068249] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
<4>[    5.068255] mmcblk0rpmb: retrying using single block read. md->disk->flags: 0x210
...

md->disk->flags value is '0x210', which means ' GENHD_FL_NO_PART_SCAN' (bit 9) has already been set.
So, I'm not sure why it does not work.

I observed this issue on my Merrifield VV board.
Did anyone else observed the similar issue on other platform? Thanks.

Regards,
Yunpeng

-----Original Message-----
From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Ulf Hansson
Sent: Tuesday, August 12, 2014 4:37 PM
To: Gao, Yunpeng
Cc: linux-mmc; Dong, Chuanxiao
Subject: Re: [PATCH] mmc: card: not access RPMB partition for normal read and write

On 12 August 2014 06:01, Yunpeng Gao <yunpeng.gao@intel.com> wrote:
> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>
> 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:

The following patch were included in 3.8, does this solve your issue?

53d8f97 mmc: card: Do not scan RPMB partitions

Kind regards
Uffe

> ...
> <3>[    4.890052] mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
> <3>[    4.892160] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
> <4>[    4.892165] mmcblk0rpmb: retrying using single block read
> <3>[    4.895727] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.899269] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.901466] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.905106] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.907166] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909235] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909241] end_request: I/O error, dev mmcblk0rpmb, sector 0
> <3>[    4.909247] Buffer I/O error on device mmcblk0rpmb, logical block 0
> <3>[    4.909263] end_request: I/O error, dev mmcblk0rpmb, sector 8
> <3>[    4.909267] Buffer I/O error on device mmcblk0rpmb, logical block 1
> <3>[    4.909272] end_request: I/O error, dev mmcblk0rpmb, sector 16
> <3>[    4.909275] Buffer I/O error on device mmcblk0rpmb, logical block 2
> <3>[    4.909280] end_request: I/O error, dev mmcblk0rpmb, sector 24
> <3>[    4.909283] 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.
>
> Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> ---
>  drivers/mmc/card/block.c |   13 +++++++++++++
>  drivers/mmc/card/queue.c |    2 +-
>  drivers/mmc/card/queue.h |    2 ++
>  3 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 
> 452782b..4b79592 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1025,6 +1025,19 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
>         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;
> +}
> +EXPORT_SYMBOL_GPL(mmc_access_rpmb);
> +
>  static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct 
> request *req)  {
>         struct mmc_blk_data *md = mq->data; diff --git 
> a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 
> 3e049c1..6ceede0 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
>                 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; diff --git 
> a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index 
> 5752d50..99e6521 100644
> --- a/drivers/mmc/card/queue.h
> +++ b/drivers/mmc/card/queue.h
> @@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct 
> mmc_queue_req *);  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
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 
> in the body of a message to majordomo@vger.kernel.org More majordomo 
> info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2014-08-12  4:01 [PATCH] mmc: card: not access RPMB partition for normal read and write Yunpeng Gao
  2014-08-12  8:36 ` Ulf Hansson
@ 2014-10-01 13:53 ` Michael Shigorin
  2015-02-26 12:23   ` Michael Shigorin
  2015-05-06 13:06 ` Ulf Hansson
  2 siblings, 1 reply; 8+ messages in thread
From: Michael Shigorin @ 2014-10-01 13:53 UTC (permalink / raw)
  To: Chuanxiao Dong, Ulf Hansson; +Cc: linux-mmc, 759656, Nell Hardcastle

	Hello,
what is the status of this patch to cope with MMC RPMB?
http://permalink.gmane.org/gmane.linux.kernel.mmc/28281

I had to use this workaround having run into timeouts:
https://dev-nell.com/rpmb-emmc-errors-under-linux.html

Here's some arch/arm work by Ulf:
https://patches.linaro.org/17128/

TIA :)

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2014-10-01 13:53 ` Michael Shigorin
@ 2015-02-26 12:23   ` Michael Shigorin
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Shigorin @ 2015-02-26 12:23 UTC (permalink / raw)
  To: Chuanxiao Dong, Ulf Hansson, linux-mmc, 759656, Nell Hardcastle

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

On Wed, Oct 01, 2014 at 05:53:30PM +0400, I wrote:
> what is the status of this patch to cope with MMC RPMB?
> http://permalink.gmane.org/gmane.linux.kernel.mmc/28281

Just in case, it's now also

Tested-by: Michael Shigorin <mike@altlinux.org>

Hope to see this merged!

2 debian: please note that udev rules fixup is required, see also
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1333140
-- it's been fixed in 219 or see the patch in 218-10ubuntu1 package.

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info

[-- Attachment #2: rules-Fix-by-path-of-mmc-RPMB-partitions-and-don-t-b.patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Wed, 11 Feb 2015 15:26:52 +0100
Subject: rules: Fix by-path of mmc RPMB partitions and don't blkid them

Linux 3.10+ exposes RPMB (Replay Protected Memory Block) partitions of MMC
devices [1] ; trying to read them with blkid or other unspecific means will
cause kernel buffer I/O errors and timeouts.

Blacklist those to prevent creating wrong by-path links and
blkid'ing those.

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=090d25fe224c0

https://launchpad.net/bugs/1333140
---
 rules/60-persistent-storage.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
index 475b151..25b44a5 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
@@ -14,7 +14,7 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_
 SUBSYSTEM!="block", GOTO="persistent_storage_end"
 
 # skip rules for inappropriate block devices
-KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|zram*", GOTO="persistent_storage_end"
+KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|zram*|mmcblk[0-9]*rpmb", GOTO="persistent_storage_end"
 
 # ignore partitions that span the entire disk
 TEST=="whole_disk", GOTO="persistent_storage_end"

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2014-08-12  4:01 [PATCH] mmc: card: not access RPMB partition for normal read and write Yunpeng Gao
  2014-08-12  8:36 ` Ulf Hansson
  2014-10-01 13:53 ` Michael Shigorin
@ 2015-05-06 13:06 ` Ulf Hansson
  2015-05-06 13:09   ` Sebastian Andrzej Siewior
  2 siblings, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2015-05-06 13:06 UTC (permalink / raw)
  To: Yunpeng Gao
  Cc: linux-mmc, Chuanxiao Dong, 759656, Nell Hardcastle,
	Michael Shigorin, Christian Gmeiner, Sebastian Andrzej Siewior,
	Daniel Yerushalmi

On 12 August 2014 at 06:01, Yunpeng Gao <yunpeng.gao@intel.com> wrote:
> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>
> 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:
> ...
> <3>[    4.890052] mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
> <3>[    4.892160] mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
> <4>[    4.892165] mmcblk0rpmb: retrying using single block read
> <3>[    4.895727] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.899269] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.901466] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.905106] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.907166] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909235] mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
> <3>[    4.909241] end_request: I/O error, dev mmcblk0rpmb, sector 0
> <3>[    4.909247] Buffer I/O error on device mmcblk0rpmb, logical block 0
> <3>[    4.909263] end_request: I/O error, dev mmcblk0rpmb, sector 8
> <3>[    4.909267] Buffer I/O error on device mmcblk0rpmb, logical block 1
> <3>[    4.909272] end_request: I/O error, dev mmcblk0rpmb, sector 16
> <3>[    4.909275] Buffer I/O error on device mmcblk0rpmb, logical block 2
> <3>[    4.909280] end_request: I/O error, dev mmcblk0rpmb, sector 24
> <3>[    4.909283] 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.
>
> Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>

This patch has been completely forgotten, sorry about that. It fixes a
old issue for RPMB partitions.

With a minor change to the commit message (adding a Fixes tag) and
also removing "EXPORT_SYMBOL_GPL(mmc_access_rpmb);" since it not
needed, this patch applied smoothly to my fixes branch.

Sorry for the delay and thanks!

Kind regards
Uffe

> ---
>  drivers/mmc/card/block.c |   13 +++++++++++++
>  drivers/mmc/card/queue.c |    2 +-
>  drivers/mmc/card/queue.h |    2 ++
>  3 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 452782b..4b79592 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1025,6 +1025,19 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
>         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;
> +}
> +EXPORT_SYMBOL_GPL(mmc_access_rpmb);
> +
>  static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
>  {
>         struct mmc_blk_data *md = mq->data;
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index 3e049c1..6ceede0 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
>                 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;
> diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
> index 5752d50..99e6521 100644
> --- a/drivers/mmc/card/queue.h
> +++ b/drivers/mmc/card/queue.h
> @@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
>  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
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2015-05-06 13:06 ` Ulf Hansson
@ 2015-05-06 13:09   ` Sebastian Andrzej Siewior
  2015-05-06 13:26     ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2015-05-06 13:09 UTC (permalink / raw)
  To: Ulf Hansson, Yunpeng Gao
  Cc: linux-mmc, Chuanxiao Dong, 759656, Nell Hardcastle,
	Michael Shigorin, Christian Gmeiner, Daniel Yerushalmi

On 05/06/2015 03:06 PM, Ulf Hansson wrote:
> On 12 August 2014 at 06:01, Yunpeng Gao <yunpeng.gao@intel.com> wrote:
>> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
> Sorry for the delay and thanks!

ah thanks. Is it likely you go via my patches for mmc-utils in the new
few days?

> Kind regards
> Uffe

Sebastian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: not access RPMB partition for normal read and write
  2015-05-06 13:09   ` Sebastian Andrzej Siewior
@ 2015-05-06 13:26     ` Ulf Hansson
  0 siblings, 0 replies; 8+ messages in thread
From: Ulf Hansson @ 2015-05-06 13:26 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-mmc, Chris Ball

- Decreased cc-list

On 6 May 2015 at 15:09, Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> On 05/06/2015 03:06 PM, Ulf Hansson wrote:
>> On 12 August 2014 at 06:01, Yunpeng Gao <yunpeng.gao@intel.com> wrote:
>>> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>> Sorry for the delay and thanks!
>
> ah thanks. Is it likely you go via my patches for mmc-utils in the new
> few days?

Nope, that's handled by Chris Ball.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-06 13:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12  4:01 [PATCH] mmc: card: not access RPMB partition for normal read and write Yunpeng Gao
2014-08-12  8:36 ` Ulf Hansson
2014-08-12 10:54   ` Gao, Yunpeng
2014-10-01 13:53 ` Michael Shigorin
2015-02-26 12:23   ` Michael Shigorin
2015-05-06 13:06 ` Ulf Hansson
2015-05-06 13:09   ` Sebastian Andrzej Siewior
2015-05-06 13:26     ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.