]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "iommu/amd_iommu: Use CONFIG_DMA_DIRECT_OPS=y and dma_direct_{alloc,free}()"
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 11 Jun 2018 19:22:12 +0000 (12:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 11 Jun 2018 19:22:12 +0000 (12:22 -0700)
commit42b64513d9556f6fc549273091a7418fd97f0d9f
treeff59a163d1640813e6f2fc461888aa4167c2c282
parent5aff26e00eb499bbf84ddaf8e0a0e89ad83856bb
Revert "iommu/amd_iommu: Use CONFIG_DMA_DIRECT_OPS=y and dma_direct_{alloc,free}()"

This reverts commit 5032bb6dc662b5982830ad2bd0a29fdd20593b87.

It turns out that this broke drm on AMD platforms. Quoting Gabriel C:
 "I can confirm reverting 5032bb6dc662b5982830ad2bd0a29fdd20593b87 fixes
  that issue for me.

  The GPU is working fine with SME enabled.

  Now with working GPU :) I can also confirm performance is back to
  normal without doing any other workarounds"

Christan König analyzed it partially:
 "As far as I analyzed it we now get an -ENOMEM from dma_alloc_attrs()
  in drivers/gpu/drm/ttm/ttm_page_alloc_dma.c when IOMMU is enabled"

and Christoph Hellwig responded:
 "I think the prime issue is that dma_direct_alloc respects the dma
  mask. Which we don't need if actually using the iommu. This would be
  mostly harmless exept for the the SEV bit high in the address that
  makes the checks fail.

  For now I'd say revert this commit for 4.17/4.18-rc and I'll look into
  addressing these issues properly"

Reported-and-bisected-by: Gabriel C <nix.or.die@gmail.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Christian König <christian.koenig@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org # v4.17
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/iommu/Kconfig
drivers/iommu/amd_iommu.c