Skip to content

iommu/dma: Fix incorrect error return on iommu deferred attach

Jerry Snitselaar requested to merge jsnitsel/centos-stream-9:bz2030394 into main

Bugzilla: https://bugzilla.redhat.com/2030394

Upstream Status: kernel/git/torvalds/linux.git

Testing: Tested by storage-qe on system with mpt3sas.

''' commit ac315f96b3bd6f6b8f18f387816c7c2cc6b32e02 Author: Logan Gunthorpe logang@deltatee.com Date: Wed Oct 27 11:47:57 2021 -0600

iommu/dma: Fix incorrect error return on iommu deferred attach

scsi_dma_map() was reporting a failure during boot on an AMD machine
with the IOMMU enabled.

  scsi_dma_map failed: request for 36 bytes!

The issue was tracked down to a mistake in logic: should not return
an error if iommu_deferred_attach() returns zero.

Reported-by: Marshall Midden <marshallmidden@gmail.com>
Fixes: dabb16f67215 ("iommu/dma: return error code from iommu_dma_map_sg()")
Link: https://lore.kernel.org/all/CAD2CkAWjS8=kKwEEN4cgVNjyFORUibzEiCUA-X+SMtbo0JoMmA@mail.gmail.com
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20211027174757.119755-1-logang@deltatee.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>

(cherry picked from commit ac315f96b3bd6f6b8f18f387816c7c2cc6b32e02) '''

Cc: Myron Stowe myron.stowe@redhat.com

Cc: Alex Williamson alex.williamson@redhat.com

Cc: Donald Dutile ddutile@redhat.com

Signed-off-by: Jerry Snitselaar jsnitsel@redhat.com

Edited by Jerry Snitselaar

Merge request reports