Re: [PATCH v11 4/4] firmware: ti_sci: add CPU latency constraint management

Markus Schneider-Pargmann
2024-09-03T15:23:39Z

Hi,

On Tue, Sep 03, 2024 at 07:45:40AM GMT, Nishanth Menon wrote:
> On 17:54-20240902, Nathan Chancellor wrote:
> [...]
>
> > > @@ -3669,7 +3671,27 @@ static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
> > > static int __maybe_unused ti_sci_suspend(struct device *dev)
> > > {
> > > struct ti_sci_info *info = dev_get_drvdata(dev);
> > > - int ret;
> > > + struct device *cpu_dev, *cpu_dev_max = NULL;
> > > + s32 val, cpu_lat = 0;
> > > + int i, ret;
> > > +
> > > + if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) {
> > > + for_each_possible_cpu(i) {
> > > + cpu_dev = get_cpu_device(i);
> > > + val = dev_pm_qos_read_value(cpu_dev, DEV_PM_QOS_RESUME_LATENCY);
> >
> > This change is now in -next as commit 458d22d2e064 ("firmware: ti_sci:
> > add CPU latency constraint management"), where it breaks the build
> > when this driver is built as a module because dev_pm_qos_read_value() is
> > not exported to modules:
> >
> > ERROR: modpost: "dev_pm_qos_read_value" [drivers/firmware/ti_sci.ko] undefined!
> >
> > Obviously exporting it would fix the build but sometimes that is
> > controversial, hence just the report.
>
> Thank you for the report. I will drop the series from my queue for now.
> That should give us some time to sort things out properly for the next
> window.

Thanks as well for reporting. I looked into this issue and it looks like
many of the dev_pm_qos_* functions are already exported.
Documentation/power/pm_qos_interface.rst also already lists the function
for kernel-internal use along with many others. So I think adding the
export is the right way and I prepared a patch for that.

Also from what I saw and tested, I was only able to reproduce this issue
with ARCH_KEYSTONE when the TI_SCI_PROTOCOL is selected as module.
multi_v7_defconfig and keystone_defconfig both select it as built-in as
well as ARCH_K3. For all other architectures, TI_SCI_PROTOCOL can not be
selected as it depends on TI_MESSAGE_MANAGER which depends on KEYSTONE
or K3.

Best
Markus