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: 9696 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B1B9023E16 for ; Fri, 29 Jun 2012 06:33:09 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 78B02A18542 for ; Fri, 29 Jun 2012 06:33:09 +0000 (UTC) Received: by ghbz12 with SMTP id z12so2711141ghb.11 for ; Thu, 28 Jun 2012 23:33:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=gMOv4RphyoS4n6ZUQSMRPgeUh6PbxFhpWuFatcLoaOU=; b=lEis40BA1UCLcwGjS6WgmVpWB4f8lJMotcFuPDbYoMCq30DlfZRr8rsqr1HCo9A1jt 5DYu04vWmdD8x+Ic2+Htd9r1YnosSTK/tybu9As2hKKt13EWMGkFYcfj2j4Y8nAUC9Gl ntzEhl+lqzrgHrZflZKdRLY6vNVeZLnAYTdNh9AQ9SNJeK7RayR4LO1LBGzKS8X2YPy7 h+DczlGsa1Vx9IyOVLwuce/ImZrSkQKH5DYAuoQylA3EpWb747mXfd++WgMiOEdqg8tb cQMM/UZ38k15qmETl343wNa5PiCsSqf85bCtLezBsoMxTyroioPNL4YsYLLyeWC/4R3W 2DnA== Received: by 10.42.89.72 with SMTP id f8mr176387icm.33.1340951588554; Thu, 28 Jun 2012 23:33:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp76346ibb; Thu, 28 Jun 2012 23:33:07 -0700 (PDT) Received: by 10.14.95.79 with SMTP id o55mr216800eef.163.1340951587346; Thu, 28 Jun 2012 23:33:07 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com. [207.126.144.115]) by mx.google.com with SMTP id t8si949180eef.78.2012.06.28.23.33.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jun 2012 23:33:07 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) smtp.mail=saugata.das@stericsson.com 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 X-Gm-Message-State: ALoCoQmOW9tYOBuxozkubSC6aKAaZBvRbyGisv7pyw46t1MFF2tYcLXOVquE5fMIKM655dDc6RrE 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);