Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp976379lqs; Wed, 6 Mar 2024 02:31:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1XeSjwZCCNxT8c8NR8cC2Aj6cQCcQcEz+0gJPOA7h7n0qrGTrkPKFkrOevv3PHqSPzZJEJ0bUrQt0v4orWA+ZgSoKVlIY4aUKLFnyqg== X-Google-Smtp-Source: AGHT+IF9aqiFKmTASC0q+9fFwQ9nGYEIgjx13eLIS9Ju3E2dqDCUlIJfIzLpQQjBB0XMDlGDEID4 X-Received: by 2002:a81:d50c:0:b0:609:8e19:387b with SMTP id i12-20020a81d50c000000b006098e19387bmr13119080ywj.2.1709721084533; Wed, 06 Mar 2024 02:31:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709721084; cv=pass; d=google.com; s=arc-20160816; b=iaSxBIRT0eZBFXd+4QtD7lmWpZkGV1HBeaEWHmL5mXj90HFCYHUZg4QBl0XvSeZ+/l hMiW48larR57o3bRUNf8ErpUMgyCfyqYy44Zf/ZfOiWCvIIimG+RniTa3XQmzHPz6Gl6 FFGTcUXz0XNUBVrem+XCRWUTVJgGupCzN2nJbw1lSEaLiEsM/YDLujDoZ2Vo+V/Ys4pf TuTLV4pHXey+NFiCBuuM/fdAL4DbsLrCENNtPzIGEZJVXSj+uxCsllJQgkC+2b50jWi2 UmzP4RleCU88rZAcdL4CN/49zb8ceTXYTHE7JNwqM7bJnwaEZBBTLiWzL5JOSnc7w8LH j7Yg== 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=y5BbRNkr/KdSy9UgwxOtt4RHBFENlawQJP+9F0EibOE=; fh=Esoboxpj5S375eVgzl7RcLquV3oq0qjVFAxEnZXMv8o=; b=OVBB9Ez/DBBDesSYq2u3cduGPUHsd6BGFVOy850RR7kQMrrt4dvJYTcbumKUvqw7bI fzIex25fyKZPnkdhxaWm3L7TZFZ0W3rB3vvWRiv6oSDoeGWts0M3QFEVygz2GUkBamxr TYQsL+4n1T3VAx8lR9+1mG+KuDbNMxUjn5BALu3Q2S8Yx1uMjsIsDJD5/pov3ULAOaeg pzd87Y16q1NS5ASmwnb94cXn3OANrU9Nv8hDsNwOJgXMzj22kRUBzBwNEthss1S3mhM1 865CrN3r3NItA78HeKQ9iJPf9uWRmpXMWySSAH9Z2UOplWmbGkThowxLILzuBR5LuVXF ZgfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@fujitsu.com header.s=fj2 header.b=T2B9GnSe; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-kernel+bounces-93764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f2-20020ac85d02000000b0042e6e396cb6si3613545qtx.373.2024.03.06.02.31.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 02:31:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93764-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 (test mode) header.i=@fujitsu.com header.s=fj2 header.b=T2B9GnSe; arc=pass (i=1 spf=pass spfdomain=fujitsu.com dkim=pass dkdomain=fujitsu.com dmarc=pass fromdomain=fujitsu.com); spf=pass (google.com: domain of linux-kernel+bounces-93764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=fujitsu.com 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 05D8D1C2131F for ; Wed, 6 Mar 2024 10:31:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A727160B9B; Wed, 6 Mar 2024 10:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b="T2B9GnSe" Received: from esa4.hc1455-7.c3s2.iphmx.com (esa4.hc1455-7.c3s2.iphmx.com [68.232.139.117]) (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 AC1B26086E; Wed, 6 Mar 2024 10:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.139.117 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721028; cv=none; b=VfxgMsqLeYTuUT+S3YWUi3rH7zgRxVZQIdsTXvrpOF2J8H6KT+ASKBkMVzWL6WUq4jKa2aYJOIU93+XOqT6+Qx2MxRT84RekScPazdiMO6NtGu86Il1ePnDPvLlC8FootHC1pwxS58cM+9mZzOQVUtmMqFUu6CFYHHKuolTaEsI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721028; c=relaxed/simple; bh=ZZY/OmJnWGlv4sXJ9ctR7zLIBkL6jlFxWOynKDfrnCI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B8+1lryIPDqSL5mClX5lNhuprzmp0Y0nfRo3Uqrlk62U58d58/Uuge5qxVTgO4GUKAQAiU3FTzcxrKtqDqFQ/2lrjeHz4VFTXuHjwhcllRjgW/1MmBgRu5VQ13+VxWl3/RxtoLDhkAeDA79oJTqqDgNwTj8bivgb97nGAKOXILs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fujitsu.com; spf=pass smtp.mailfrom=fujitsu.com; dkim=pass (2048-bit key) header.d=fujitsu.com header.i=@fujitsu.com header.b=T2B9GnSe; arc=none smtp.client-ip=68.232.139.117 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj2; t=1709721026; x=1741257026; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZZY/OmJnWGlv4sXJ9ctR7zLIBkL6jlFxWOynKDfrnCI=; b=T2B9GnSeb85UdGtzWKDyox6Dtkl+rX8uFeJKgr9LtGFandWmQzdRG2PW vv/1C7vCqx5cXXfifQi4FXmnsheFdCJL4qRdgVGC883DKvJJmsaN70QlU VnzCq8z3nq3oYoAWCXg6mr7M3smvrAYZ0YsanQ0L8qHDKCSgrRPq75Jj9 M8ObLQ8gjOPe0yDrGukkhDZ/012StW7yjU3e6oOI4rlrhyazbJTasXfXj WWprqB9yA/z+en5Du5dYS9TfbrkFWk7DkBy9JiRyM/nY6eJyYrrqecbrA r2irn/0XHnaIe8JxFE45UatpG0yGlgWKd3yURHyLbdVh7lLk4Mz39wvjH A==; X-IronPort-AV: E=McAfee;i="6600,9927,11004"; a="151690186" X-IronPort-AV: E=Sophos;i="6.06,208,1705330800"; d="scan'208";a="151690186" Received: from unknown (HELO oym-r2.gw.nic.fujitsu.com) ([210.162.30.90]) by esa4.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 19:29:14 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id 111A5EB462; Wed, 6 Mar 2024 19:29:11 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 3D8F5BF3C9; Wed, 6 Mar 2024 19:29:10 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id 9BBCD2030C7E9; Wed, 6 Mar 2024 19:29:09 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id A5E001A006A; Wed, 6 Mar 2024 18:29:08 +0800 (CST) From: Li Zhijian To: linux-kernel@vger.kernel.org Cc: y-goto@fujitsu.com, Alison Schofield , Andrew Morton , Baoquan He , Borislav Petkov , Dan Williams , Dave Hansen , Dave Jiang , Greg Kroah-Hartman , hpa@zytor.com, Ingo Molnar , Ira Weiny , Thomas Gleixner , Vishal Verma , linux-cxl@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, x86@kernel.org, kexec@lists.infradead.org, Li Zhijian Subject: [PATCH v3 4/7] dax: pmem: assign a parent resource for vmemmap region for the devdax Date: Wed, 6 Mar 2024 18:28:43 +0800 Message-Id: <20240306102846.1020868-5-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240306102846.1020868-1-lizhijian@fujitsu.com> References: <20240306102846.1020868-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28234.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28234.006 X-TMASE-Result: 10--5.083400-10.000000 X-TMASE-MatchedRID: Q3OJUoK6MKVXk4HjwySOxykMR2LAnMRpFInyGi5rPwK4GyTmeN+AbD13 GoPFA1HFIvrftAIhWmLy9zcRSkKatS9AD6DbcToHEVuC0eNRYvKZIt4iAQN6P6oDeu6wu7bqj26 lKB/EzKHoHOpl9ZcDR4Ay6p60ZV62fJ5/bZ6npdg7AFczfjr/7Cf8pL7Z+mamZiZ008tHBX0M7U m3uTFNcAFzvFI3lI92rZlDJo+ExYU= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 When the pmem is configured as devdax, set the vmemmap region as a child of the namespace region so that it can be registered as a separate resource later. CC: Dan Williams CC: Vishal Verma CC: Dave Jiang CC: Baoquan He CC: nvdimm@lists.linux.dev CC: linux-cxl@vger.kernel.org Signed-off-by: Li Zhijian --- drivers/dax/pmem.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c index f3c6c67b8412..6ffeb81e6c7c 100644 --- a/drivers/dax/pmem.c +++ b/drivers/dax/pmem.c @@ -21,6 +21,7 @@ static struct dev_dax *__dax_pmem_probe(struct device *dev) struct nd_dax *nd_dax = to_nd_dax(dev); struct nd_pfn *nd_pfn = &nd_dax->nd_pfn; struct nd_region *nd_region = to_nd_region(dev->parent); + struct resource *parent; ndns = nvdimm_namespace_common_probe(dev); if (IS_ERR(ndns)) @@ -39,8 +40,9 @@ static struct dev_dax *__dax_pmem_probe(struct device *dev) pfn_sb = nd_pfn->pfn_sb; offset = le64_to_cpu(pfn_sb->dataoff); nsio = to_nd_namespace_io(&ndns->dev); - if (!devm_request_mem_region(dev, nsio->res.start, offset, - dev_name(&ndns->dev))) { + parent = devm_request_mem_region(dev, nsio->res.start, offset, + dev_name(&ndns->dev)); + if (!parent) { dev_warn(dev, "could not reserve metadata\n"); return ERR_PTR(-EBUSY); } @@ -66,6 +68,8 @@ static struct dev_dax *__dax_pmem_probe(struct device *dev) .memmap_on_memory = false, }; + pgmap_parent_resource(&pgmap, parent); + return devm_create_dev_dax(&data); } -- 2.29.2