All of lore.kernel.org
 help / color / mirror / Atom feed
* dma_alloc_coherent bug in latest ntb_tool changes
@ 2018-06-07 23:10 Logan Gunthorpe
  2018-06-07 23:17 ` Dave Jiang
  0 siblings, 1 reply; 8+ messages in thread
From: Logan Gunthorpe @ 2018-06-07 23:10 UTC (permalink / raw)
  To: linux-ntb, Jon Mason, Serge Semin, Dave Jiang, Allen Hubbe

Hey,

I'm just running ntb_test on recent kernels with switchtec hardware and
found that ntb_tool and ntb_perf no longer work. I get this kernel warning:

[   64.077406] WARNING: CPU: 3 PID: 2231 at
./include/linux/dma-mapping.h:516 tool_mw_trans_write+0x16d/0x332 [ntb_tool]

Indicating that the dma_coherent mask is not set on the device. (Not
sure how much testing that patch set got before it was merged upstream...)

It seems one of the changes that slipped through is that it now
allocates DMA memory using the NTB struct device instead of the PCI
struct device that was used before the patchset.

Seeing nothing in the NTB tree sets the coherent mask on the NTB device
we get a warning and fail to allocate DMA-able memory.

I'm not sure the proper fix here: should we be using the NTB device for
DMA operations or roll back to using the PCI device? It seems cleaner to
use the NTB device but then we at least have to set the coherent_mask to
something sane (probably safe to set it to 64bits for NTB hardware).
However, I'm not sure if, for all arches, DMA ops depend on anything in
the device besides the mask.

Logan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-08  0:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 23:10 dma_alloc_coherent bug in latest ntb_tool changes Logan Gunthorpe
2018-06-07 23:17 ` Dave Jiang
2018-06-07 23:57   ` Serge Semin
2018-06-08  0:05     ` Logan Gunthorpe
2018-06-08  0:24       ` Serge Semin
2018-06-08  0:33         ` Logan Gunthorpe
2018-06-08  0:54           ` Serge Semin
2018-06-08  0:04   ` Serge Semin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.