Re: [PATCH v2 1/5] pinctrl: qcom: lpass-lpi: make mutex cleanup devm-managed
From: Bartosz Golaszewski
Date: Wed Jul 15 2026 - 08:45:46 EST
On Mon, 13 Jul 2026 20:45:45 +0200, Prasad Kumpatla
<prasad.kumpatla@xxxxxxxxxxxxxxxx> said:
> The driver registers its pin controller using devm_pinctrl_register(),
> which keeps the pinctrl device alive until devres teardown, after
> .remove() returns. Explicitly destroying pctrl->lock in .remove() and
> the probe error path leaves the mutex destroyed while the pinctrl
> device is still accessible, risking a panic on concurrent debugfs
> access during unbind.
>
That's not really correct - the mutex is not destroyed as mutex_destroy() only
marks the mutex as invalid for lockdep accounting.
With this addressed the patch looks good.
Bart