iwlwifi problem with iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()

From: Fabio Coatti
Date: Sun Jul 01 2018 - 11:43:10 EST


Hi all,
since kernel 4.17 my laptop fails to enable wireless card (04:00.0 Network
controller: Intel Corporation Wireless 8260 (rev 3a) )
with this error:

Jul 01 09:34:36 hobbes kernel: iwlwifi: probe of 0000:04:00.0 failed with error
-12

I bisected the issue to this result:
d657c5c73ca987214a6f9436e435b34fc60f332a is the first bad commit
commit d657c5c73ca987214a6f9436e435b34fc60f332a
Author: Christoph Hellwig <hch@xxxxxx>
Date: Mon Mar 19 11:38:20 2018 +0100

iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up
intel_{alloc,free}_coherent()

Use the dma_direct_*() helpers and clean up the code flow.

Tested-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Joerg Roedel <joro@xxxxxxxxxx>
Cc: Jon Mason <jdmason@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/20180319103826.12853-9-hch@xxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>

:040000 040000 9b907b7d761c6121d603c649421749ffd4e13999
2f396bd9e11c46e865a46107cd3cc9ef6f9ee6dd M drivers


By reverting this commit the card works again, tested in 4.17.3 . I've noticed
that the corresponding amd commit ( b468620f2a1dfdcfddfd6fa54367b8bcc1b51248)
has been reverted in linus tree (e16c4790de39dc861b749674c2a9319507f6f64f),
and 4.16.X stable tree iirc, but the intel one has not been reverted.

hw: Lenovo P50 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz

Please let me know if more details are needed, but CC: me as I'm not currently
subscribed to LKML.

many thanks.