From patchwork Fri Mar 11 07:30:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 627451 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2B7UPta001464 for ; Fri, 11 Mar 2011 07:30:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752499Ab1CKHaY (ORCPT ); Fri, 11 Mar 2011 02:30:24 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:52585 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030Ab1CKHaX (ORCPT ); Fri, 11 Mar 2011 02:30:23 -0500 Received: from axis700.grange (pD9EB8C3C.dip0.t-ipconnect.de [217.235.140.60]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MMYTG-1Pt03d2Ane-008IhJ; Fri, 11 Mar 2011 08:30:15 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 0001E189B86; Fri, 11 Mar 2011 08:30:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id DE588189B85; Fri, 11 Mar 2011 08:30:14 +0100 (CET) Date: Fri, 11 Mar 2011 08:30:14 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org, Chris Ball , Ian Molton Subject: [PATCH] mmc: tmio: fix address in kunmap_atomic() calls Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:w5OGCxIKBQ6GtaLWW5Spi3MAK8jLMaZRSdBBaKTF8n6 zFRLzrSIYxWl1kH0QTh41+TIGR2BaZogybo6x/ZrA6icriKDYw rRnts7fNc5g1kX21WbHxHoHyPYH343XEcUs/VjekDD2gYUDbqb GmWQ9iZWZuqENLTcd3om/MIo9PZZ/4eECrdbBBFdv/iFaZ8qDs E2rUYHPa/EwLbBS8yGy6iTksIzApGA7LIiKANOlqmQ= Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 11 Mar 2011 07:30:25 +0000 (UTC) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 986f902..32ab145 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -222,9 +222,9 @@ static char *tmio_mmc_kmap_atomic(struct scatterlist *sg, unsigned long *flags) return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; } -static void tmio_mmc_kunmap_atomic(void *virt, unsigned long *flags) +static void tmio_mmc_kunmap_atomic(struct scatterlist *sg, unsigned long *flags, void *virt) { - kunmap_atomic(virt, KM_BIO_SRC_IRQ); + kunmap_atomic(virt - sg->offset, KM_BIO_SRC_IRQ); local_irq_restore(*flags); } @@ -516,7 +516,7 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) host->sg_off += count; - tmio_mmc_kunmap_atomic(sg_virt, &flags); + tmio_mmc_kunmap_atomic(host->sg_ptr, &flags, sg_virt); if (host->sg_off == host->sg_ptr->length) tmio_mmc_next_sg(host); @@ -774,7 +774,7 @@ static void tmio_check_bounce_buffer(struct tmio_mmc_host *host) unsigned long flags; void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags); memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length); - tmio_mmc_kunmap_atomic(sg_vaddr, &flags); + tmio_mmc_kunmap_atomic(host->sg_orig, &flags, sg_vaddr); } } @@ -898,7 +898,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags); sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length); memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length); - tmio_mmc_kunmap_atomic(sg_vaddr, &flags); + tmio_mmc_kunmap_atomic(sg, &flags, sg_vaddr); host->sg_ptr = &host->bounce_sg; sg = host->sg_ptr; }