From patchwork Thu Nov 14 10:23:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3181541 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F41D8C045C for ; Thu, 14 Nov 2013 10:23:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8AB620974 for ; Thu, 14 Nov 2013 10:23:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C43E620975 for ; Thu, 14 Nov 2013 10:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514Ab3KNKX0 (ORCPT ); Thu, 14 Nov 2013 05:23:26 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:49869 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505Ab3KNKXZ (ORCPT ); Thu, 14 Nov 2013 05:23:25 -0500 Received: by mail-pb0-f45.google.com with SMTP id mc8so1831621pbc.18 for ; Thu, 14 Nov 2013 02:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=rrHdywdPOmfVSI3SNFK5T3yShr5G4X2B8qdceyzZ3Dk=; b=hkkWFBMI3Z54i7Dmeq5KOadgfJH63ral19JeWtpwzyEJaIIK4U8MwGV09YJDgIl0bw PATib86HBrLVQezLGQ0eaK2QoNeRExISTHFT+/ZChEA4mMZaddDhS7gP+Xu96pkz942c x2m1vszi5bCQb/secPc+1PxDrObsH7pn+UGVM7Ps9yoDLxOm60YtUy4fAuW+FlOfNdUn 7fhkVDgw+GTcIZO/Yr6JpCmA65VK8TNrlmMLROZuVeH0O3vbqYEuIvH/ypmnYW7hMr8R wbv5qqQE9elwTLXPffgIVG6rBKZIeKMefBHxIFYZ+srQl00/xe+WeChliwahoel463MQ iREg== X-Received: by 10.67.4.227 with SMTP id ch3mr711891pad.74.1384424604872; Thu, 14 Nov 2013 02:23:24 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id xn12sm58147368pac.12.2013.11.14.02.23.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Nov 2013 02:23:23 -0800 (PST) Date: Thu, 14 Nov 2013 02:23:23 -0800 (PST) Message-ID: <87fvqzz3hk.wl%kuninori.morimoto.gx@renesas.com> To: Chris Ball Cc: Simon , Laurent , Magnus , Linux-SH , Kuninori Morimoto , linux-mmc@vger.kernel.org In-Reply-To: <87habfz3kd.wl%kuninori.morimoto.gx@renesas.com> References: <87li0rz3to.wl%kuninori.morimoto.gx@renesas.com> <87habfz3kd.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 03/17] mmc: tmio: Fix odd size access MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shinobu Uehara Current sd_ctrl_read/write16_rep() doesn't care odd size Signed-off-by: Shinobu Uehara Signed-off-by: Ryo Kataoka Signed-off-by: Kuninori Morimoto --- drivers/mmc/host/tmio_mmc_pio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index b380225..05ae15c 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -386,9 +386,11 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) /* Transfer the data */ if (data->flags & MMC_DATA_READ) - sd_ctrl_read16_rep(host, CTL_SD_DATA_PORT, buf, count >> 1); + sd_ctrl_read16_rep(host, + CTL_SD_DATA_PORT, buf, (count + 1) >> 1); else - sd_ctrl_write16_rep(host, CTL_SD_DATA_PORT, buf, count >> 1); + sd_ctrl_write16_rep(host, + CTL_SD_DATA_PORT, buf, (count + 1) >> 1); host->sg_off += count;