diff mbox

[04/11] mmc: core: Adjust the checking for device status in mmc_send_status_error()

Message ID 1527229072-217039-1-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Lin May 25, 2018, 6:17 a.m. UTC
mmc_send_status_error() gives up checking for bit 17 and bit 18
in device status, and add checking for unlocked status. Refer to
the comment in mmc_send_status_error() for details.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/core/mmc_ops.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 6e8826e..04a5443 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -418,8 +418,16 @@  static int mmc_send_status_error(struct mmc_host *host, u32 status,
 		if (unlikely(mmc_host_is_spi(host)))
 			return (status & R1_SPI_ILLEGAL_COMMAND) ?
 				-EBADMSG : 0;
-
-		if (status & 0xFDFFA000)
+		/*
+		 * Per JESD84-B51 spec, section 6.13, table 68(Device
+		 * status), bit 17 and bit 18 are obsolete and hosts
+		 * should ignore these bits. And bit 15 means device
+		 * is locked but not unlocked by CMD42 prior to any
+		 * operations which need check busy, which is also not
+		 * allowed. So here give up checking bit 17 and bit 18,
+		 * and add checking for bit 25.
+		 */
+		if (status & 0xFFF9A000)
 			pr_warn("%s: unexpected status %#x after switch\n",
 				mmc_hostname(host), status);
 		if (status & R1_SWITCH_ERROR)