[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae5bf6bc-5f7f-4fe9-a833-c1bfa31ff534@salutedevices.com>
Date: Tue, 13 Feb 2024 03:14:35 +0300
From: George Stark <gnstark@...utedevices.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: <pavel@....cz>, <vadimp@...dia.com>, <mpe@...erman.id.au>,
<npiggin@...il.com>, <christophe.leroy@...roup.eu>, <hdegoede@...hat.com>,
<mazziesaccount@...il.com>, <peterz@...radead.org>, <mingo@...hat.com>,
<will@...nel.org>, <longman@...hat.com>, <boqun.feng@...il.com>,
<nikitos.tr@...il.com>, <linux-leds@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>, Lee Jones
<lee@...nel.org>, <kernel@...utedevices.com>, Waiman Long
<longman@...hat.com>, "peterz@...radead.org" <peterz@...radead.org>,
"boqun.feng@...il.com" <boqun.feng@...il.com>, "will@...nel.org"
<will@...nel.org>, "mingo@...hat.com" <mingo@...hat.com>, Andrew Morton
<akpm@...ux-foundation.org>
Subject: Re: [DMARC error][SPF error] Re: [PATCH v4 00/10]
devm_led_classdev_register() usage problem
Hello Andy
On 2/12/24 12:53, Andy Shevchenko wrote:
> On Mon, Feb 12, 2024 at 1:52 AM George Stark <gnstark@...utedevices.com> wrote:
>> I haven't lose hope for the devm_mutex thing and keep pinging those guys
>> from time to time.
>
> I don't understand. According to v4 thread Christophe proposed on how
> the patch should look like. What you need is to incorporate an updated
> version into your series. Am I wrong?
We agreed that the effective way of implementing devm_mutex_init() is in
mutex.h using forward declaration of struct device.
The only inconvenient thing is that in the mutex.h mutex_init() declared
after mutex_destroy() so we'll have to use condition #ifdef
CONFIG_DEBUG_MUTEXES twice. Waiman Long proposed great cleanup patch [1]
that eliminates the need of doubling #ifdef. That patch was reviewed a
bit but it's still unapplied (near 2 months). I'm still trying to
contact mutex.h guys but there're no any feedback yet.
[1]
https://lore.kernel.org/lkml/20231216013656.1382213-2-longman@redhat.com/T/#m795b230d662c1debb28463ad721ddba5b384340a
>
>> Sure I can single out the fix-only patch I'll do it tomorrow.
>
> I believe it can be handled without issuing it separately. `b4` tool
> is capable of selective choices. It was rather Q to Lee if he can/want
> to apply it right away.
Oh ok, that would be great.
>
>> On 2/9/24 20:11, Andy Shevchenko wrote:
>>> On Thu, Dec 21, 2023 at 03:11:11PM +0000, Lee Jones wrote:
>>>> On Thu, 14 Dec 2023, George Stark wrote:
>>>>
>>>>> This patch series fixes the problem of devm_led_classdev_register misusing.
>>>>>
>>>>> The basic problem is described in [1]. Shortly when devm_led_classdev_register()
>>>>> is used then led_classdev_unregister() called after driver's remove() callback.
>>>>> led_classdev_unregister() calls driver's brightness_set callback and that callback
>>>>> may use resources which were destroyed already in driver's remove().
>>>>>
>>>>> After discussion with maintainers [2] [3] we decided:
>>>>> 1) don't touch led subsytem core code and don't remove led_set_brightness() from it
>>>>> but fix drivers
>>>>> 2) don't use devm_led_classdev_unregister
>>>>>
>>>>> So the solution is to use devm wrappers for all resources
>>>>> driver's brightness_set() depends on. And introduce dedicated devm wrapper
>>>>> for mutex as it's often used resource.
>>>>>
>>>>> [1] https://lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895e2b@salutedevices.com/T/
>>>>> [2] https://lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895e2b@salutedevices.com/T/#mc132b9b350fa51931b4fcfe14705d9f06e91421f
>>>>> [3] https://lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895e2b@salutedevices.com/T/#mdbf572a85c33f869a553caf986b6228bb65c8383
>>>
>>> ...
>>>
>>>> FYI: I'll conduct my review once the locking side is settled.
>>>
>>> To reduce burden can you apply the first one? It's a fix.
>
--
Best regards
George
Powered by blists - more mailing lists