public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Yunpeng Gao <yunpeng.gao@intel.com>,
	Chuanxiao Dong <chuanxiao.dong@intel.com>,
	Michael Shigorin <mike@altlinux.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH 3.10 13/17] mmc: card: Dont access RPMB partitions for normal read/write
Date: Fri, 15 May 2015 16:10:21 -0700	[thread overview]
Message-ID: <20150515231005.858561170@linuxfoundation.org> (raw)
In-Reply-To: <20150515231004.395424105@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

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



  parent reply	other threads:[~2015-05-15 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 23:10 [PATCH 3.10 00/17] 3.10.79-stable review Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 01/17] ocfs2: dlm: fix race between purge and get lock resource Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 02/17] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken() Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 03/17] mm/memory-failure: call shake_page() when error hits thp tail page Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 04/17] xen/console: Update console event channel on resume Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 05/17] gpio: unregister gpiochip device before removing it Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 06/17] gpio: sysfs: fix memory leaks and device hotplug Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 07/17] ARM: dts: imx25: Add #pwm-cells to pwm4 Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 08/17] ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 09/17] ARM: dts: imx23-olinuxino: Fix dr_mode of usb0 Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 10/17] ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 11/17] drm/i915: Add missing MacBook Pro models with dual channel LVDS Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 12/17] pinctrl: Dont just pretend to protect pinctrl_maps, do it for real Greg Kroah-Hartman
2015-05-15 23:10 ` Greg Kroah-Hartman [this message]
2015-05-15 23:10 ` [PATCH 3.10 14/17] sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 15/17] revert "softirq: Add support for triggering softirq work on softirqs" Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 16/17] ACPICA: Tables: Change acpi_find_root_pointer() to use acpi_physical_address Greg Kroah-Hartman
2015-05-15 23:10 ` [PATCH 3.10 17/17] ACPICA: Utilities: Cleanup to enforce ACPI_PHYSADDR_TO_PTR()/ACPI_PTR_TO_PHYSADDR() Greg Kroah-Hartman
2015-05-16  3:14 ` [PATCH 3.10 00/17] 3.10.79-stable review Guenter Roeck
2015-05-16  3:16 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150515231005.858561170@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=chuanxiao.dong@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike@altlinux.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yunpeng.gao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox