/dev/dax: fix Kconfig dependency build breakage
PATCH 1/1 /dev/dax: fix Kconfig dependency build breakage
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=yCONFIG_DEV_DAX=yCONFIG_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.
--- drivers/dax/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/dax/Kconfig +1 -0
@@ -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
Signature · 6 lines
2.9.0 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 40 lines · Ross Zwisler
The function
dax_pmem_probe()indrivers/dax/pmem.cis compiled under theCONFIG_DEV_DAX_PMEMtri-state config option. This config option currently only depends onCONFIG_NVDIMM_DAX, which means that the following configuration is possible:
CONFIG_LIBNVDIMM=m
...CONFIG_NVDIMM_DAX=yCONFIG_DEV_DAX=yCONFIG_DEV_DAX_PMEM=yWith this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just meaning that we will compile
drivers/nvdimm/dax_devs.cinto that module. However,dax_pmem_probe()depends on several symbols defined indrivers/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 toto_nd_dax' linux/drivers/dax/pmem.c:74: undefined reference tonvdimm_namespace_common_probe'linux/drivers/dax/pmem.c:80: undefined reference todevm_nsio_enable' linux/drivers/dax/pmem.c:81: undefined reference tonvdimm_setup_pfn'linux/drivers/dax/pmem.c:84: undefined reference todevm_nsio_disable' linux/drivers/dax/pmem.c:122: undefined reference toto_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_PMEMexplicitly depend onCONFIG_LIBNVDIMM. This preventsdax_devs.cfrom being built as a built-in while its dependencies are in the libnvdimm.ko module.Signed-off-by Ross Zwisler <[email protected]>--- drivers/dax/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/dax/Kconfig +0
-0
drivers/dax/Kconfig if DEV_DAX · line 18
Quoted 4 lines
drivers/dax/Kconfig +1
-0@@ -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
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH v2 1/1 /dev/dax: fix Kconfig dependency build breakage
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=yCONFIG_DEV_DAX=yCONFIG_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.
---
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(-)
drivers/nvdimm/Kconfig +1 -1
@@ -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
Signature · 6 lines
2.9.0 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 33 lines · Ross Zwisler
The function
dax_pmem_probe()indrivers/dax/pmem.cis compiled under theCONFIG_DEV_DAX_PMEMtri-state config option. This config option currently only depends onCONFIG_NVDIMM_DAX, a bool, which means that the following configuration is possible:
CONFIG_LIBNVDIMM=m
...CONFIG_NVDIMM_DAX=yCONFIG_DEV_DAX=yCONFIG_DEV_DAX_PMEM=yWith this config LIBNVDIMM is compiled as a module with NVDIMM_DAX=y just meaning that we will compile
drivers/nvdimm/dax_devs.cinto that module. However,dax_pmem_probe()depends on several symbols defined indrivers/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 toto_nd_dax' linux/drivers/dax/pmem.c:74: undefined reference tonvdimm_namespace_common_probe'linux/drivers/dax/pmem.c:80: undefined reference todevm_nsio_enable' linux/drivers/dax/pmem.c:81: undefined reference tonvdimm_setup_pfn'linux/drivers/dax/pmem.c:84: undefined reference todevm_nsio_disable' linux/drivers/dax/pmem.c:122: undefined reference toto_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_DAXa tristate.DEV_DAX_PMEMdepends onNVDIMM_DAXwhich depends on LIBNVDIMM. Since they are all now tristates, if LIBNVDIMM is built as a kernel moduleDEV_DAX_PMEMwill be as well. This preventsdax_devs.cfrom being built as a built-in while its dependencies are in the libnvdimm.ko module.
Quoted 6 lines
Signed-off-by Ross Zwisler <[email protected]>Suggested-by Dan Williams <[email protected]>---
Change from v1:
- MadeNVDIMM_DAXa tristate instead of adding an extra dependency. (djbw)
Thanks, applied.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm