All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] be2net breaks when dma_alloc_coherent memory is not zeroed out
@ 2015-06-02  7:22 Joerg Roedel
  0 siblings, 0 replies; only message in thread
From: Joerg Roedel @ 2015-06-02  7:22 UTC (permalink / raw)
  To: Sathya Perla, Ajit Khaparde, Padmanabh Ratnakar, Sriharsha Basavapatna
  Cc: netdev, linux-kernel

Hi,

yesterday I bisected an issue with one of my be2net adapters and AMD
IOMMU enabled. In 4.1-rc it suddenly broke and didn't initialize
anymore. It turned out that the be2net driver breaks when the memory
returned from dma_alloc_coherent is not zeroed out. I introduced that
change to the AMD IOMMU driver for v4.1, other DMA-API implementations
for x86 still zero out the memory.

The bug shows like this in dmesg:

 be2net 0000:02:00.0: FW config: function_mode=0x10003, function_caps=0x7
 be2net 0000:02:00.0: FW not responding
 be2net 0000:02:00.0: Unrecoverable Error detected in the adapter
 be2net 0000:02:00.0: Please reboot server to recover
 be2net 0000:02:00.0: UE: MPU bit set

or sometimes as:

 be2net 0000:02:00.1: Waiting for POST, 52s elapsed
 be2net 0000:02:00.1: Waiting for POST, 54s elapsed
 be2net 0000:02:00.1: Waiting for POST, 56s elapsed
 be2net 0000:02:00.1: Waiting for POST, 58s elapsed

But always the result is:

 be2net 0000:02:00.1: Emulex OneConnect(be3) initialization failed
 be2net: probe of 0000:02:00.1 failed with error -110

When the memory returned by dma_alloc_coherent is zeroed out everything
works fine.

But strictly speaking dma_alloc_coherent is not required to zero out the
memory, drivers need to call dma_zalloc_coherent when they need this. So
the behavior of the AMD IOMMU driver is correct.

Can you guys please have a look and remove the assumption that
dma_alloc_coherent returns initialized memory in the be2net driver? In
the future I'd like to optimize out this needless zeroing out of memory
from all IOMMU drivers.

Please let me know if you need further information or if I can help with
testing or anything.

Thanks,

	Joerg


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-02  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02  7:22 [BUG] be2net breaks when dma_alloc_coherent memory is not zeroed out Joerg Roedel

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.