[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d55840b8-4cc8-4bac-bb20-6aa155688fdb@icloud.com>
Date: Fri, 18 Oct 2024 19:08:29 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Thomas Gleixner <tglx@...utronix.de>,
quic_zijuhu <quic_zijuhu@...cinc.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] genirq/devres: Simplify API devm_free_irq()
implementation
On 2024/10/18 18:58, Thomas Gleixner wrote:
> On Fri, Oct 18 2024 at 17:28, quic zijuhu wrote:
>> On 10/18/2024 4:57 PM, Thomas Gleixner wrote:
>> if irq to free was ever requested by devm_request_irq()
>> then both logic is exactly same.
[snip]
>> if (irq is not requested by devm_request_irq() {
>> warn;
>> return;
>> }
>>
>
> Ah, you are right. I thought there is a return there.
>
> So you want to explain it maybe this way:
>
> If devres_destroy() does not find a matching devres entry, then
> devm_free_irq() emits a warning and tries to free the interrupt.
>
> That's wrong as devm_free_irq() should only undo what
> devm_request_irq() set up.
>
> Replace devres_destroy() with a call to devres_release() which only
> invokes the release function (free_irq()) in case that a matching
> devres entry was found.
>
thank you. good proposal, let me update commit base on it and send v2.
> Or something like that.
>
> Thanks,
>
> tglx
Powered by blists - more mailing lists