Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbWAaVD7 (ORCPT ); Tue, 31 Jan 2006 16:03:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751490AbWAaVD7 (ORCPT ); Tue, 31 Jan 2006 16:03:59 -0500 Received: from mgw-ext04.nokia.com ([131.228.20.96]:65224 "EHLO mgw-ext04.nokia.com") by vger.kernel.org with ESMTP id S1751487AbWAaVD6 (ORCPT ); Tue, 31 Jan 2006 16:03:58 -0500 Message-Id: <20060131202547.535444000@localhost.localdomain> References: <20060131201636.264543000@localhost.localdomain> Date: Tue, 31 Jan 2006 16:16:41 -0400 From: Carlos Aguiar To: linux-kernel@vger.kernel.org, "Linux-omap-open-source@linux.omap.com" Cc: linux@arm.linux.org.uk, David Brownell , Tony Lindgren , Russell King , "Aguiar Carlos (EXT-INdT/Manaus)" , "Lizardo Anderson (EXT-INdT/Manaus)" , Anderson Briglia Subject: [patch 5/6] Add MMC password protection (lock/unlock) support V4 Content-Disposition: inline; filename=mmc_omap_blklen.diff X-OriginalArrivalTime: 31 Jan 2006 20:25:51.0911 (UTC) FILETIME=[87A8B370:01C626A4] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1436 Lines: 37 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 Signed-off-by: Anderson Lizardo Signed-off-by: Carlos Eduardo Aguiar 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); -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/