[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201125152042.GC73489@xps-13-7390>
Date: Wed, 25 Nov 2020 16:20:42 +0100
From: Andrea Righi <andrea.righi@...onical.com>
To: Pavel Machek <pavel@....cz>
Cc: Boqun Feng <boqun.feng@...il.com>, Dan Murphy <dmurphy@...com>,
linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] leds: trigger: fix potential deadlock with libata
On Wed, Nov 25, 2020 at 03:15:18PM +0100, Andrea Righi wrote:
...
> > I'd hate to see this in stable 3 days after Linus merges it...
> >
> > Do these need _irqsave, too?
> >
> > drivers/leds/led-triggers.c: read_lock(&trig->leddev_list_lock);
> > drivers/leds/led-triggers.c: read_unlock(&trig->leddev_list_lock);
> > drivers/leds/led-triggers.c: read_lock(&trig->leddev_list_lock);
> > drivers/leds/led-triggers.c: read_unlock(&trig->leddev_list_lock);
> >
> > Best regards,
>
> I think also led_trigger_blink_setup() needs to use irqsave/irqrestore,
> in fact:
>
> $ git grep "led_trigger_blink("
> drivers/leds/led-triggers.c:void led_trigger_blink(struct led_trigger *trig,
> drivers/power/supply/power_supply_leds.c: led_trigger_blink(psy->charging_blink_full_solid_trig,
> include/linux/leds.h:void led_trigger_blink(struct led_trigger *trigger, unsigned long *delay_on,
> include/linux/leds.h:static inline void led_trigger_blink(struct led_trigger *trigger,
>
> power_supply_leds.c is using led_trigger_blink() from a workqueue
> context, so potentially the same deadlock condition can also happen.
>
> Let me know if you want me to send a new patch to include also this
> case.
Just sent (and tested) a v2 of this patch that changes also
led_trigger_blink_setup().
-Andrea
Powered by blists - more mailing lists