Re: v5.15-rc7 AMD no kernel dump, spews "scsi_dma_map failed: request for 36 bytes!"

From: Logan Gunthorpe
Date: Wed Oct 27 2021 - 12:41:56 EST


Hi,

On 2021-10-27 10:08 a.m., Marshall Midden wrote:
> v5.15-rc7 AMD no kernel dump, spews "scsi_dma_map failed: request for 36 bytes!"
>
> With v5.15-rc (1 through 7), AMD processor kernel crash dumps do not occur,
> instead spews:
> "scsci_dma_map failed: request for 36 bytes!"
> Works on Intel machines, and in v5.14.0 (and v5.14.14) - as well as previous
> kernels (down to v5.3.x.)
> git bisect torvalds repository shows: dabb16f67215918c48cf3ff1fc4bc36ca421da2b
> Reverse patch to tag v5.15-rc7 allows kernel crash dumps to occur/happen.
>

On careful review I think I see what might be causing this. Can you
please try the following patch?

Thanks,

Logan

--

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index cd0f1a593997..3bfb5da87802 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -1028,7 +1028,8 @@ static int iommu_dma_map_sg(struct device *dev,
struct sc>

if (static_branch_unlikely(&iommu_deferred_attach_enabled)) {
ret = iommu_deferred_attach(dev, domain);
- goto out;
+ if (ret)
+ goto out;
}

if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))