lkml.org 
[lkml]   [2024]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown
From
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@broadcom.com>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.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


\
 
 \ /
  Last update: 2024-05-27 17:56    [W:0.051 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site