Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2384846lqp; Sun, 24 Mar 2024 17:04:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVziPaWpjDUykc9JMA8jBs+iKqHlC8vfgOA7sS2Jhv5tDsWgoSCDFJIId3O+bbGF0rWEdKJacctTrTy2+uXQ1hGPnui4Vp+paa7nf3i9g== X-Google-Smtp-Source: AGHT+IFO6dCV+SksYJpPF24zMLG0L4JohoWPKmdoyWstCkGvUjmMsZwbtPDDYGi+staIapwKTu35 X-Received: by 2002:a05:6820:2611:b0:5a2:37c9:d91f with SMTP id cy17-20020a056820261100b005a237c9d91fmr5485699oob.5.1711325067577; Sun, 24 Mar 2024 17:04:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325067; cv=pass; d=google.com; s=arc-20160816; b=zegdw61DrCZE7U9gbqEenSVHNyy4uXtVHunhtseHtBIXRhOmypxNiIL/OrJlK0ICcG xR2Ve6pZeRXj+AM2z2HQbsW2+C0A5SNyjXrU0aZ9BjgIp9QrEBUHs2+7HAuKtmZqqQre JM7b104PUjDQk7sc9FE4yLe8ZYIFYikEUQNO8TeBAkwUzWldRSWZrRrDPuEvrkxyg70v YOzFa6ozKQspXG/FjeNh8+pnHOFCt7j9bsemyoelZNYhiRe/85INyAGb+9/AH7e4Pobg 2W33ADls/8XphvlOKKVsHVVhVOD7o+c0i2r1FQpQgt4xY2ozjmSp2gC5B2LoUgqGdfsh 01Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YcIGLBZAAYIk5ixqtg2iZyU4bCAcEKPspsbbWJiCOl4=; fh=LMki3XX72BwZ8PmkdubzH4CtlQKwp8J//n1QXd4JCnQ=; b=sdiGpl6ANVpGLqsRf6plguXGK/uMIQj7uaXxa01Q/skHMtmR03OlDJM1ZybZE/dDaK 93isN9osDWE0l7eQ7VuEeA7495JAqCJGnKPhFVPgO/iF+73tdCpaSEiE9QYDdClZxFTm 2GRihs/Lk2UUN69a9HSigVW9KYXuaU9JCRR1YgWv/16g96QlmWM5BK4qnC/nU7YlbXbZ 7pfo8pgQhkuSltnOrPwe89Tyn2dK1KWhNFW8LrkCDivFXv3rygCbSbwuxaoSPe7EbWe2 dKUbZHXuBo9I4eFIhzYjxv+SX0Wl9oZE9EvjGE4makgvUEw6lwqWsww58TxmGwhi2a6N 7vUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DZajpdAo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113300-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l13-20020a05622a050d00b0042eb8d52057si4098471qtx.320.2024.03.24.17.04.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113300-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DZajpdAo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113300-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113300-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4EDB21C23448 for ; Mon, 25 Mar 2024 00:04:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 886AA190685; Sun, 24 Mar 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DZajpdAo" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 946C5190673; Sun, 24 Mar 2024 22:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320100; cv=none; b=L4rmif/WAjITv/OUMuQJoxoyE/MhzS7vfxHVu69dFUWw956FvmnSzQ+xh5nOvU9aMuReL8nJyfATqAeSbj8Fgez/OWd552PhB+zTo2PR9eJKzH4TweLqxXXeyEzCzE2KHq1eMCUsbCWYVzHPA/VtrczQrGE4c4gNzBHXtRRCOF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320100; c=relaxed/simple; bh=TlP6/AQtNqw7rwGx8wZwwQ5PsKZq/5mbyDLs6BK6zYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dKTKZXTa/dEXKZxJtI1un/M5eNGidjH5nqWEiFmk0bo2hL6anYyEK8G9coeO3pgCxLY4M3EUDe1ayPERRFJ3Qjmd3r2a07S+4JKrUVoNirZNuMjDBxuRl4pZiRiVSn0usFLVn/um7UucQXpT/i7rFuCN7c5R3RSbJLCo/DUkxsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DZajpdAo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B87E5C433B1; Sun, 24 Mar 2024 22:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320100; bh=TlP6/AQtNqw7rwGx8wZwwQ5PsKZq/5mbyDLs6BK6zYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DZajpdAoykbNCnHMIsqUTaodqw8q5CwUnj8WGZght53Fwo9LDHtAWG6oQP59ormkv YIVTwK0krC6KEo9gW2kwPdxTK1sdNTD1f41XhbnmD/g9esIPzUlJto5df6kLA0JB1i AiN3wI7bp/XvY2k1fVpyBCX8mHYmnUuijBfDuMOsigpStfuOqtJ7aBVdD7E1FDr4dp U8I3IkhGEF5qTWHMGPCP9ndaa5RaQ4WyGWHuBATd/NgqRpufAyfH+aRqn502m101ZD eWn4toqt4dY7HEJCvnvtARdNCw8zyk6dmcu8pV0nkYSP0X43Ap+4j+CldftBsOci59 68qRY98qVvfyA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Bjorn Helgaas , Logan Gunthorpe , Sasha Levin Subject: [PATCH 6.8 409/715] PCI/P2PDMA: Fix a sleeping issue in a RCU read section Date: Sun, 24 Mar 2024 18:29:48 -0400 Message-ID: <20240324223455.1342824-410-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Christophe JAILLET [ Upstream commit 1e5c66afd4a40bb7be17cb33cbb1a1085f727730 ] It is not allowed to sleep within a RCU read section, so use GFP_ATOMIC instead of GFP_KERNEL here. Link: https://lore.kernel.org/r/02d9ec4a10235def0e764ff1f5be881ba12e16e8.1704397858.git.christophe.jaillet@wanadoo.fr Fixes: ae21f835a5bd ("PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma") Signed-off-by: Christophe JAILLET Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe Signed-off-by: Sasha Levin --- drivers/pci/p2pdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 0c361561b855c..4f47a13cb500f 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -661,7 +661,7 @@ calc_map_type_and_dist(struct pci_dev *provider, struct pci_dev *client, p2pdma = rcu_dereference(provider->p2pdma); if (p2pdma) xa_store(&p2pdma->map_types, map_types_idx(client), - xa_mk_value(map_type), GFP_KERNEL); + xa_mk_value(map_type), GFP_ATOMIC); rcu_read_unlock(); return map_type; } -- 2.43.0