Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1721138ybg; Sat, 19 Oct 2019 01:04:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNjDdfB3VV5v/L8I9DeER9GXTXnFUqqD9tf1peypI7q19hsWaPPnbP/tWFsrIuV3480yIi X-Received: by 2002:aa7:dd0a:: with SMTP id i10mr13829531edv.189.1571472263451; Sat, 19 Oct 2019 01:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472263; cv=none; d=google.com; s=arc-20160816; b=o/C0VN/j9Z2aUR5DVxKm4m3sCt03/aa/HM8DQaUNf/gfcyD3acEZacx7WRlvdipScc 7+/ls/ENFvoVZIIAsuzXmSENwEb2Tu0v30V/O3bGdXuIS3eoGVaTGxvIm3p1GomD1oCv 8/h61ECvDULNigMWQJL7/bTB3/q1PitXZUNjnmemG0WLokMhKGOgklBddh3axJvN9xUh 8XzEcC3eVcfY9+ar5TYkUBvd3XDRGebRLjttOZwBUdlMNijjJtWFuyGG5F+V3MGOfQR7 o8EC87IizKmiyzGna+gTv1dxioRAPWdX/wBnvx010gkUT980G8iNrcv7R7wzVI5TOdtX /lGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=deyY6KZdubLrZlyuXxGQG4Lm78VESMfTBBUVeLNHCZM=; b=j5owjBJkEqwxZ22Y2Z7Ap2fcJQSV4Auv41QJqWWZsnYBsrQ4pmdjJGYJSboL2EHKwY d7Z8DfQ0qynNWpqx7ufHP7q+hBCmoFYkMwbr7V1Y6ASbM9gLNZidxGcX4YD8KUyW6p3Y XR+neSS2c2KsBgFk5AZaf6rvUwDnzBSNZmK6t8ItYuYt+hk0KB91K0M//8ZuZvhueYay ac/QUeR97gzfeB3MbemeNZx7gNk/Z1p8hUQR1DatNIv2+4T5YIa8yDh9jsk7z4mdKlM1 iGtL7pIXDn62DpdYjzk5lygcnlVRGiFlwEHmuffUnpFFyLdPtZirkQDe7LO+OjGtYUK5 aLCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si5643527edf.102.2019.10.19.01.04.00; Sat, 19 Oct 2019 01:04:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633032AbfJRJHq (ORCPT + 99 others); Fri, 18 Oct 2019 05:07:46 -0400 Received: from 8bytes.org ([81.169.241.247]:47974 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727741AbfJRJHp (ORCPT ); Fri, 18 Oct 2019 05:07:45 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id CB025300; Fri, 18 Oct 2019 11:07:43 +0200 (CEST) From: Joerg Roedel To: Joerg Roedel Cc: Qian Cai , Dan Carpenter , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH] iommu/amd: Pass gfp flags to iommu_map_page() in amd_iommu_map() Date: Fri, 18 Oct 2019 11:07:36 +0200 Message-Id: <20191018090736.18819-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel A recent commit added a gfp parameter to amd_iommu_map() to make it callable from atomic context, but forgot to pass it down to iommu_map_page() and left GFP_KERNEL there. This caused sleep-while-atomic warnings and needs to be fixed. Reported-by: Qian Cai Reported-by: Dan Carpenter Fixes: 781ca2de89ba ("iommu: Add gfp parameter to iommu_ops::map") Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 0d2479546b77..fb54df5c2e11 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2561,7 +2561,7 @@ static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova, if (iommu_prot & IOMMU_WRITE) prot |= IOMMU_PROT_IW; - ret = iommu_map_page(domain, iova, paddr, page_size, prot, GFP_KERNEL); + ret = iommu_map_page(domain, iova, paddr, page_size, prot, gfp); domain_flush_np_cache(domain, iova, page_size); -- 2.16.4