public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Guan-Yu Lin <guanyulin@google.com>
Cc: rafael@kernel.org, pavel@ucw.cz, len.brown@intel.com,
	gregkh@linuxfoundation.org, 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: Fri, 23 Feb 2024 17:18:41 +0200	[thread overview]
Message-ID: <Zdi3UWWRfKw1N_Jn@smile.fi.intel.com> (raw)
In-Reply-To: <20240223143833.1509961-1-guanyulin@google.com>

On Fri, Feb 23, 2024 at 02:38:29PM +0000, 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.

...

> +static ssize_t conditional_skip_store(struct device *dev,
> +				      struct device_attribute *attr,
> +				      const char *buf, size_t n)
> +{

> +	int ret;

> +	if (kstrtoint(buf, 0, &ret))

Why is it int? It seems like flags, should not be unsigned as u32 or so?

> +		return -EINVAL;

Do not shadow the real error code without justification.

> +	ret &= (PM_EVENT_FREEZE|PM_EVENT_SUSPEND|PM_EVENT_HIBERNATE);
> +
> +	dev->power.conditional_skip_pm = ret;
> +
> +	return n;
> +}

> +

Redundant blank line.

> +static DEVICE_ATTR_RW(conditional_skip);

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-02-23 15:18 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 [this message]
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
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=Zdi3UWWRfKw1N_Jn@smile.fi.intel.com \
    --to=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