linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia He <justin.he@arm.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>
Cc: Keith Busch <keith.busch@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org,
	Jia He <justin.he@arm.com>
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	[thread overview]
Message-ID: <20190816111844.87442-3-justin.he@arm.com> (raw)
In-Reply-To: <20190816111844.87442-1-justin.he@arm.com>

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 <justin.he@arm.com>
---
 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


  parent reply	other threads:[~2019-08-16 11:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16 11:18 [PATCH 0/2] Fix and support dax kmem on arm64 Jia He
2019-08-16 11:18 ` [PATCH 1/2] drivers/dax/kmem: use default numa_mem_id if target_node is invalid Jia He
2019-09-03  9:26   ` Justin He (Arm Technology China)
2019-08-16 11:18 ` Jia He [this message]
2019-08-22 18:55   ` [PATCH 2/2] drivers/dax/kmem: give a warning if CONFIG_DEV_DAX_PMEM_COMPAT is enabled Jeff Moyer
2019-08-22 19:10     ` Verma, Vishal L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190816111844.87442-3-justin.he@arm.com \
    --to=justin.he@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).