Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp917052pxb; Wed, 3 Mar 2021 20:59:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJypEqtzUcgbcFvSTk1X+ayeEhAGBGAPYOffnI/cEYK9GJhX9dYGQiY7qrpn+Q6Sv6cFexCy X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr2248833ejb.399.1614833953978; Wed, 03 Mar 2021 20:59:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614833953; cv=none; d=google.com; s=arc-20160816; b=I8NTpA5waRdn763UD0HGKrKwort+idXYuv0HN96WZh86vcMvv8zyBbytPMGyBsrOwP HWfqSlJS3pCl7CTwBmexX8F9pJcm79ZmBORBUJxUcAjOj8A9xAEZgQ/Lg7/zi4fyFaCr 6NdPDOx1eSeCrI25sHGheTX/3JMa6cGPrZL8XHZX+h5Ij2kia+9Xbsb2UCKX9rX/ZEbZ FT6wwjXek6T0qv8EUYzFtWuEeUK8h/ANDoruOiwuw7iZ+LQk59mmsfY4Ru7zGS4Z/BPv a14oRE865XWvinNkSX5Qt4PhN9VqtA9Oyd4bkQZquQ8qVR5ppYjSQnJ9oCOuZYQju+Ag buTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J+x7HUNG3W+BrQ/DVDhfFIlkILxYBiMJbFRSz5t50/0=; b=WyI0ICFDyttLqzAO11TbjKFMUUYWRZongjGSTvsQgRnP23PAFV5m9N6UKLuWComLV2 KPN0jGngFISUbVVGn2rf5cZS38wzrDdcwfJrMLb3CFHkv2K8pkknrHexfTXvkFc2+fsv +nWNzNdoT31Mhfya3wSnx7dPgS46n7QK5GibONzR7JE9HSRnYczoUmZLs5YrYP9I3+bi ChK9VzM/gWGjPq+vzpylZEecoIKvU49j8Bv+uL6J3VEMSFUiF4zBgwKKFFmOOZvBha/a eC5p/M5Ew0qRVLJQoIbVymJsqj+erX6KY5joQOWsY2+EXL5ugbqX9pC1zi93qw8af0v1 MlsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LCBiDxAl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si17966227edb.8.2021.03.03.20.58.52; Wed, 03 Mar 2021 20:59:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LCBiDxAl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233421AbhCBCYa (ORCPT + 99 others); Mon, 1 Mar 2021 21:24:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:57754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbhCATsi (ORCPT ); Mon, 1 Mar 2021 14:48:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADB6465050; Mon, 1 Mar 2021 17:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619117; bh=udoE2E4B/51s1NXDi4Y40FhUjDcDqmyoBRM4HMfIym8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LCBiDxAlelHvib58Qr0XCqup0dKmxms14E7QMoQ2SmELj0lQztQtjoWW7VpGAKbGJ vsb+AmD7WiV/LIv1lNDB03j7fzHkKtBMx7atqosX6EvxCYCDaFNL+nNHPk8iy6CGgo VXg95dPzqUcQ0np/kFFY/02uPYKDh9IWQhRDxl+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Yong Wu , Will Deacon , Joerg Roedel , Sasha Levin Subject: [PATCH 5.10 338/663] iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping Date: Mon, 1 Mar 2021 17:09:46 +0100 Message-Id: <20210301161158.572015280@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas Anderson [ 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 Reviewed-by: Yong Wu Acked-by: Will Deacon Link: https://lore.kernel.org/r/20210201170611.1.I64a7b62579287d668d7c89e105dcedf45d641063@changeid Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index a25a85a0bba5b..0d9adce6d812f 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2424,7 +2424,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); -- 2.27.0