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

From: Florian Fainelli
Date: Fri Feb 23 2024 - 13:20:56 EST


On 2/23/24 06:38, Guan-Yu Lin 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.

This looks like a poor way of dealing with a lack of adequate resource tracking from Linux on behalf of the co-processor(s) and I really do not understand how someone is supposed to use that in a way that works.

Cannot you use a HW maintained spinlock between your host processor and the co-processor such that they can each claim exclusive access to the hardware and you can busy-wait until one or the other is done using the device? How is your partitioning between host processor owned blocks and co-processor(s) owned blocks? Is it static or is it dynamic?
--
Florian