Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-02-02 Thread Linus Walleij
Hi Mohamed, just a small drive-by comment: On Wed, Jan 20, 2021 at 2:32 PM Mohamed Mediouni wrote: > + for_each_cpu (cpu, mask) { > + smp_mb__before_atomic(); > + atomic_or(1u << irqnr, per_cpu_ptr(_ipi_mask, cpu)); Use: #include atomic_or(BIT(irqnr),

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Rob Herring
On Thu, Jan 21, 2021 at 12:09 PM Mohamed Mediouni wrote: > > > > > On 21 Jan 2021, at 18:37, Rob Herring wrote: > > > > On Thu, Jan 21, 2021 at 10:43 AM Mohamed Mediouni > > wrote: > >>> On 21 Jan 2021, at 17:40, Rob Herring wrote: > >>> On Thu, Jan 21, 2021 at 6:52 AM Mohamed Mediouni > >>>

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mohamed Mediouni
> On 21 Jan 2021, at 18:37, Rob Herring wrote: > > On Thu, Jan 21, 2021 at 10:43 AM Mohamed Mediouni > wrote: >>> On 21 Jan 2021, at 17:40, Rob Herring wrote: >>> On Thu, Jan 21, 2021 at 6:52 AM Mohamed Mediouni >>> wrote: > On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > On Wed,

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Rob Herring
On Thu, Jan 21, 2021 at 10:43 AM Mohamed Mediouni wrote: > > On 21 Jan 2021, at 17:40, Rob Herring wrote: > > On Thu, Jan 21, 2021 at 6:52 AM Mohamed Mediouni > > wrote: > >>> On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > >>> On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni > >>> wrote:

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mohamed Mediouni
> On 21 Jan 2021, at 17:40, Rob Herring wrote: > > On Thu, Jan 21, 2021 at 6:52 AM Mohamed Mediouni > wrote: >> >> >> >>> On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: >>> >>> On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni >>> wrote: >>> +#ifdef CONFIG_SMP +static void

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Rob Herring
On Thu, Jan 21, 2021 at 6:52 AM Mohamed Mediouni wrote: > > > > > On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > > > > On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni > > wrote: > > > >> +#ifdef CONFIG_SMP > >> +static void apple_aic_ipi_send_mask(struct irq_data *d, > >> +

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mohamed Mediouni
> On 21 Jan 2021, at 16:09, Arnd Bergmann wrote: > > On Thu, Jan 21, 2021 at 3:10 PM Marc Zyngier wrote: >> On 2021-01-21 13:34, Mohamed Mediouni wrote: On 21 Jan 2021, at 14:22, Marc Zyngier wrote: >>> Because UART access adapters for the new M1 Macs aren’t plentiful >>> at all, I

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Arnd Bergmann
On Thu, Jan 21, 2021 at 3:10 PM Marc Zyngier wrote: > On 2021-01-21 13:34, Mohamed Mediouni wrote: > >> On 21 Jan 2021, at 14:22, Marc Zyngier wrote: > > Because UART access adapters for the new M1 Macs aren’t plentiful > > at all, I actually use this for development, with iPhones which have > >

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Marc Zyngier
On 2021-01-21 13:34, Mohamed Mediouni wrote: On 21 Jan 2021, at 14:22, Marc Zyngier wrote: On 2021-01-21 12:50, Mohamed Mediouni wrote: On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni [...] + aic.fast_ipi = of_property_read_bool(node,

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Marc Zyngier
On 2021-01-21 13:32, Mark Rutland wrote: On Thu, Jan 21, 2021 at 01:22:37PM +, Marc Zyngier wrote: On 2021-01-21 12:50, Mohamed Mediouni wrote: > > On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > > > > On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni [...] > > > + aic.fast_ipi =

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mohamed Mediouni
> On 21 Jan 2021, at 14:22, Marc Zyngier wrote: > > On 2021-01-21 12:50, Mohamed Mediouni wrote: >>> On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: >>> On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni > > [...] > + aic.fast_ipi = of_property_read_bool(node, "fast-ipi"); >>>

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mark Rutland
On Thu, Jan 21, 2021 at 01:22:37PM +, Marc Zyngier wrote: > On 2021-01-21 12:50, Mohamed Mediouni wrote: > > > On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > > > > > > On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni > > [...] > > > > > + aic.fast_ipi = of_property_read_bool(node,

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Marc Zyngier
On 2021-01-21 12:50, Mohamed Mediouni wrote: On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni [...] + aic.fast_ipi = of_property_read_bool(node, "fast-ipi"); Where is this property documented, and what decides which one to use? It’s

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Hector Martin 'marcan'
On 21/01/2021 22.00, Arnd Bergmann wrote: Ok, makes sense. Does fast-ipi mean you cannot use the other mode at all, or is it just faster as implied by the name? If so, how much faster? The other mode still works, as the AIC IPI registers are still there on M1 and work properly. I don't have

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Arnd Bergmann
On Thu, Jan 21, 2021 at 1:50 PM Mohamed Mediouni wrote: > > On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > >> @@ -186,8 +325,11 @@ static int __init apple_aic_init(struct device_node > >> *node, > >> if (WARN(!aic.base, "unable to map aic registers\n")) > >> return

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Mohamed Mediouni
> On 21 Jan 2021, at 13:44, Arnd Bergmann wrote: > > On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni > wrote: > >> +#ifdef CONFIG_SMP >> +static void apple_aic_ipi_send_mask(struct irq_data *d, >> + const struct cpumask *mask) > > Not sure we care about

Re: [RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-21 Thread Arnd Bergmann
On Wed, Jan 20, 2021 at 2:27 PM Mohamed Mediouni wrote: > +#ifdef CONFIG_SMP > +static void apple_aic_ipi_send_mask(struct irq_data *d, > + const struct cpumask *mask) Not sure we care about the #ifdef here, given that arch/arm64 does not allow building a

[RFC PATCH 7/7] irqchip/apple-aic: add SMP support to the Apple AIC driver.

2021-01-20 Thread Mohamed Mediouni
From: Stan Skowronek This includes IPI support and a workaround for non-working WFI on Apple processors. Signed-off-by: Stan Skowronek Signed-off-by: Mohamed Mediouni --- drivers/irqchip/irq-apple-aic.c | 177 +--- 1 file changed, 165 insertions(+), 12