From: Carlos Aguiar <carlos.aguiar@indt.org.br>
To: linux-kernel@vger.kernel.org,
"Linux-omap-open-source@linux.omap.com"
<linux-omap-open-source@linux.omap.com>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
linux@arm.linux.org.uk,
"Lizardo Anderson (EXT-INdT/Manaus)"
<anderson.lizardo@indt.org.br>
Subject: [patch 5/6] Add MMC password protection (lock/unlock) support V4
Date: Tue, 31 Jan 2006 16:16:41 -0400 [thread overview]
Message-ID: <20060131202547.535444000@localhost.localdomain> (raw)
In-Reply-To: 20060131201636.264543000@localhost.localdomain
[-- Attachment #1: mmc_omap_blklen.diff --]
[-- Type: text/plain, Size: 1192 bytes --]
The MMC_LOCK_UNLOCK command requires the block length to be exactly the
password length + 2 bytes, but hardware-specific drivers force a "power of 2"
block size.
This patch sends the exact block size (password + 2 bytes) to the host. OMAP
specific.
Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>
Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Index: linux-omap-2.6.git/drivers/mmc/omap.c
===================================================================
--- linux-omap-2.6.git.orig/drivers/mmc/omap.c 2006-01-31 15:17:44.000000000 -0400
+++ linux-omap-2.6.git/drivers/mmc/omap.c 2006-01-31 15:22:33.000000000 -0400
@@ -888,8 +888,12 @@ mmc_omap_prepare_data(struct mmc_omap_ho
return;
}
-
- block_size = 1 << data->blksz_bits;
+ /* password protection: we need to send the exact block size to the
+ * card (password + 2), not a 2-exponent. */
+ if (req->cmd->opcode == MMC_LOCK_UNLOCK)
+ block_size = data->sg[0].length;
+ else
+ block_size = 1 << data->blksz_bits;
OMAP_MMC_WRITE(host->base, NBLK, data->blocks - 1);
OMAP_MMC_WRITE(host->base, BLEN, block_size - 1);
--
next prev parent reply other threads:[~2006-01-31 20:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-31 20:16 [patch 0/6] Add MMC password protection (lock/unlock) support V4 Carlos Aguiar
2006-01-31 20:16 ` [patch 1/6] " Carlos Aguiar
2006-01-31 20:16 ` [patch 2/6] " Carlos Aguiar
2006-01-31 20:16 ` [patch 3/6] " Carlos Aguiar
2006-01-31 20:16 ` [patch 4/6] " Carlos Aguiar
2006-01-31 20:16 ` Carlos Aguiar [this message]
2006-01-31 20:16 ` [patch 6/6] " Carlos Aguiar
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=20060131202547.535444000@localhost.localdomain \
--to=carlos.aguiar@indt.org.br \
--cc=anderson.lizardo@indt.org.br \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap-open-source@linux.omap.com \
--cc=linux@arm.linux.org.uk \
--cc=rmk+lkml@arm.linux.org.uk \
/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