Re: [PATCH v3] MIPS: Replace setup_irq() by request_irq()

From: afzal mohammed
Date: Thu Mar 05 2020 - 07:29:57 EST


Hi Thomas,

On Wed, Mar 04, 2020 at 09:31:44PM +0100, Thomas Bogendoerfer wrote:
> On Wed, Mar 04, 2020 at 06:25:43AM +0530, afzal mohammed wrote:

> > Hi mips maintainers,
> >
> > if okay w/ this change, please consider taking it thr' your tree, else please
> > let me know.
>
> sorry this doesn't even compile for the first platform I've tested:

i apologize for the mistake.

Of the 15 architectures that were subjected to setup_irq() cleanup,
i had done build & boot test only on ARM & x86_64, at the minimum i
should have informed you upfront in the previous mail (in v2 & v1 it was
mentioned in cover letter). i was trying to rely on kbuild test robot
for help in building other arch's. Seems it is randomly selecting
patches, since some of the issues were present in v2 & v1 as well and
no error report were recieved on v1 & v2 MIPS patch.

kbuild test robot had provided the way to create mips cross compiler
as well as the config. The build error has been fixed that were
spotted by you as well kbuild test robot, also there were a few more
issues including other build error. v4 that resolves all these
has been sent.

All the files that has been modified has been verifed to generate
object files w/o error or warnings. w/ the test robot provided config,
not all changes in my patch were being compiled, so i had to manually
select each machines one at a time to verify every change. Also i
couldn't build 3 machines (msp71xx, loongson64 & bcm63xx) even w/o my
changes. Those i had to find out defconfig's that can make those
changes build, then they also could be verified.

Sorry for the trouble, please let me know if further issues.

For your reference, diff between v4 & v3 below,

Regards
afzal


diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index d4f136c7fb11..d17e44c99df9 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -214,7 +214,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
* processed by PALcode, and comes in via entInt vector 1.
*/
void __init
-init_rtc_irq(irqreturn_t handler)
+init_rtc_irq(irq_handler_t handler)
{
irq_set_chip_and_handler_name(RTC_IRQ, &dummy_irq_chip,
handle_percpu_irq, "RTC");
diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h
index 7ac58be4ccf4..fbf21892e66d 100644
--- a/arch/alpha/kernel/irq_impl.h
+++ b/arch/alpha/kernel/irq_impl.h
@@ -23,7 +23,7 @@ extern void pyxis_device_interrupt(unsigned long);

extern void init_srm_irqs(long, unsigned long);
extern void init_pyxis_irqs(unsigned long);
-extern void init_rtc_irq(irqreturn_t handler);
+extern void init_rtc_irq(irq_handler_t handler);

extern void common_init_isa_dma(void);

diff --git a/arch/mips/include/asm/sni.h b/arch/mips/include/asm/sni.h
index b8653de25ca1..7dfa297ce597 100644
--- a/arch/mips/include/asm/sni.h
+++ b/arch/mips/include/asm/sni.h
@@ -11,6 +11,8 @@
#ifndef __ASM_SNI_H
#define __ASM_SNI_H

+#include <linux/irqreturn.h>
+
extern unsigned int sni_brd_type;

#define SNI_BRD_10 2
diff --git a/arch/mips/pmcs-msp71xx/msp_time.c b/arch/mips/pmcs-msp71xx/msp_time.c
index 5f211d2d14ff..baf0da8b4c98 100644
--- a/arch/mips/pmcs-msp71xx/msp_time.c
+++ b/arch/mips/pmcs-msp71xx/msp_time.c
@@ -76,7 +76,7 @@ void __init plat_time_init(void)

unsigned int get_c0_compare_int(void)
{
- unsigned log flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED;
+ unsigned long flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED;

/* MIPS_MT modes may want timer for second VPE */
if ((get_current_vpe()) && !tim_installed) {
diff --git a/arch/mips/ralink/cevt-rt3352.c b/arch/mips/ralink/cevt-rt3352.c
index 84013214434a..269d4877d120 100644
--- a/arch/mips/ralink/cevt-rt3352.c
+++ b/arch/mips/ralink/cevt-rt3352.c
@@ -89,7 +89,7 @@ static int systick_shutdown(struct clock_event_device *evt)
sdev = container_of(evt, struct systick_device, dev);

if (sdev->irq_requested)
- free_irq(systick.dev.irq, &systick_irqaction);
+ free_irq(systick.dev.irq, &systick.dev);
sdev->irq_requested = 0;
iowrite32(0, systick.membase + SYSTICK_CONFIG);

diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 5254a3a1f37c..240bb68ec247 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -62,14 +62,12 @@ static irqreturn_t a20r_interrupt(int irq, void *dev_id)
static void __init sni_a20r_timer_setup(void)
{
struct clock_event_device *cd = &a20r_clockevent_device;
- struct irqaction *action = &a20r_irqaction;
unsigned int cpu = smp_processor_id();

cd->cpumask = cpumask_of(cpu);
clockevents_register_device(cd);
- action->dev_id = cd;
if (request_irq(SNI_A20R_IRQ_TIMER, a20r_interrupt,
- IRQF_PERCPU | IRQF_TIMER, "a20r-timer", NULL))
+ IRQF_PERCPU | IRQF_TIMER, "a20r-timer", cd))
pr_err("Failed to register a20r-timer interrupt\n");
}