[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <958c27b1-26d7-4927-976b-4502f33f31f7@gmail.com>
Date: Mon, 22 Apr 2024 15:26:16 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Florian Fainelli <florian.fainelli@...adcom.com>,
linux-kernel@...r.kernel.org
Cc: opendmb@...il.com, Tim Ross <tim.ross@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
"open list:BROADCOM BMIPS MIPS ARCHITECTURE" <linux-mips@...r.kernel.org>,
"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown
On 4/22/24 14:29, Thomas Gleixner wrote:
> On Tue, Apr 16 2024 at 12:43, Florian Fainelli wrote:
>> The interrupt controller shutdown path does not need to save the mask of
>> enabled interrupts because the next state the system is going to be in
>> is akin to a cold boot, or a kexec'd kernel.
>
> Sure, but
>
>> Reported-by: Tim Ross <tim.ross@...adcom.com>
>> Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
>> ---
>> drivers/irqchip/irq-brcmstb-l2.c | 17 ++++++++++++++---
>> 1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
>> index 2b0b3175cea0..c988886917f7 100644
>> --- a/drivers/irqchip/irq-brcmstb-l2.c
>> +++ b/drivers/irqchip/irq-brcmstb-l2.c
>> @@ -118,7 +118,7 @@ static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
>> chained_irq_exit(chip, desc);
>> }
>>
>> -static void brcmstb_l2_intc_suspend(struct irq_data *d)
>> +static void __brcmstb_l2_intc_suspend(struct irq_data *d, bool save)
>> {
>> struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
>> struct irq_chip_type *ct = irq_data_get_chip_type(d);
>> @@ -127,7 +127,8 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d)
>>
>> irq_gc_lock_irqsave(gc, flags);
>> /* Save the current mask */
>> - b->saved_mask = irq_reg_readl(gc, ct->regs.mask);
>> + if (save)
>> + b->saved_mask = irq_reg_readl(gc, ct->regs.mask);
>
> what's the conditional actually buying you except more complex code?
Not much this is an optimization that is simple to carry out. There can
be dozens of such L2 interrupt controllers in a given system and the
MMIO accesses start adding up eventually.
--
Florian
Powered by blists - more mailing lists