* [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27
@ 2022-03-19 9:40 Feiyang Chen
2022-03-19 13:12 ` Huacai Chen
2022-03-24 8:51 ` Thomas Bogendoerfer
0 siblings, 2 replies; 3+ messages in thread
From: Feiyang Chen @ 2022-03-19 9:40 UTC (permalink / raw)
To: tsbogend
Cc: Feiyang Chen, chenhuacai, jiaxun.yang, tangyouling,
chris.chenfeiyang, linux-mips
Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error
when CONFIG_NUMA=y:
mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
(.init.text+0x1714): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data'
Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error:
mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data'
Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
---
arch/mips/Kconfig | 5 +++++
arch/mips/loongson64/numa.c | 10 ++++++++++
arch/mips/sgi-ip27/ip27-memory.c | 10 ++++++++++
3 files changed, 25 insertions(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 0dae5f1e61cc..de3b32a507d2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -513,6 +513,7 @@ config MACH_LOONGSON64
select USE_OF
select BUILTIN_DTB
select PCI_HOST_GENERIC
+ select HAVE_ARCH_NODEDATA_EXTENSION if NUMA
help
This enables the support of Loongson-2/3 family of machines.
@@ -709,6 +710,7 @@ config SGI_IP27
select WAR_R10000_LLSC
select MIPS_L1_CACHE_SHIFT_7
select NUMA
+ select HAVE_ARCH_NODEDATA_EXTENSION
help
This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
workstations. To compile a Linux kernel that runs on these, say Y
@@ -2708,6 +2710,9 @@ config NUMA
config SYS_SUPPORTS_NUMA
bool
+config HAVE_ARCH_NODEDATA_EXTENSION
+ bool
+
config RELOCATABLE
bool "Relocatable kernel"
depends on SYS_SUPPORTS_RELOCATABLE
diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
index e8e3e48c5333..69a533148efd 100644
--- a/arch/mips/loongson64/numa.c
+++ b/arch/mips/loongson64/numa.c
@@ -197,3 +197,13 @@ void __init prom_init_numa_memory(void)
prom_meminit();
}
EXPORT_SYMBOL(prom_init_numa_memory);
+
+pg_data_t * __init arch_alloc_nodedata(int nid)
+{
+ return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
+}
+
+void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
+{
+ __node_data[nid] = pgdat;
+}
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index adc2faeecf7c..f79c48393716 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -422,3 +422,13 @@ void __init mem_init(void)
memblock_free_all();
setup_zero_pages(); /* This comes from node 0 */
}
+
+pg_data_t * __init arch_alloc_nodedata(int nid)
+{
+ return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
+}
+
+void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
+{
+ __node_data[nid] = (struct node_data *)pgdat;
+}
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27
2022-03-19 9:40 [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27 Feiyang Chen
@ 2022-03-19 13:12 ` Huacai Chen
2022-03-24 8:51 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2022-03-19 13:12 UTC (permalink / raw)
To: Feiyang Chen
Cc: Thomas Bogendoerfer, Feiyang Chen, Jiaxun Yang, Youling Tang,
open list:MIPS
Looks good to me.
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
On Sat, Mar 19, 2022 at 5:40 PM Feiyang Chen
<chris.chenfeiyang@gmail.com> wrote:
>
> Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error
> when CONFIG_NUMA=y:
>
> mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
> (.init.text+0x1714): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data'
>
> Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error:
>
> mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
> page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data'
>
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> ---
> arch/mips/Kconfig | 5 +++++
> arch/mips/loongson64/numa.c | 10 ++++++++++
> arch/mips/sgi-ip27/ip27-memory.c | 10 ++++++++++
> 3 files changed, 25 insertions(+)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 0dae5f1e61cc..de3b32a507d2 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -513,6 +513,7 @@ config MACH_LOONGSON64
> select USE_OF
> select BUILTIN_DTB
> select PCI_HOST_GENERIC
> + select HAVE_ARCH_NODEDATA_EXTENSION if NUMA
> help
> This enables the support of Loongson-2/3 family of machines.
>
> @@ -709,6 +710,7 @@ config SGI_IP27
> select WAR_R10000_LLSC
> select MIPS_L1_CACHE_SHIFT_7
> select NUMA
> + select HAVE_ARCH_NODEDATA_EXTENSION
> help
> This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
> workstations. To compile a Linux kernel that runs on these, say Y
> @@ -2708,6 +2710,9 @@ config NUMA
> config SYS_SUPPORTS_NUMA
> bool
>
> +config HAVE_ARCH_NODEDATA_EXTENSION
> + bool
> +
> config RELOCATABLE
> bool "Relocatable kernel"
> depends on SYS_SUPPORTS_RELOCATABLE
> diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c
> index e8e3e48c5333..69a533148efd 100644
> --- a/arch/mips/loongson64/numa.c
> +++ b/arch/mips/loongson64/numa.c
> @@ -197,3 +197,13 @@ void __init prom_init_numa_memory(void)
> prom_meminit();
> }
> EXPORT_SYMBOL(prom_init_numa_memory);
> +
> +pg_data_t * __init arch_alloc_nodedata(int nid)
> +{
> + return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
> +}
> +
> +void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
> +{
> + __node_data[nid] = pgdat;
> +}
> diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
> index adc2faeecf7c..f79c48393716 100644
> --- a/arch/mips/sgi-ip27/ip27-memory.c
> +++ b/arch/mips/sgi-ip27/ip27-memory.c
> @@ -422,3 +422,13 @@ void __init mem_init(void)
> memblock_free_all();
> setup_zero_pages(); /* This comes from node 0 */
> }
> +
> +pg_data_t * __init arch_alloc_nodedata(int nid)
> +{
> + return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
> +}
> +
> +void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
> +{
> + __node_data[nid] = (struct node_data *)pgdat;
> +}
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27
2022-03-19 9:40 [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27 Feiyang Chen
2022-03-19 13:12 ` Huacai Chen
@ 2022-03-24 8:51 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2022-03-24 8:51 UTC (permalink / raw)
To: Feiyang Chen
Cc: Feiyang Chen, chenhuacai, jiaxun.yang, tangyouling, linux-mips
On Sat, Mar 19, 2022 at 05:40:02PM +0800, Feiyang Chen wrote:
> Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error
> when CONFIG_NUMA=y:
>
> mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
> (.init.text+0x1714): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data'
>
> Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error:
>
> mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
> page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data'
> mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data'
>
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> ---
> arch/mips/Kconfig | 5 +++++
> arch/mips/loongson64/numa.c | 10 ++++++++++
> arch/mips/sgi-ip27/ip27-memory.c | 10 ++++++++++
> 3 files changed, 25 insertions(+)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-24 9:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-19 9:40 [PATCH v2] MIPS: Fix build error for loongson64 and sgi-ip27 Feiyang Chen
2022-03-19 13:12 ` Huacai Chen
2022-03-24 8:51 ` Thomas Bogendoerfer
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).