Skip to contentSkip to conversation

linux-next: build failure after merge of the nvdimm tree

DISCUSSION Stephen Rothwell 3 participants 5 messages Apr 9, 2018 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Dan,

After merging the nvdimm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

ERROR: "of_node_to_nid" [drivers/nvdimm/of_pmem.ko] undefined!

Caused by commit

717197608952 ("libnvdimm: Add device-tree based driver")

X86 seems to not have a version of of_node_to_nid() even though CONFIG_OF and CONFIG_NUMA are both 'y' in this build.

I have used the nvdimm tree from next-20180406 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi Dan,

After merging the nvdimm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 8 lines

ERROR: "of_node_to_nid" [drivers/nvdimm/of_pmem.ko] undefined!

Caused by commit

717197608952 ("libnvdimm: Add device-tree based driver")

X86 seems to not have a version of of_node_to_nid() even though CONFIG_OF and CONFIG_NUMA are both 'y' in this build.

It's a side effect of a driver selecting CONFIG_OF accidently. There's a patch to fix this in the drm-misc-next tree:

https://lkml.org/lkml/2018/4/3/17

Quoted 1 line

I have used the nvdimm tree from next-20180406 for today.

That works too.

Oliver

#2 lore raw
Quoted 15 lines · Oliver
Quoted 5 lines · Stephen Rothwell

Hi Dan,

After merging the nvdimm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 8 lines

ERROR: "of_node_to_nid" [drivers/nvdimm/of_pmem.ko] undefined!

Caused by commit

717197608952 ("libnvdimm: Add device-tree based driver")

X86 seems to not have a version of of_node_to_nid() even though CONFIG_OF and CONFIG_NUMA are both 'y' in this build.

Quoted 8 lines

It's a side effect of a driver selecting CONFIG_OF accidently. There's a patch to fix this in the drm-misc-next tree:

https://lkml.org/lkml/2018/4/3/17

Quoted 1 line

I have used the nvdimm tree from next-20180406 for today.

That works too.

Hmm, on closer inspection this is actually a bug in the of driver. The patch above fixes the specific problem that we hit on ia64 due to CONFIG_OF being selected by accident, but the underlying issue will affect any platform that doesn't provide an implementation of of_node_to_nid().

The fundamental problem is that the various actual implementations of of_node_to_nid (ppc, sparc and the generic one in of_numa.c) export the symbol. While the fallback implementation does not because it is defined as a weak symbol. As a result we'll get this build failure iff there's a call to of_node_to_nid() in a module.

The one-line fix is just to delete the call to of_node_to_nid() in of_pmem.c. I have a patch that adds a Kconfig options and removes the weak symbol games. That needs Acks from the ppc, sparc and DT maintainers though so it'll take longer to organise.

Oliver

#3 lore raw
Quoted 37 lines · Oliver
Quoted 15 lines · Oliver
Quoted 5 lines · Stephen Rothwell

Hi Dan,

After merging the nvdimm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 8 lines

ERROR: "of_node_to_nid" [drivers/nvdimm/of_pmem.ko] undefined!

Caused by commit

717197608952 ("libnvdimm: Add device-tree based driver")

X86 seems to not have a version of of_node_to_nid() even though CONFIG_OF and CONFIG_NUMA are both 'y' in this build.

Quoted 8 lines

It's a side effect of a driver selecting CONFIG_OF accidently. There's a patch to fix this in the drm-misc-next tree:

https://lkml.org/lkml/2018/4/3/17

Quoted 1 line

I have used the nvdimm tree from next-20180406 for today.

That works too.

Hmm, on closer inspection this is actually a bug in the of driver. The patch above fixes the specific problem that we hit on ia64 due to CONFIG_OF being selected by accident, but the underlying issue will affect any platform that doesn't provide an implementation of of_node_to_nid().

The fundamental problem is that the various actual implementations of of_node_to_nid (ppc, sparc and the generic one in of_numa.c) export the symbol. While the fallback implementation does not because it is defined as a weak symbol. As a result we'll get this build failure iff there's a call to of_node_to_nid() in a module.

Quoted 4 lines

The one-line fix is just to delete the call to of_node_to_nid() in of_pmem.c. I have a patch that adds a Kconfig options and removes the weak symbol games. That needs Acks from the ppc, sparc and DT maintainers though so it'll take longer to organise.

How about just marking OF_PMEM as bool for the time being until all of these other reworks land upstream?

#4 lore raw
Quoted 38 lines · Dan Williams
Quoted 37 lines · Oliver
Quoted 15 lines · Oliver
Quoted 5 lines · Stephen Rothwell

Hi Dan,

After merging the nvdimm tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 8 lines

ERROR: "of_node_to_nid" [drivers/nvdimm/of_pmem.ko] undefined!

Caused by commit

717197608952 ("libnvdimm: Add device-tree based driver")

X86 seems to not have a version of of_node_to_nid() even though CONFIG_OF and CONFIG_NUMA are both 'y' in this build.

Quoted 8 lines

It's a side effect of a driver selecting CONFIG_OF accidently. There's a patch to fix this in the drm-misc-next tree:

https://lkml.org/lkml/2018/4/3/17

Quoted 1 line

I have used the nvdimm tree from next-20180406 for today.

That works too.

Hmm, on closer inspection this is actually a bug in the of driver. The patch above fixes the specific problem that we hit on ia64 due to CONFIG_OF being selected by accident, but the underlying issue will affect any platform that doesn't provide an implementation of of_node_to_nid().

The fundamental problem is that the various actual implementations of of_node_to_nid (ppc, sparc and the generic one in of_numa.c) export the symbol. While the fallback implementation does not because it is defined as a weak symbol. As a result we'll get this build failure iff there's a call to of_node_to_nid() in a module.

Quoted 7 lines
Quoted 4 lines

The one-line fix is just to delete the call to of_node_to_nid() in of_pmem.c. I have a patch that adds a Kconfig options and removes the weak symbol games. That needs Acks from the ppc, sparc and DT maintainers though so it'll take longer to organise.

How about just marking OF_PMEM as bool for the time being until all of these other reworks land upstream?

I went ahead and just pushed this workaround for now:

https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git/commit/?h=libnvdimm-for-next&id=291717b6fbdb175da88ae2144fc58d63a490128d