* [PATCH v2] gpio: vr41xx: Use spurious_interrupt() and export it to modules
@ 2022-05-24 3:28 Genjian Zhang
2022-05-24 16:41 ` Florian Fainelli
0 siblings, 1 reply; 2+ messages in thread
From: Genjian Zhang @ 2022-05-24 3:28 UTC (permalink / raw)
To: tsbogend, maz, keescook, mark.rutland, nathan, siyanteng01,
yyuasa, ralf
Cc: linux-mips, linux-kernel, huhai, zhanggenjian123, k2ci
From: huhai <huhai@kylinos.cn>
modpost complains once these drivers become modules.
ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined!
Fix it by use spurious_interrupt() and export spurious_interrupt() when
that symbol is =m.
Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib")
Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: huhai <huhai@kylinos.cn>
---
arch/mips/kernel/irq.c | 3 +++
drivers/gpio/gpio-vr41xx.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 5e11582fe308..69f9a46bf9e5 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -49,6 +49,9 @@ asmlinkage void spurious_interrupt(void)
{
atomic_inc(&irq_err_count);
}
+#ifdef CONFIG_GPIO_VR41XX_MODULE
+EXPORT_SYMBOL_GPL(spurious_interrupt);
+#endif
void __init init_IRQ(void)
{
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
index 98cd715ccc33..8f27a0e0ad99 100644
--- a/drivers/gpio/gpio-vr41xx.c
+++ b/drivers/gpio/gpio-vr41xx.c
@@ -217,7 +217,7 @@ static int giu_get_irq(unsigned int irq)
printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
maskl, pendl, maskh, pendh);
- atomic_inc(&irq_err_count);
+ spurious_interrupt();
return -EINVAL;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] gpio: vr41xx: Use spurious_interrupt() and export it to modules
2022-05-24 3:28 [PATCH v2] gpio: vr41xx: Use spurious_interrupt() and export it to modules Genjian Zhang
@ 2022-05-24 16:41 ` Florian Fainelli
0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2022-05-24 16:41 UTC (permalink / raw)
To: Genjian Zhang, tsbogend, maz, keescook, mark.rutland, nathan,
siyanteng01, yyuasa, ralf
Cc: linux-mips, linux-kernel, huhai, k2ci
On 5/23/22 20:28, Genjian Zhang wrote:
> From: huhai <huhai@kylinos.cn>
>
> modpost complains once these drivers become modules.
> ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined!
>
> Fix it by use spurious_interrupt() and export spurious_interrupt() when
> that symbol is =m.
>
> Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib")
> Suggested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Reported-by: k2ci <kernel-bot@kylinos.cn>
> Signed-off-by: huhai <huhai@kylinos.cn>
> ---
> arch/mips/kernel/irq.c | 3 +++
> drivers/gpio/gpio-vr41xx.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
> index 5e11582fe308..69f9a46bf9e5 100644
> --- a/arch/mips/kernel/irq.c
> +++ b/arch/mips/kernel/irq.c
> @@ -49,6 +49,9 @@ asmlinkage void spurious_interrupt(void)
> {
> atomic_inc(&irq_err_count);
> }
> +#ifdef CONFIG_GPIO_VR41XX_MODULE
> +EXPORT_SYMBOL_GPL(spurious_interrupt);
> +#endif
You should not be exporting for just a specific configuration, export it
unconditionally. The generic IRQ layer however prefers to use
handle_bad_irq() which is already exported, can you consider using that?
--
Florian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-24 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24 3:28 [PATCH v2] gpio: vr41xx: Use spurious_interrupt() and export it to modules Genjian Zhang
2022-05-24 16:41 ` Florian Fainelli
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).