From patchwork Wed Jan 16 10:32:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 1987391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CD2CE3FDD1 for ; Wed, 16 Jan 2013 10:36:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TvQIa-0001vt-3F; Wed, 16 Jan 2013 10:32:48 +0000 Received: from bedivere.hansenpartnership.com ([66.63.167.143]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TvQIW-0001va-7f for linux-arm-kernel@lists.infradead.org; Wed, 16 Jan 2013 10:32:45 +0000 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id C94DA8EE0EF; Wed, 16 Jan 2013 02:32:39 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gK0PVdnFkX_k; Wed, 16 Jan 2013 02:32:39 -0800 (PST) Received: from [153.66.254.224] (accolon.hansenpartnership.com [46.65.52.191]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 9ED1D8EE0C9; Wed, 16 Jan 2013 02:32:37 -0800 (PST) Message-ID: <1358332355.2384.11.camel@dabdike.int.hansenpartnership.com> Subject: Re: [PATCH v2 1/1] block: blk-merge: don't merge the pages with non-contiguous descriptors From: James Bottomley To: Subhash Jadavani Date: Wed, 16 Jan 2013 10:32:35 +0000 In-Reply-To: <50F64AC1.3040304@codeaurora.org> References: <1358265681-25671-1-git-send-email-subhashj@codeaurora.org> <1358266794.10591.8.camel@dabdike.int.hansenpartnership.com> <50F64AC1.3040304@codeaurora.org> X-Mailer: Evolution 3.6.2 Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130116_053244_412400_2FA0F065 X-CRM114-Status: GOOD ( 12.27 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, tj@kernel.org, asias@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, 2013-01-16 at 12:07 +0530, Subhash Jadavani wrote: > Now consider this call stack from MMC block driver (this is on the ARmv7 > based board): > [ 98.918174] [] (v7_dma_inv_range+0x30/0x48) from > [] (dma_cache_maint_page+0x1c4/0x24c) > [ 98.927819] [] (dma_cache_maint_page+0x1c4/0x24c) from > [] (___dma_page_cpu_to_dev+0x14/0x1c) > [ 98.937982] [] (___dma_page_cpu_to_dev+0x14/0x1c) from > [] (dma_map_sg+0x3c/0x114) OK, so this is showing that ARM itself is making the assumption that the pages are contiguous in the page offset map. Fix this by doing the increment via the pfn, which will do the right thing whatever the memory model. Signed-off-by: James Bottomley diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 6b2fb87..ab88c5b 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -809,7 +809,7 @@ static void dma_cache_maint_page(struct page *page, unsigned long offset, op(vaddr, len, dir); } offset = 0; - page++; + page = pfn_to_page(page_to_pfn(page) + 1); left -= len; } while (left); }