Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Joshua Kinard <kumba@gentoo.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Linux/MIPS <linux-mips@linux-mips.org>
Subject: [PATCH]: MIPS: IP27: Fix section mismatches & mark boot functions w/ __init
Date: Mon, 7 Sep 2015 06:46:57 -0400	[thread overview]
Message-ID: <55ED6B21.8030401@gentoo.org> (raw)

From: Joshua Kinard <kumba@gentoo.org>

When the xwidget.h changes were added in 4.1, they inadvertently created
a few section mismatch warnings due to not using '__init' on a few
functions:

WARNING: vmlinux.o(.text+0x38f8): Section mismatch in reference from the function xbow_probe() to the variable .init.rodata:widget_idents
The function xbow_probe() references
the variable __initconst widget_idents.
This is often because xbow_probe lacks a __initconst
annotation or the annotation of widget_idents is wrong.

WARNING: vmlinux.o(.text+0x3bd8): Section mismatch in reference from the function xtalk_probe_node() to the variable .init.rodata:widget_idents
The function xtalk_probe_node() references
the variable __initconst widget_idents.
This is often because xtalk_probe_node lacks a __initconst
annotation or the annotation of widget_idents is wrong.

Fix this, and add __init to nearby IP27 functions that are only used
during system boot up, as this platform can't hotswap CPUs/nodes while
running anyways.

Signed-off-by: Joshua Kinard <kumba@gentoo.org>
---
 arch/mips/sgi-ip27/ip27-init.c  |    2 +-
 arch/mips/sgi-ip27/ip27-smp.c   |   10 +++++-----
 arch/mips/sgi-ip27/ip27-xtalk.c |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

linux-mips-ip27-fix-section-mismatches.patch
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index 570098b..bb00afd 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -110,7 +110,7 @@ static void per_hub_init(cnodeid_t cnode)
 	}
 }
 
-void per_cpu_init(void)
+void __init per_cpu_init(void)
 {
 	int cpu = smp_processor_id();
 	int slice = LOCAL_HUB_L(PI_CPU_NUM);
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index f9ae6a8..cd6fc2e 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -94,7 +94,7 @@ static int do_cpumask(cnodeid_t cnode, nasid_t nasid, int highest)
 	return highest;
 }
 
-void cpu_node_probe(void)
+void __init cpu_node_probe(void)
 {
 	int i, highest = 0;
 	gda_t *gdap = GDA;
@@ -127,7 +127,7 @@ void cpu_node_probe(void)
 	printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes());
 }
 
-static __init void intr_clear_all(nasid_t nasid)
+static void __init intr_clear_all(nasid_t nasid)
 {
 	int i;
 
@@ -173,12 +173,12 @@ static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action)
 		ip27_send_ipi_single(i, action);
 }
 
-static void ip27_init_secondary(void)
+static void __init ip27_init_secondary(void)
 {
 	per_cpu_init();
 }
 
-static void ip27_smp_finish(void)
+static void __init ip27_smp_finish(void)
 {
 	extern void hub_rt_clock_event_init(void);
 
@@ -191,7 +191,7 @@ static void ip27_smp_finish(void)
  * set sp to the kernel stack of the newly created idle process, gp to the proc
  * struct so that current_thread_info() will work.
  */
-static void ip27_boot_secondary(int cpu, struct task_struct *idle)
+static void __init ip27_boot_secondary(int cpu, struct task_struct *idle)
 {
 	unsigned long gp = (unsigned long)task_thread_info(idle);
 	unsigned long sp = __KSTK_TOS(idle);
diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c
index c262208..07bb8fd 100644
--- a/arch/mips/sgi-ip27/ip27-xtalk.c
+++ b/arch/mips/sgi-ip27/ip27-xtalk.c
@@ -22,7 +22,7 @@
 
 extern int bridge_probe(nasid_t nasid, int widget, int masterwid);
 
-static int probe_one_port(nasid_t nasid, int widget, int masterwid)
+static int __init probe_one_port(nasid_t nasid, int widget, int masterwid)
 {
 	const struct widget_ident *res;
 	u32 wid_id, wid_part, wid_mfgr, wid_rev;
@@ -63,7 +63,7 @@ static int probe_one_port(nasid_t nasid, int widget, int masterwid)
 	return 0;
 }
 
-static int xbow_probe(nasid_t nasid)
+static int __init xbow_probe(nasid_t nasid)
 {
 	lboard_t *brd;
 	klxbow_t *xbow_p;
@@ -116,7 +116,7 @@ static int xbow_probe(nasid_t nasid)
 	return 0;
 }
 
-void xtalk_probe_node(cnodeid_t nid)
+void __init xtalk_probe_node(cnodeid_t nid)
 {
 	volatile u64		hubreg;
 	nasid_t			nasid;

                 reply	other threads:[~2015-09-07 10:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ED6B21.8030401@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox