2024-02-23 17:49:38

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v3] PM / core: conditionally skip system pm in device/driver model

On Fri, Feb 23, 2024 at 3:38 PM Guan-Yu Lin <[email protected]> wrote:
>
> In systems with a main processor and a co-processor, asynchronous
> controller management can lead to conflicts. One example is the main
> processor attempting to suspend a device while the co-processor is
> actively using it. To address this, we introduce a new sysfs entry
> called "conditional_skip". This entry allows the system to selectively
> skip certain device power management state transitions. To use this
> feature, set the value in "conditional_skip" to indicate the type of
> state transition you want to avoid. Please review /Documentation/ABI/
> testing/sysfs-devices-power for more detailed information.
>
> Signed-off-by: Guan-Yu Lin <[email protected]>

Please explain how this is intended to work. That is, what exactly
you expect to happen when the new attribute is set.


2024-02-26 10:08:25

by Guan-Yu Lin

[permalink] [raw]
Subject: Re: [PATCH v3] PM / core: conditionally skip system pm in device/driver model

On Sat, Feb 24, 2024 at 1:44 AM Rafael J. Wysocki <[email protected]> wrote:
>
> On Fri, Feb 23, 2024 at 3:38 PM Guan-Yu Lin <[email protected]> wrote:
> >
> > In systems with a main processor and a co-processor, asynchronous
> > controller management can lead to conflicts. One example is the main
> > processor attempting to suspend a device while the co-processor is
> > actively using it. To address this, we introduce a new sysfs entry
> > called "conditional_skip". This entry allows the system to selectively
> > skip certain device power management state transitions. To use this
> > feature, set the value in "conditional_skip" to indicate the type of
> > state transition you want to avoid. Please review /Documentation/ABI/
> > testing/sysfs-devices-power for more detailed information.
> >
> > Signed-off-by: Guan-Yu Lin <[email protected]>
>
> Please explain how this is intended to work. That is, what exactly
> you expect to happen when the new attribute is set.

The sysfs entry 'conditional_skip' for a device indicates which power
transitions (e.g. PM_EVENT_SUSPEND) are omitted within the system
power management flow. During the processing of an identified power
transition, the device's power.entry will not be added to the
dpm_prepared_list, preventing the device from undergoing that
transition. As 'conditional_skip' is modifiable at runtime, a device's
participation in system power management can be dynamically enabled or
disabled.