Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842Ab3ILOub (ORCPT ); Thu, 12 Sep 2013 10:50:31 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:51397 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736Ab3ILOu3 (ORCPT ); Thu, 12 Sep 2013 10:50:29 -0400 X-IronPort-AV: E=Sophos;i="4.90,891,1371081600"; d="scan'208";a="50891210" Date: Thu, 12 Sep 2013 15:44:50 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Catalin Marinas CC: Stefano Stabellini , "xen-devel@lists.xensource.com" , "Ian.Campbell@citrix.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "konrad.wilk@oracle.com" Subject: Re: [PATCH v5 11/13] xen: introduce xen_alloc/free_coherent_pages In-Reply-To: <20130912135347.GA23425@darko.cambridge.arm.com> Message-ID: References: <20130906141444.GE1946@arm.com> <20130906155928.GH1946@arm.com> <20130906162018.GJ1946@arm.com> <8492887B-2509-42B5-A5F9-A711C519D912@arm.com> <20130911093646.GA26777@darko.cambridge.arm.com> <20130912135347.GA23425@darko.cambridge.arm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1634 Lines: 39 On Thu, 12 Sep 2013, Catalin Marinas wrote: > On Wed, Sep 11, 2013 at 06:34:17PM +0100, Stefano Stabellini wrote: > > On Wed, 11 Sep 2013, Catalin Marinas wrote: > > > static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) > > > { > > > BUG_ON(!dev); > > > @@ -32,7 +39,7 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) > > > > > > static inline int dma_set_mask(struct device *dev, u64 mask) > > > { > > > - return get_dma_ops(dev)->set_dma_mask(dev, mask); > > > + return __get_dma_ops(dev)->set_dma_mask(dev, mask); > > > } > > > > > > #ifdef __arch_page_to_dma > > > > I don't understand the reason for this change though: shouldn't > > set_dma_mask go via the "default" (whatever that is), like the others? > > Under Xen, this would mean xen_dma_ops->set_dma_mask(). I thought you > want to set the default dma address. > > I can see why you may want set_dma_mask() for xen_dma_ops but in also > needs to be passed to __get_dma_ops(dev)->set_dma_ops() otherwise the > actual dma_alloc_attrs() will miss the mask (and on arm64 it does > bouncing via swiotlb). xen_dma_ops->set_dma_mask() is implemented by drivers/xen/swiotlb-xen.c:xen_swiotlb_set_dma_mask (provided by this patch series). The function takes care of setting: *dev->dma_mask = dma_mask; I think that should be enough to make dma_alloc_attrs happy. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/