nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] /dev/dax: fix Kconfig dependency build breakage
@ 2016-09-09 17:56 Ross Zwisler
  2016-09-09 18:14 ` Dan Williams
  0 siblings, 1 reply; 4+ messages in thread
From: Ross Zwisler @ 2016-09-09 17:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-nvdimm

The function dax_pmem_probe() in drivers/dax/pmem.c is compiled under the
CONFIG_DEV_DAX_PMEM tri-state config option.  This config option currently
only depends on CONFIG_NVDIMM_DAX, which means that the following
configuration is possible:

CONFIG_LIBNVDIMM=m
...
CONFIG_NVDIMM_DAX=y
CONFIG_DEV_DAX=y
CONFIG_DEV_DAX_PMEM=y

With this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just
meaning that we will compile drivers/nvdimm/dax_devs.c into that module.
However, dax_pmem_probe() depends on several symbols defined in
drivers/nvdimm/dax_devs.c, which results in the following build errors:

drivers/built-in.o: In function `dax_pmem_probe':
linux/drivers/dax/pmem.c:70: undefined reference to `to_nd_dax'
linux/drivers/dax/pmem.c:74: undefined reference to `nvdimm_namespace_common_probe'
linux/drivers/dax/pmem.c:80: undefined reference to `devm_nsio_enable'
linux/drivers/dax/pmem.c:81: undefined reference to `nvdimm_setup_pfn'
linux/drivers/dax/pmem.c:84: undefined reference to `devm_nsio_disable'
linux/drivers/dax/pmem.c:122: undefined reference to `to_nd_region'
drivers/built-in.o: In function `dax_pmem_init':
linux/drivers/dax/pmem.c:147: undefined reference to `__nd_driver_register'

Fix this by making CONFIG_DEV_DAX_PMEM explicitly depend on
CONFIG_LIBNVDIMM.  This prevents dax_devs.c from being built as a built-in
while its dependencies are in the libnvdimm.ko module.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 drivers/dax/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig
index cedab75..5cd9436 100644
--- a/drivers/dax/Kconfig
+++ b/drivers/dax/Kconfig
@@ -15,6 +15,7 @@ if DEV_DAX
 config DEV_DAX_PMEM
 	tristate "PMEM DAX: direct access to persistent memory"
 	depends on NVDIMM_DAX
+	depends on LIBNVDIMM
 	default DEV_DAX
 	help
 	  Support raw access to persistent memory.  Note that this
-- 
2.9.0

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] /dev/dax: fix Kconfig dependency build breakage
  2016-09-09 17:56 [PATCH] /dev/dax: fix Kconfig dependency build breakage Ross Zwisler
@ 2016-09-09 18:14 ` Dan Williams
  2016-09-12 16:15   ` [PATCH v2] " Ross Zwisler
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Williams @ 2016-09-09 18:14 UTC (permalink / raw)
  To: Ross Zwisler; +Cc: linux-kernel, linux-nvdimm

On Fri, Sep 9, 2016 at 10:56 AM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> The function dax_pmem_probe() in drivers/dax/pmem.c is compiled under the
> CONFIG_DEV_DAX_PMEM tri-state config option.  This config option currently
> only depends on CONFIG_NVDIMM_DAX, which means that the following
> configuration is possible:
>
> CONFIG_LIBNVDIMM=m
> ...
> CONFIG_NVDIMM_DAX=y
> CONFIG_DEV_DAX=y
> CONFIG_DEV_DAX_PMEM=y
>
> With this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just
> meaning that we will compile drivers/nvdimm/dax_devs.c into that module.
> However, dax_pmem_probe() depends on several symbols defined in
> drivers/nvdimm/dax_devs.c, which results in the following build errors:
>
> drivers/built-in.o: In function `dax_pmem_probe':
> linux/drivers/dax/pmem.c:70: undefined reference to `to_nd_dax'
> linux/drivers/dax/pmem.c:74: undefined reference to `nvdimm_namespace_common_probe'
> linux/drivers/dax/pmem.c:80: undefined reference to `devm_nsio_enable'
> linux/drivers/dax/pmem.c:81: undefined reference to `nvdimm_setup_pfn'
> linux/drivers/dax/pmem.c:84: undefined reference to `devm_nsio_disable'
> linux/drivers/dax/pmem.c:122: undefined reference to `to_nd_region'
> drivers/built-in.o: In function `dax_pmem_init':
> linux/drivers/dax/pmem.c:147: undefined reference to `__nd_driver_register'
>
> Fix this by making CONFIG_DEV_DAX_PMEM explicitly depend on
> CONFIG_LIBNVDIMM.  This prevents dax_devs.c from being built as a built-in
> while its dependencies are in the libnvdimm.ko module.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  drivers/dax/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig
> index cedab75..5cd9436 100644
> --- a/drivers/dax/Kconfig
> +++ b/drivers/dax/Kconfig
> @@ -15,6 +15,7 @@ if DEV_DAX
>  config DEV_DAX_PMEM
>         tristate "PMEM DAX: direct access to persistent memory"
>         depends on NVDIMM_DAX
> +       depends on LIBNVDIMM

Hmm, NVDIMM_DAX already depends on LIBNVDIMM.  I think NVDIMM_DAX just
needs to be a tristate rather than a bool.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] /dev/dax: fix Kconfig dependency build breakage
  2016-09-09 18:14 ` Dan Williams
