Patch "iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iommu-properly-pass-gfp_t-in-_iommu_map-to-avoid-ato.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4dfc613f58a191c45caf190d903cbcf2205259ef
Author: Douglas Anderson <dianders@xxxxxxxxxxxx>
Date:   Mon Feb 1 17:06:23 2021 -0800

    iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping
    
    [ Upstream commit b8437a3ef8c485903d05d1f261328aaf0c0a6cc2 ]
    
    Sleeping while atomic = bad.  Let's fix an obvious typo to try to avoid it.
    
    The warning that was seen (on a downstream kernel with the problematic
    patch backported):
    
     BUG: sleeping function called from invalid context at mm/page_alloc.c:4726
     in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 9, name: ksoftirqd/0
     CPU: 0 PID: 9 Comm: ksoftirqd/0 Not tainted 5.4.93-12508-gc10c93e28e39 #1
     Call trace:
      dump_backtrace+0x0/0x154
      show_stack+0x20/0x2c
      dump_stack+0xa0/0xfc
      ___might_sleep+0x11c/0x12c
      __might_sleep+0x50/0x84
      __alloc_pages_nodemask+0xf8/0x2bc
      __arm_lpae_alloc_pages+0x48/0x1b4
      __arm_lpae_map+0x124/0x274
      __arm_lpae_map+0x1cc/0x274
      arm_lpae_map+0x140/0x170
      arm_smmu_map+0x78/0xbc
      __iommu_map+0xd4/0x210
      _iommu_map+0x4c/0x84
      iommu_map_atomic+0x44/0x58
      __iommu_dma_map+0x8c/0xc4
      iommu_dma_map_page+0xac/0xf0
    
    Fixes: d8c1df02ac7f ("iommu: Move iotlb_sync_map out from __iommu_map")
    Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
    Reviewed-by: Yong Wu <yong.wu@xxxxxxxxxxxx>
    Acked-by: Will Deacon <will@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210201170611.1.I64a7b62579287d668d7c89e105dcedf45d641063@changeid
    Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index c304a6a30d42e..fd5f59373fc62 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -2441,7 +2441,7 @@ static int _iommu_map(struct iommu_domain *domain, unsigned long iova,
 	const struct iommu_ops *ops = domain->ops;
 	int ret;
 
-	ret = __iommu_map(domain, iova, paddr, size, prot, GFP_KERNEL);
+	ret = __iommu_map(domain, iova, paddr, size, prot, gfp);
 	if (ret == 0 && ops->iotlb_sync_map)
 		ops->iotlb_sync_map(domain);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux