Re: [PATCH v1 3/4] serial: qcom-geni: Enable PM runtime for serial driver

From: Andy Shevchenko

Date: Wed Nov 26 2025 - 08:01:46 EST


On Mon, Nov 10, 2025 at 03:40:42PM +0530, Praveen Talari wrote:
> The GENI serial driver currently handles power resource management
> through calls to the statically defined geni_serial_resources_on() and
> geni_serial_resources_off() functions. This approach reduces modularity
> and limits support for platforms with diverse power management
> mechanisms, including resource managed by firmware.
>
> Improve modularity and enable better integration with platform-specific
> power management, introduce support for runtime PM. Use
> pm_runtime_resume_and_get() and pm_runtime_put_sync() within the
> qcom_geni_serial_pm() callback to control resource power state
> transitions based on UART power state changes.

...

> + devm_pm_runtime_enable(port->se.dev);

First of all, this misses the error check.

> +static int __maybe_unused qcom_geni_serial_runtime_suspend(struct device *dev)

Second, we have a new (already like 2+ years) approach, so, drop __maybe_unused
and try not to add more in a new code.

...

> +static int __maybe_unused qcom_geni_serial_runtime_resume(struct device *dev)

Ditto.

...

> static const struct dev_pm_ops qcom_geni_serial_pm_ops = {
> + SET_RUNTIME_PM_OPS(qcom_geni_serial_runtime_suspend,
> + qcom_geni_serial_runtime_resume, NULL)
> SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_suspend, qcom_geni_serial_resume)
> };

Please, do not use deprecated macros, switch to new ones in conjunction with
pm_ptr() at the PM ops assignment below.

...

Since it's going to be applied, I think, send a followup to fix this.

--
With Best Regards,
Andy Shevchenko