@ 2016-09-12 16:15   ` Ross Zwisler
  2016-09-13  0:33     ` Dan Williams
  0 siblings, 1 reply; 4+ messages in thread
From: Ross Zwisler @ 2016-09-12 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-nvdimm

The function dax_pmem_probe() in drivers/dax/pmem.c is compiled under the
CONFIG_DEV_DAX_PMEM tri-state config option.  This config option currently
only depends on CONFIG_NVDIMM_DAX, a bool, which means that the following
configuration is possible:

CONFIG_LIBNVDIMM=m
...
CONFIG_NVDIMM_DAX=y
CONFIG_DEV_DAX=y
CONFIG_DEV_DAX_PMEM=y

With this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just
meaning that we will compile drivers/nvdimm/dax_devs.c into that module.
However, dax_pmem_probe() depends on several symbols defined in
drivers/nvdimm/dax_devs.c, which results in the following build errors:

drivers/built-in.o: In function `dax_pmem_probe':
linux/drivers/dax/pmem.c:70: undefined reference to `to_nd_dax'
linux/drivers/dax/pmem.c:74: undefined reference to
`nvdimm_namespace_common_probe'
linux/drivers/dax/pmem.c:80: undefined reference to `devm_nsio_enable'
linux/drivers/dax/pmem.c:81: undefined reference to `nvdimm_setup_pfn'
linux/drivers/dax/pmem.c:84: undefined reference to `devm_nsio_disable'
linux/drivers/dax/pmem.c:122: undefined reference to `to_nd_region'
drivers/built-in.o: In function `dax_pmem_init':
linux/drivers/dax/pmem.c:147: undefined reference to `__nd_driver_register'

Fix this by making NVDIMM_DAX a tristate.  DEV_DAX_PMEM depends on
NVDIMM_DAX which depends on LIBNVDIMM.  Since they are all now tristates,
if LIBNVDIMM is built as a kernel module DEV_DAX_PMEM will be as well.
This prevents dax_devs.c from being built as a built-in while its
dependencies are in the libnvdimm.ko module.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Suggested-by: Dan Williams <dan.j.williams@intel.com>
---

Change from v1:
 - Made NVDIMM_DAX a tristate instead of adding an extra dependency. (djbw)

---
 drivers/nvdimm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig
index 124c243..8b2b740 100644
--- a/drivers/nvdimm/Kconfig
+++ b/drivers/nvdimm/Kconfig
@@ -89,7 +89,7 @@ config NVDIMM_PFN
 	  Select Y if unsure
 
 config NVDIMM_DAX
-	bool "NVDIMM DAX: Raw access to persistent memory"
+	tristate "NVDIMM DAX: Raw access to persistent memory"
 	default LIBNVDIMM
 	depends on NVDIMM_PFN
 	help
-- 
2.9.0

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] /dev/dax: fix Kconfig dependency build breakage
  2016-09-12 16:15   ` [PATCH v2] " Ross Zwisler
@ 2016-09-13  0:33     ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2016-09-13  0:33 UTC (permalink / raw)
  To: Ross Zwisler; +Cc: linux-kernel, linux-nvdimm

On Mon, Sep 12, 2016 at 9:15 AM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> The function dax_pmem_probe() in drivers/dax/pmem.c is compiled under the
> CONFIG_DEV_DAX_PMEM tri-state config option.  This config option currently
> only depends on CONFIG_NVDIMM_DAX, a bool, which means that the following
> configuration is possible:
>
> CONFIG_LIBNVDIMM=m
> ...
> CONFIG_NVDIMM_DAX=y
> CONFIG_DEV_DAX=y
> CONFIG_DEV_DAX_PMEM=y
>
> With this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just
> meaning that we will compile drivers/nvdimm/dax_devs.c into that module.
> However, dax_pmem_probe() depends on several symbols defined in
> drivers/nvdimm/dax_devs.c, which results in the following build errors:
>
> drivers/built-in.o: In function `dax_pmem_probe':
> linux/drivers/dax/pmem.c:70: undefined reference to `to_nd_dax'
> linux/drivers/dax/pmem.c:74: undefined reference to
> `nvdimm_namespace_common_probe'
> linux/drivers/dax/pmem.c:80: undefined reference to `devm_nsio_enable'
> linux/drivers/dax/pmem.c:81: undefined reference to `nvdimm_setup_pfn'
> linux/drivers/dax/pmem.c:84: undefined reference to `devm_nsio_disable'
> linux/drivers/dax/pmem.c:122: undefined reference to `to_nd_region'
> drivers/built-in.o: In function `dax_pmem_init':
> linux/drivers/dax/pmem.c:147: undefined reference to `__nd_driver_register'
>
> Fix this by making NVDIMM_DAX a tristate.  DEV_DAX_PMEM depends on
> NVDIMM_DAX which depends on LIBNVDIMM.  Since they are all now tristates,
> if LIBNVDIMM is built as a kernel module DEV_DAX_PMEM will be as well.
> This prevents dax_devs.c from being built as a built-in while its
> dependencies are in the libnvdimm.ko module.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> ---
>
> Change from v1:
>  - Made NVDIMM_DAX a tristate instead of adding an extra dependency. (djbw)

Thanks, applied.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-13  0:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 17:56 [PATCH] /dev/dax: fix Kconfig dependency build breakage Ross Zwisler
2016-09-09 18:14 ` Dan Williams
2016-09-12 16:15   ` [PATCH v2] " Ross Zwisler
2016-09-13  0:33     ` Dan Williams

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).