Re: 2.6.12-rc4-mm2 build failure

From: Matthew Dobson
Date: Tue May 17 2005 - 19:10:54 EST


Christoph Lameter wrote:
> On Mon, 16 May 2005, Martin J. Bligh wrote:
>
>
>>ppc64 box
>>
>>drivers/ide/ide-probe.c: In function `ide_init_queue':
>>drivers/ide/ide-probe.c:982: warning: implicit declaration of function `pcibus_to_node'
>>drivers/ide/ide-disk.c: In function `ide_disk_probe':
>>drivers/ide/ide-disk.c:1225: warning: implicit declaration of function `pcibus_to_node'
>>drivers/built-in.o(.text+0xaee4c): In function `.init_irq':
>>: undefined reference to `.pcibus_to_node'
>>drivers/built-in.o(.text+0xaf01c): In function `.init_irq':
>>: undefined reference to `.pcibus_to_node'
>>drivers/built-in.o(.text+0xb7808): In function `.ide_disk_probe':
>>: undefined reference to `.pcibus_to_node'
>>make: *** [.tmp_vmlinux1] Error 1
>>05/16/05-07:36:03 Build the kernel. Failed rc = 2
>>05/16/05-07:36:03 build: kernel build Failed rc = 1
>
>
> There was a prior discussion with the ppc64 folks about the way that
> asm-generic/topology.h was included only for CONFIG_NUMA. I thought that
> was fixed?
>
> asm-generic/topology.h must also be included if CONFIG_NUMA is not set
> inorder to provide the fall back pcibus_to_node function.
>
> patch follows. Cannot test since I do not have a ppc64.
>
> Index: linux-2.6.12-rc4/include/asm-ppc64/topology.h
> ===================================================================
> --- linux-2.6.12-rc4.orig/include/asm-ppc64/topology.h 2005-03-01 23:38:32.000000000 -0800
> +++ linux-2.6.12-rc4/include/asm-ppc64/topology.h 2005-05-16 16:06:24.000000000 -0700
> @@ -59,10 +59,8 @@
> .nr_balance_failed = 0, \
> }
>
> -#else /* !CONFIG_NUMA */
> +#endif /* CONFIG_NUMA */
>
> #include <asm-generic/topology.h>
>
> -#endif /* CONFIG_NUMA */
> -
> #endif /* _ASM_PPC64_TOPOLOGY_H */

Not a big fan of this patch. It's not wrong, per-se, but it just doesn't
sit right with me. asm-generic/topology.h should be a fallback file for
the arches that just want some sort of sane UP/SMP defaults. The better
(IMHO) solution is this patch. Builds fine on PPC64.

-Matt
--- linux-2.6.12-rc4-mm1/include/asm-ppc64/topology.h 2005-05-12 11:15:46.000000000 -0700
+++ linux-2.6.12-rc4-mm1/include/asm-ppc64/topology.h.fixed 2005-05-17 15:40:40.630853728 -0700
@@ -33,6 +33,8 @@ static inline int node_to_first_cpu(int
return first_cpu(tmp);
}

+#define pcibus_to_node(bus) (-1)
+
#define pcibus_to_cpumask(bus) (cpu_online_map)

#define nr_cpus_node(node) (nr_cpus_in_node[node])