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: 35133 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B007921457 for ; Fri, 8 Aug 2014 14:57:44 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf33200557pdb.5 for ; Fri, 08 Aug 2014 07:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:subject:in-reply-to :message-id:references:user-agent:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=/qmCSnkFwMZUUZxlVlQQQ+/LCfQ2WCOBic7VnX4J140=; b=PpQVwzusVYr1zvHXBpyFYt5N2lysuqx1z0kBaf6iqrtEJwG2q8K29CtwRUefY25j5y W8TwO6Gkt1V06E9a1skM4SyoyfZCVFwbhDu9dZDDH0a5ZFLxuG3NKRQfZi+pPNvo97Qn 6CamjjSQOb4B/1qbrUNIBXgDCpHl/HkJW0zi08/z3IurGoNu/howvktO9nTqgBwoOTg/ ICk05djNgxGwAGKf80al8B/GepDfXdoNfI4RPLPKEcmKSnIOPstACGzt5JClITDuQVvP SX/oF0mxjgUCyBf0aLruvq9ntfcSJp8ruipn734dxVZY0q46OA74YOaK/jp8qbL7e1+5 4prw== X-Gm-Message-State: ALoCoQmnrriU435vM/cY0XYRx5G8EyW9RyhygTw56mvymY6YwPd5A8KrKAJXQ4e0bJ15dO+JNBOa X-Received: by 10.67.5.71 with SMTP id ck7mr13158931pad.9.1407509864032; Fri, 08 Aug 2014 07:57:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.134 with SMTP id x6ls206569qgx.45.gmail; Fri, 08 Aug 2014 07:57:43 -0700 (PDT) X-Received: by 10.52.106.198 with SMTP id gw6mr7018729vdb.23.1407509863875; Fri, 08 Aug 2014 07:57:43 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id cz7si424931vdb.4.2014.08.08.07.57.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 07:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so8493000vcb.38 for ; Fri, 08 Aug 2014 07:57:43 -0700 (PDT) X-Received: by 10.52.163.229 with SMTP id yl5mr536499vdb.79.1407509863792; Fri, 08 Aug 2014 07:57:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp130123vcb; Fri, 8 Aug 2014 07:57:43 -0700 (PDT) X-Received: by 10.68.115.48 with SMTP id jl16mr23973895pbb.78.1407509862789; Fri, 08 Aug 2014 07:57:42 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id mo2si6249845pbc.110.2014.08.08.07.57.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Aug 2014 07:57:42 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [66.165.176.63 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.165.176.63 listed in wl.mailspike.net] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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);