Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp801354ybl; Fri, 16 Aug 2019 04:20:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9tEil6RuFz5seozPV8gz6D6BXS43kRUlXDqcWxw/4mstA+jFWKpZn/mbboDFM8Uixebzg X-Received: by 2002:a17:902:b212:: with SMTP id t18mr8657565plr.246.1565954409115; Fri, 16 Aug 2019 04:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565954409; cv=none; d=google.com; s=arc-20160816; b=e3RWfHhR13xPFiEsb8qy9VWyVEjppDy6fRVY/pipcpwAXiGliCb04KTqFAwxCvPhD6 WKLNwaAafbsRicY50Vs7901GQw9QTVmH2ypLXcsQurHIDlaK7rJhA4ZHs1bJ1fR9vzHR fmE19B2zHKOnZVkNsuenzpk5GoCKi8I/Lr7Tn+Pyedx36Z4Te9X7cIx4mCjxrw8msB+D mdMOB5025F0Ol4VOAO9japd0eSPbeUIJ+9ooFgCC43vrbjOBx38ncnW4ipS+97nAdGtR 3ZlI8McUxAXOgDDb4mcwa9Zq7Vaaf0UPA+6lwmbdtZkrGxnMJikqjG5feNDuCvFM/WR2 JRkA== 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=oOj8ULj/re2QYoM6q5GNWwJqc2sbJlBtMBPT+fjHyRI=; b=s1SxVprV/mDYDmWddbQc5rlW4u/M4rXY4iYEswc0uxfooE3IiwBzgzp8vUNrBcIZK4 1RYyF8pV14l0NApYE6QPR8fixOdMElKxCc6vka11r8oIJkV34xQ3eImpkvXEap9MWBRt hWg0bj9b62ZOsFboK/crf6UJQwiIKvcmPDHS8jdaUAQpdLWFm+jWdPtzt6FW9y0yONqe 7BIUYbPBufgyTJswRmf6CuQ3Z6uwHGQuVw9zbPggdkY8yRjo7d+5gKYC5iDP6q/6i8WQ hGdiZiWo9qjUPY6EigXkENyMPDYAMpLg7QgxFXz4Ga+APyhsLp/PC7YvhCrkTDuFp9x1 Ya7g== 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 r200si3569444pgr.518.2019.08.16.04.19.51; Fri, 16 Aug 2019 04:20:09 -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 S1727196AbfHPLTB (ORCPT + 99 others); Fri, 16 Aug 2019 07:19:01 -0400 Received: from foss.arm.com ([217.140.110.172]:55214 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbfHPLS7 (ORCPT ); Fri, 16 Aug 2019 07:18:59 -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 DAA4D28; Fri, 16 Aug 2019 04:18:58 -0700 (PDT) Received: from localhost.localdomain (unknown [10.169.40.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2D3143F706; Fri, 16 Aug 2019 04:18:56 -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 2/2] drivers/dax/kmem: give a warning if CONFIG_DEV_DAX_PMEM_COMPAT is enabled Date: Fri, 16 Aug 2019 19:18:44 +0800 Message-Id: <20190816111844.87442-3-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 commit c221c0b0308f ("device-dax: "Hotplug" persistent memory for use like normal RAM") helps to add persistent memory as normal RAM blocks. But this driver doesn't work if CONFIG_DEV_DAX_PMEM_COMPAT is enabled. Here is the debugging call trace when CONFIG_DEV_DAX_PMEM_COMPAT is enabled. [ 4.443730] devm_memremap_pages+0x4b9/0x540 [ 4.443733] dev_dax_probe+0x112/0x220 [device_dax] [ 4.443735] dax_pmem_compat_probe+0x58/0x92 [dax_pmem_compat] [ 4.443737] nvdimm_bus_probe+0x6b/0x150 [ 4.443739] really_probe+0xf5/0x3d0 [ 4.443740] driver_probe_device+0x11b/0x130 [ 4.443741] device_driver_attach+0x58/0x60 [ 4.443742] __driver_attach+0xa3/0x140 Then the dax0.0 device will be registered as "nd" bus instead of "dax" bus. This causes the error as follows: root@ubuntu:~# echo dax0.0 > /sys/bus/dax/drivers/device_dax/unbind -bash: echo: write error: No such device This gives a warning to notify the user. Signed-off-by: Jia He --- drivers/dax/kmem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index ad62d551d94e..b77f0e880598 100644 --- a/drivers/dax/kmem.c +++ b/drivers/dax/kmem.c @@ -93,6 +93,11 @@ static struct dax_device_driver device_dax_kmem_driver = { static int __init dax_kmem_init(void) { + if (IS_ENABLED(CONFIG_DEV_DAX_PMEM_COMPAT)) { + pr_warn("CONFIG_DEV_DAX_PMEM_COMPAT is not compatible\n"); + pr_warn("kmem dax driver might not be workable\n"); + } + return dax_driver_register(&device_dax_kmem_driver); } -- 2.17.1