Re: [PATCH V5 1/3] irqchip: add C-SKY irqchip drivers

From: Marc Zyngier
Date: Mon Sep 17 2018 - 09:27:34 EST


On Mon, 17 Sep 2018 03:09:29 +0100,
Guo Ren <ren_guo@xxxxxxxxx> wrote:

[...]

> > > +
> > > + irq_set_default_host(root_domain);
> >
> > Please drop this. There is no reason to use this on any modern, DT
> > based architecture.
> Please let me keep this and in my arch/csky/kernel/smp.c:
>
> void __init setup_smp_ipi(void)
> {
> ...
> irq_create_mapping(NULL, IPI_IRQ);

This looks quite wrong. Reading the code at
https://lkml.org/lkml/2018/9/12/674, it really looks like you're
assuming that IPI_IRQ will be mapped to a Linux IRQ with the same
number. Nothing could be farther from the truth.

The Linux IRQ is returned as the result of irq_create_mapping, which
you're ignoring. You'd be better off creating this mapping from the
irqchip code, and expose the resulting Linux IRQ to oyu SMP code by
any mean of your choice (such as moving the send_ipi_message into the
irqchip code as well).

>
> I need irq_set_default_host to pass the domain and this api is used by
> a lot of drivers:
>
> $ grep irq_set_default_host drivers/irqchip -r | wc -l
> 16

These are all legacy calls, and predates DT conversion. In a number of
cases, these calls could be removed.

> In future we could find a better solution.

I respectfully disagree. There is strictly no reason to merge a new
architecture relying on deprecated features, specially as the code
appears to be buggy. Now is the right time to fix it.

Thanks,

M.

--
Jazz is not dead, it just smell funny.