Re: [PATCH v3 2/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM
From: Konrad Dybcio
Date: Fri May 08 2026 - 09:48:43 EST
On 5/8/26 1:36 PM, Ajay Kumar Nandam wrote:
> Convert the LPASS LPI pinctrl driver to use the PM clock framework for
> runtime power management.
>
> This allows the LPASS LPI pinctrl driver to drop clock votes when idle,
> improves power efficiency on platforms using LPASS LPI island mode, and
> aligns the driver with common runtime PM patterns used across Qualcomm
> LPASS subsystems.
>
> Guard GPIO register read/write helpers and slew-rate register programming
> with synchronous runtime PM calls so the device is active during MMIO
> operations whenever autosuspend is enabled.
>
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
> ---
[...]
> for (i = 0; i < g->nfuncs; i++) {
> if (g->funcs[i] == function)
> @@ -119,7 +133,9 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
> return -EINVAL;
>
> mutex_lock(&pctrl->lock);
> - val = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG);
> + ret = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG, &val);
> + if (ret)
> + goto unlock;
Please remove the mutex_unlock/goto calls and replace the
mutex_lock with guard(mutex)(&pctrl->lock) instead. This will use
the scoped cleanup mechanism and let you simply return directly,
shrinking the diff
[...]
> + pm_runtime_set_autosuspend_delay(dev, 100);
> + pm_runtime_use_autosuspend(dev);
> + devm_pm_runtime_enable(dev);
devm_pm_runtime_enable() can fail, please check its return code
nota bene pm_runtime_put_autosuspend() also can, but it's much less of
a problem
I gave this patchset a spin on 8280 CRD and seems to work fine, nice!
Konrad