lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon,  3 Mar 2014 14:17:11 -0500
From:	Johnson Thomas <johnsonthomas@...ometrics.ca>
To:	cjb@...top.org
Cc:	dbrownell@...rs.sourceforge.net, linux-mmc@...r.kernel.org,
	linux-kernel@...r.kernel.org, johnsonthomas@...ometrics.ca,
	jamesnuss@...ometrics.ca
Subject: [PATCH] mmc: mmc_spi: synchronize STOP_TRANSMISSION with next data token during block reads

Certain SD cards respond with an invalid response (ie,. response
not defined in the SD protocol) during block reads when the
OUT_OF_RANGE data token is sent back from the card at the same time
as the host sends a STOP_TRANSMISSION command (CMD12). As a result,
the card enters a bad state which leads to rejecting any subsequent
commands until the card is reset.

Synchronize with the subsequent data token for every block read before
issuing a STOP_TRANSMISSION command (CMD12). The synchronization is
done by issuing 0xff bytes until a data token is received.

Signed-off-by: Johnson Thomas <johnsonthomas@...ometrics.ca>
---
 drivers/mmc/host/mmc_spi.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 7c1e16a..7703a15 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -984,6 +984,14 @@ mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd,
 		}
 	}
 
+	if (direction == DMA_FROM_DEVICE && multiple) {
+		int status = mmc_spi_readtoken(host, timeout);
+		if (status < 0)
+			dev_dbg(&spi->dev,
+				"read error for data token, returned status: 0x%02x (%d)\n",
+				status, status);
+	}
+
 	/* NOTE some docs describe an MMC-only SET_BLOCK_COUNT (CMD23) that
 	 * can be issued before multiblock writes.  Unlike its more widely
 	 * documented analogue for SD cards (SET_WR_BLK_ERASE_COUNT, ACMD23),
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