Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp801119ybl; Fri, 16 Aug 2019 04:19:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3XrGECzOR7o6/ICN9UIvRHOL1rTBNiZSfEaIV5AP5haDnx0XZrNtkHyv2D2zVCLDqFhYF X-Received: by 2002:a17:902:be03:: with SMTP id r3mr8948810pls.156.1565954394218; Fri, 16 Aug 2019 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565954394; cv=none; d=google.com; s=arc-20160816; b=FyObZe/jYoChEMayX6FLurnr+zV83ClNyS9DKO5kM6uBApuzqPhzx0DuckQ10S5EiN tTOeoEREH9/6dsCfpNKijGVljEjeqkCTt1ApWdLJvhODnP99dZHMMau1qBaZenleNWmA 2xf++9KTGybN1cMt2yOAhqhVSqh8emMBlSTHiz/O44g42v8kxYI/UIQupWQQs1UBj5jI tlT1ESzS0Y2dEW7zVGC3gCe8ue8LXoOVIDZWtX/8V4eqKTcdKEAc5d/jWuGmkmxy9tEP M45hOtPx+zQ6iHBVnBT6AoZJ3wxq2875JKKltbRzG6YXuXFX2VSFnVWfxXj4jjBAVXCm K2SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=108ECanwPO1KTjzr0g92aqOyOpoUYc+APavIyDyogRo=; b=PdwT3j+GKpo5vB6PCFYPbBjdUxJuf+Ep7D0rkDKE2h2q7PPio2TiqahzEmZozUQkEO v2qiD3IgIE63gE8JZoW417KPcr3NZWsa1N3GqYIC8JSCQYywYf/O5hS/9FHphyhVtxi8 VQixp/OdZ89BseTzY2nC7n01hi1+dDpxlnhR1rZi9u8RKTtBGga/26YRkID+/b8fVu9a mSXM6hUtRTBTXQRCHy4e7TvQHEddLRRvyiB0LKjIWSEfDQrgV4vKOJGBBWZZnmKasBv8 MLe0EeNDb8bRLoQzIEXl1qHuMnlA92nosE9XbbLucHzWeaztS6ppZXCraFW7sezmDcsT OcRg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si3580113pfc.227.2019.08.16.04.19.36; Fri, 16 Aug 2019 04:19:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727199AbfHPLS6 (ORCPT + 99 others); Fri, 16 Aug 2019 07:18:58 -0400 Received: from foss.arm.com ([217.140.110.172]:55206 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbfHPLS5 (ORCPT ); Fri, 16 Aug 2019 07:18:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C706C360; Fri, 16 Aug 2019 04:18:56 -0700 (PDT) Received: from localhost.localdomain (unknown [10.169.40.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 09FE13F706; Fri, 16 Aug 2019 04:18:54 -0700 (PDT) From: Jia He To: Dan Williams , Vishal Verma Cc: Keith Busch , Dave Jiang , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Jia He Subject: [PATCH 1/2] drivers/dax/kmem: use default numa_mem_id if target_node is invalid Date: Fri, 16 Aug 2019 19:18:43 +0800 Message-Id: <20190816111844.87442-2-justin.he@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190816111844.87442-1-justin.he@arm.com> References: <20190816111844.87442-1-justin.he@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some platforms(e.g arm64 guest), the NFIT info might not be ready. Then target_node might be -1. But if there is a default numa_mem_id(), we can use it to avoid unnecessary fatal EINVL error. devm_memremap_pages() also uses this logic if nid is invalid, we can keep the same page with it. Signed-off-by: Jia He --- drivers/dax/kmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index a02318c6d28a..ad62d551d94e 100644 --- a/drivers/dax/kmem.c +++ b/drivers/dax/kmem.c @@ -33,9 +33,9 @@ int dev_dax_kmem_probe(struct device *dev) */ numa_node = dev_dax->target_node; if (numa_node < 0) { - dev_warn(dev, "rejecting DAX region %pR with invalid node: %d\n", - res, numa_node); - return -EINVAL; + dev_warn(dev, "DAX %pR with invalid node, assume it as %d\n", + res, numa_node, numa_mem_id()); + numa_node = numa_mem_id(); } /* Hotplug starting at the beginning of the next block: */ -- 2.17.1