Unexpectedly dma_ops is NULL in struct device

2 messages, 2 authors, 2018-11-16 · open the first message on its own page

Unexpectedly dma_ops is NULL in struct device

From: Alexander Fomichev <hidden>
Date: 2018-11-15 11:00:06

Hello,

I tried to use Switchtec NTB on PowerPC platform and faced a strange behaviour. In ntb_hw_switchtec module's initialization section the "struct device" has uninitialized field dma_ops (NULL). Meanwhile the same NTB hardware on x86 platform get correct dma_ops in this driver. It looks like on lower layer "struct device" init differs between x86 and powerpc.
This issue makes functions dma_set_mask() and dma_set_coherent_mask() and dma_alloc_coherent() fail in ntb_hw_switchtec. And the driver can't start on powerpc.

Can anybody help to trace this issue? 
Thanks in advance.

Best regards, 
Alexander

Re: Unexpectedly dma_ops is NULL in struct device

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2018-11-16 22:57:17


On 15/11/18 03:05 AM, Alexander Fomichev wrote:
This issue makes functions dma_set_mask() and dma_set_coherent_mask() and dma_alloc_coherent() fail in ntb_hw_switchtec. And the driver can't start on powerpc.
I don't know a lot about powerpc in this area, but a quick peek shows
that dma_set_mask() does some platform specific stuff so it would
definitely help if you can let us know more about your hardware.

On one platform I looked at, it seems that dma_set_mask() sets the
dma_ops for the device, so the fact that it is NULL at that point is not
likely the issue. It's probably some platform specific bug that's
causing this.

Logan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help