Re: [PATCH 4/8] ASoC: rt5640: Fix sleep in atomic context

Mark Brown
2023-06-22T12:12:23Z

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

On Thu, Jun 22, 2023 at 05:04:12PM +0530, Sameer Pujar wrote:

> The IRQ handler rt5640_irq() runs in interrupt context and can sleep
> during cancel_delayed_work_sync().

> Fix this by running IRQ handler, rt5640_irq(), in thread context.
> Hence replace request_irq() calls with devm_request_threaded_irq().

> - ret = request_irq(rt5640->jd_gpio_irq, rt5640_jd_gpio_irq,
> - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
> - "rt5640-jd-gpio", rt5640);
> + ret = devm_request_threaded_irq(component->dev,
> + rt5640->jd_gpio_irq,
> + NULL, rt5640_jd_gpio_irq,
> + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
> + "rt5640-jd-gpio", rt5640);

This is rt5640_jd_gpio_irq() which just does a queue_delayed_work() not
a cancel. Why is it being changed?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]