Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp281005ybl; Fri, 23 Aug 2019 00:24:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTLU48fuYEcQVKt31RMmY7sQnDqH9UpOnxYYCXhKKrFJJsOR6alqI4/M4dfumFOtt72svs X-Received: by 2002:a62:f204:: with SMTP id m4mr3702228pfh.7.1566545062152; Fri, 23 Aug 2019 00:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566545062; cv=none; d=google.com; s=arc-20160816; b=d/Pa8TAtIJoDqCfC469Y/Gx67WaADeeSEoaO24tNMTVdY+3mhNyYfVCRXInIQa43W3 c+aSwvaG5VSN1hLeceSxwWSXhJ14u1t0vUct+L2L1+lREBFAsc7vy4C/YK4S60vtYAEa Uj/d5UxTbN7izijnm5Ym5+arvBwlXNE0H2WO10Z+yeZ/CtWmChE5CiW2u4/+SSGXM9Ep jCEdqpKOY7TLpZ7ECBBzkM6IzjUuisgTgTgg6pcMeI5M905ogFgNhiW8eoHSURteuIcT rZorOpDEakjlN9jMtGTlWWbqjLt7bfaZqUs6DNhw5WkNFwoID11sifEt1Fx25SbC6FM7 EU6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=R3OXPVVveHASZ0cOzBpXhsZuK+xjcA4SPo0p4TWz1uY=; b=tUWTmx48cYs4sXVA166L6g+wuS2V907bBcGu+qGNZFjcTWjDz8cdkmVchcWJwuKGoH ZuU45q8tT6gzUUZ0GlTMKbo1LJaVDB1MkBzhlyHqPN1bpPQ/xs9lAxxoiEAymfSlXDZu eCJt81ao05XDl6Cmu2nFYCknloQJfwRcZN2Kn04xoayACt88MsUwooTxdz3Qudv/Q7Zh p8Gwr9Y//6p9NDTDHGBgqZpOBvuRn2srKjyBQRjwdm4djeJnts9r5EPmL2pZB+Z2vVW2 bjdqXC8htq99yRG/M43MlrKIjBLUFB49KF6DMrd7lXdR06aUU07tT5ykACXDtd7Yajpb uY9Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e33si1662655pld.436.2019.08.23.00.24.07; Fri, 23 Aug 2019 00:24:22 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731446AbfHVS4C (ORCPT + 99 others); Thu, 22 Aug 2019 14:56:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbfHVS4B (ORCPT ); Thu, 22 Aug 2019 14:56:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B915300180E; Thu, 22 Aug 2019 18:56:01 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5F58600CD; Thu, 22 Aug 2019 18:56:00 +0000 (UTC) From: Jeff Moyer To: Jia He Cc: Dan Williams , Vishal Verma , linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [PATCH 2/2] drivers/dax/kmem: give a warning if CONFIG_DEV_DAX_PMEM_COMPAT is enabled References: <20190816111844.87442-1-justin.he@arm.com> <20190816111844.87442-3-justin.he@arm.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Thu, 22 Aug 2019 14:55:59 -0400 In-Reply-To: <20190816111844.87442-3-justin.he@arm.com> (Jia He's message of "Fri, 16 Aug 2019 19:18:44 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 22 Aug 2019 18:56:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jia He writes: > 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); > } This logic is wrong (and the error message is *very* confusing). You can have the driver configured, but not loaded. In that case, the kmem driver will load and work properly. When using daxctl to online memory, you already get the following message: libdaxctl: daxctl_dev_disable: dax0.0: error: device model is dax-class That's still not very helpful. It would be better if the message suggested a fix (like using migrate-device-model). Vishal? Cheers, Jeff