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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 30 May 2008 14:43:51 +0200
From:	Nicolas Ferre <nicolas.ferre@...el.com>
To:	Nicolas Ferre <nicolas.ferre@...el.com>
CC:	Hans-Jürgen Koch <hjk@...utronix.de>,
	Ville Syrjälä <syrjala@....fi>,
	Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/7] mmc: at91_mci: support for block size not modulo 4

From: Marc Pignat <marc.pignat@...s.ch>

Implement transfer with size not modulo 4 for at91sam9*. Please note 
that the
at91rm9200 simply can't handle this.

Signed-off-by: Marc Pignat <marc.pignat@...s.ch>
Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
---
drivers/mmc/host/at91_mci.c |   15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 8979ad3..543b64b 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -233,11 +233,11 @@ static void at91_mci_pre_dma_read(struct 
at91mci_host *host)

		if (i == 0) {
			at91_mci_write(host, ATMEL_PDC_RPR, sg->dma_address);
-			at91_mci_write(host, ATMEL_PDC_RCR, sg->length / 4);
+			at91_mci_write(host, ATMEL_PDC_RCR, (data->blksz & 0x3) ? sg->length 
: sg->length / 4);
		}
		else {
			at91_mci_write(host, ATMEL_PDC_RNPR, sg->dma_address);
-			at91_mci_write(host, ATMEL_PDC_RNCR, sg->length / 4);
+			at91_mci_write(host, ATMEL_PDC_RNCR, (data->blksz & 0x3) ? 
sg->length : sg->length / 4);
		}
	}

@@ -430,7 +430,7 @@ static void at91_mci_send_command(struct 
at91mci_host *host, struct mmc_command

	if (data) {

-		if ( data->blksz & 0x3 ) {
+		if ( cpu_is_at91rm9200() && (data->blksz & 0x3) ) {
			pr_debug("Unsupported block size\n");
			cmd->error = -EINVAL;
			mmc_request_done(host->mmc, host->request);
@@ -482,7 +482,10 @@ static void at91_mci_send_command(struct 
at91mci_host *host, struct mmc_command
	} else {
		/* zero block length and PDC mode */
		mr = at91_mci_read(host, AT91_MCI_MR) & 0x7fff;
-		at91_mci_write(host, AT91_MCI_MR, mr | (block_length << 16) | 
AT91_MCI_PDCMODE);
+		mr |= (data->blksz & 0x3) ? AT91_MCI_PDCFBYTE : 0;
+		mr |= (block_length << 16);
+		mr |= AT91_MCI_PDCMODE;
+		at91_mci_write(host, AT91_MCI_MR, mr);

		/*
		 * Disable the PDC controller
@@ -517,7 +520,9 @@ static void at91_mci_send_command(struct 
at91mci_host *host, struct mmc_command
				pr_debug("Transmitting %d bytes\n", host->total_length);

				at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address);
-				at91_mci_write(host, ATMEL_PDC_TCR, host->total_length / 4);
+				at91_mci_write(host, ATMEL_PDC_TCR, (data->blksz & 0x3) ?
+						host->total_length : host->total_length / 4);
+
				ier = AT91_MCI_CMDRDY;
			}
		}
-- 
1.5.3.7



--
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