From patchwork Fri Jun 29 06:32:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saugata Das X-Patchwork-Id: 1130691 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4ADE3DFF34 for ; Fri, 29 Jun 2012 06:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162Ab2F2GdI (ORCPT ); Fri, 29 Jun 2012 02:33:08 -0400 Received: from eu1sys200aog103.obsmtp.com ([207.126.144.115]:35310 "EHLO eu1sys200aog103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007Ab2F2GdH (ORCPT ); Fri, 29 Jun 2012 02:33:07 -0400 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKT+1MH0l+gkxhq0eykncX8FGI9TgtaxL3@postini.com; Fri, 29 Jun 2012 06:33:06 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0520BB8; Fri, 29 Jun 2012 06:24:41 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 6EAEE12B1; Fri, 29 Jun 2012 06:32:59 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 5E74EA8065; Fri, 29 Jun 2012 08:32:55 +0200 (CEST) Received: from localhost (10.201.54.119) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 29 Jun 2012 08:32:58 +0200 From: Saugata Das To: Cc: , Saugata Das Subject: [PATCH] [MMC 4.5] Fix for checking block numbers in disable emulation mode Date: Fri, 29 Jun 2012 12:02:34 +0530 Message-ID: <1340951554-29504-1-git-send-email-saugata.das@stericsson.com> X-Mailer: git-send-email 1.7.4.3 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Saugata Das In 512B disable emulation patch, a check is done to ensure that size of the data is multiple of 4KB. However, the check is done with brq->data.blocks, which is not initialized at the point of check. This is now changed to blk_rq_sectors. Signed-off-by: Saugata Das --- drivers/mmc/card/block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index d628c5d..ee8b3d6 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1296,7 +1296,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc) * When 4KB native sector is enabled, only 8 blocks * multiple read or write is allowed */ - if ((brq->data.blocks & 0x07) && + if ((blk_rq_sectors(req) & 0x07) && (card->ext_csd.data_sector_size == 4096)) { pr_err("%s: Transfer size is not 4KB sector size aligned\n", req->rq_disk->disk_name);