public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Guan-Yu Lin <guanyulin@google.com>
Cc: rafael@kernel.org, pavel@ucw.cz, len.brown@intel.com,
	gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
	petr.tesarik.ext@huawei.com, rdunlap@infradead.org,
	james@equiv.tech, broonie@kernel.org, james.clark@arm.com,
	masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3] PM / core: conditionally skip system pm in device/driver model
Date: Mon, 26 Feb 2024 10:40:12 -0800	[thread overview]
Message-ID: <3208c5b9-5286-48d1-81ab-cc3b2bc4303e@gmail.com> (raw)
In-Reply-To: <CAOuDEK3wP6zhEwgUn5zSedtwTYVFaJeBfeXkSg897EhpGP9=ig@mail.gmail.com>

On 2/26/24 02:28, Guan-Yu Lin wrote:
> On Sat, Feb 24, 2024 at 2:20 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> 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
>>
> 
> This patch enables devices to selectively participate in system power
> transitions. This is crucial when multiple processors, managed by
> different operating system kernels, share the same controller. One
> processor shouldn't enforce the same power transition procedures on
> the controller – another processor might be using it at that moment.
> While a spinlock is necessary for synchronizing controller access, we
> still need to add the flexibility to dynamically customize power
> transition behavior for each device. And that's what this patch is
> trying to do.
> In our use case, the host processor and co-processor are managed by
> separate operating system kernels. This arrangement is static.

OK, so now the question is whether the peripheral is entirely visible to 
Linux, or is it entirely owned by the co-processor, or is there a 
combination of both and the usage of the said device driver is dynamic 
between Linux and your co-processor?

A sysfs entry does not seem like the appropriate way to described which 
states need to be skipped and which ones can remain under control of 
Linux, you would have to use your firmware's description for that (ACPI, 
Device Tree, etc.) such that you have a more comprehensive solution that 
can span a bigger scope.
-- 
Florian


  reply	other threads:[~2024-02-26 18:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 14:38 [PATCH v3] PM / core: conditionally skip system pm in device/driver model Guan-Yu Lin
2024-02-23 15:18 ` Andy Shevchenko
2024-02-26  9:15   ` Guan-Yu Lin
2024-02-26 14:02     ` Andy Shevchenko
2024-02-27  6:47       ` Guan-Yu Lin
2024-02-23 17:43 ` Rafael J. Wysocki
2024-02-26  9:45   ` Guan-Yu Lin
2024-02-27 11:28     ` Rafael J. Wysocki
2024-02-29 10:09       ` Guan-Yu Lin
2024-02-23 18:20 ` Florian Fainelli
2024-02-26 10:28   ` Guan-Yu Lin
2024-02-26 18:40     ` Florian Fainelli [this message]
2024-02-27  8:56       ` Guan-Yu Lin
2024-02-27  9:15         ` Greg KH
2024-02-29 10:27           ` Guan-Yu Lin
2024-02-27 17:57         ` Florian Fainelli
2024-02-29  9:08           ` Guan-Yu Lin
2024-02-29 20:34             ` Greg KH
2024-03-08 18:04               ` Guan-Yu Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3208c5b9-5286-48d1-81ab-cc3b2bc4303e@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=guanyulin@google.com \
    --cc=james.clark@arm.com \
    --cc=james@equiv.tech \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=petr.tesarik.ext@huawei.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox