From patchwork Fri Aug 8 14:54:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 4696651 Return-Path: X-Original-To: patchwork-linux-arm@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 B372DC0338 for ; Fri, 8 Aug 2014 14:58:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E95FE20173 for ; Fri, 8 Aug 2014 14:58:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22D702015E for ; Fri, 8 Aug 2014 14:58:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XFlaY-0000Hx-5s; Fri, 08 Aug 2014 14:56:14 +0000 Received: from smtp02.citrix.com ([66.165.176.63]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XFlaV-0008WL-GA for linux-arm-kernel@lists.infradead.org; Fri, 08 Aug 2014 14:56:12 +0000 X-IronPort-AV: E=Sophos;i="5.01,825,1400025600"; d="scan'208";a="160701263" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 8 Aug 2014 10:55:49 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XFla8-0008Cs-SS; Fri, 08 Aug 2014 15:55:48 +0100 Date: Fri, 8 Aug 2014 15:54:34 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Thomas Leonard Subject: Re: [PATCH v3 2/3] xen/arm: reimplement xen_dma_unmap_page & friends In-Reply-To: Message-ID: References: <1406904984-16068-2-git-send-email-stefano.stabellini@eu.citrix.com> <20140808143851.GF29341@zion.uk.xensource.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140808_075611_724677_C2D02806 X-CRM114-Status: GOOD ( 15.73 ) X-Spam-Score: -3.0 (---) Cc: "xen-devel@lists.xensource.com" , Wei Liu , Ian Campbell , Stefano Stabellini , Julien Grall , david.vrabel@citrix.com, v1ne2go@gmail.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, 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 On Fri, 8 Aug 2014, Thomas Leonard wrote: > On 8 August 2014 15:38, Wei Liu wrote: > > On Fri, Aug 08, 2014 at 03:32:41PM +0100, Stefano Stabellini wrote: > >> On Fri, 1 Aug 2014, Stefano Stabellini wrote: > >> > +static void __xen_dma_page_dev_to_cpu(struct device *hwdev, dma_addr_t handle, > >> > + size_t size, enum dma_data_direction dir) > >> > +{ > >> > + /* Cannot use __dma_page_dev_to_cpu because we don't have a > >> > + * struct page for handle */ > >> > + > >> > + if (dir == DMA_TO_DEVICE) > >> > >> This should be: > >> if (dir != DMA_TO_DEVICE) > >> > >> Thomas, could you please confirm that with this small fix > >> http://pastebin.com/FPRf7pgL goes away? > >> > > > > Thomas, please try this fix with my ref-counting patch. > > > > The old "working" version might actually cover this latent bug due to > > it's long delay. > > I'm not sure how to apply this. The function > "__xen_dma_page_dev_to_cpu" doesn't appear in your "for-thomas" > branch. If you push the change to that branch I can test it. That's the patch for you: diff --git a/arch/arm/xen/mm32.c b/arch/arm/xen/mm32.c index 534f362..3b99860 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -131,7 +131,7 @@ static void __xen_dma_page_dev_to_cpu(struct device *hwdev, dma_addr_t handle, /* Cannot use __dma_page_dev_to_cpu because we don't have a * struct page for handle */ - if (dir == DMA_TO_DEVICE) + if (dir != DMA_TO_DEVICE) outer_inv_range(handle, handle + size); dma_cache_maint(handle & PAGE_MASK, handle & ~PAGE_MASK, size, dir, dmac_unmap_area);