From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH v5 11/13] xen: introduce xen_alloc/free_coherent_pages Date: Thu, 12 Sep 2013 14:53:47 +0100 Message-ID: <20130912135347.GA23425@darko.cambridge.arm.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stefano Stabellini Cc: "konrad.wilk@oracle.com" , "xen-devel@lists.xensource.com" , "Ian.Campbell@citrix.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" List-Id: xen-devel@lists.xenproject.org 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). -- Catalin