Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43a25632 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar
Browse files

sparseirq: move __weak symbols into separate compilation unit



GCC has a bug with __weak alias functions: if the functions are in
the same compilation unit as their call site, GCC can decide to
inline them - and thus rob the linker of the opportunity to override
the weak alias with the real thing.

So move all the IRQ handling related __weak symbols to kernel/irq/chip.c.

Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b2e2fe99
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -467,4 +467,10 @@ static inline void init_irq_proc(void)

int show_interrupts(struct seq_file *p, void *v);

struct irq_desc;

extern int early_irq_init(void);
extern int arch_early_irq_init(void);
extern int arch_init_chip_data(struct irq_desc *desc, int cpu);

#endif
+0 −3
Original line number Diff line number Diff line
@@ -193,9 +193,6 @@ struct irq_desc {
	const char		*name;
} ____cacheline_internodealigned_in_smp;

extern int early_irq_init(void);
extern int arch_early_irq_init(void);
extern int arch_init_chip_data(struct irq_desc *desc, int cpu);
extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
					struct irq_desc *desc, int cpu);
extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
+0 −10
Original line number Diff line number Diff line
@@ -539,16 +539,6 @@ void __init __weak thread_info_cache_init(void)
{
}

int __init __weak arch_early_irq_init(void)
{
	return 0;
}

int __init __weak early_irq_init(void)
{
	return arch_early_irq_init();
}

asmlinkage void __init start_kernel(void)
{
	char * command_line;
+0 −9
Original line number Diff line number Diff line
@@ -261,15 +261,6 @@ void enable_irq(unsigned int irq)
}
EXPORT_SYMBOL(enable_irq);

/*
 * [ Not in kernel/irq/handle.c, so that GCC does not
 *   inline the __weak alias: ]
 */
int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
{
	return 0;
}

static int set_irq_wake_real(unsigned int irq, unsigned int on)
{
	struct irq_desc *desc = irq_to_desc(irq);
+20 −0
Original line number Diff line number Diff line
@@ -797,3 +797,23 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait)
}
EXPORT_SYMBOL(on_each_cpu);
#endif

/*
 * [ These __weak aliases are kept in a separate compilation unit, so that
 *   GCC does not inline them incorrectly. ]
 */

int __init __weak early_irq_init(void)
{
	return 0;
}

int __init __weak arch_early_irq_init(void)
{
	return 0;
}

int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
{
	return 0;
}