Subject: Re: [RFC PATCH] powerpc: fix get_arch_dma_ops() for NTB devices

From: Christoph Hellwig <[email-masked]>
Date: Mon, 4 Feb 2019 09:17:52 +0100

On Wed, Jan 30, 2019 at 11:58:40PM +1100, Michael Ellerman wrote:
> Alexander Fomichev <[email-masked]> writes:
> 
> > get_dma_ops() falls into arch-dependant get_arch_dma_ops(), which
> > historically returns NULL on PowerPC. Therefore dma_set_mask() fails.
> > This affects Switchtec (and probably other) NTB devices, that they fail
> > to initialize.
> 
> What's an NTB device?
> 
> drivers/ntb I assume?
> 
> So it's a PCI device of some sort, but presumably the device you're
> calling dma_set_mask() on is an NTB device not a PCI device?
> 
> But then it works if you tell it to use the PCI DMA ops?
> 
> At the very least the code should be checking for the NTB bus type and
> only returning the PCI ops in that specific case, not for all devices.

Can you provide the context?  E.g. the patch and the rest of the commit
log.  This all looks rather odd to me.