Linux Power Management development
 help / color / mirror / Atom feed
From: Russell Haley <yumpusamongus@gmail.com>
To: qinyu <qinyu32@huawei.com>, rafael@kernel.org, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org, zhangxiaofeng46@huawei.com,
	hewenliang4@huawei.com, linfeilong@huawei.com
Subject: Re: [PATCH] cpufreq: warn about invalid vals to scaling_max/min_freq interfaces
Date: Fri, 17 Mar 2023 06:47:58 -0500	[thread overview]
Message-ID: <42aa3ce0-b1a9-5c4c-173a-eb671ea00f71@gmail.com> (raw)
In-Reply-To: <20230316031549.1343340-1-qinyu32@huawei.com>

On 3/15/23 22:15, qinyu wrote:
> When echo an invalid val to scaling_min_freq:
>> echo 123abc123 > scaling_min_freq
> It looks weird to have a return val of 0:
>> echo $?
>> 0
> 
> Sane people won't echo strings like that into these interfaces but fuzz
> tests may do. Also, maybe it's better to inform people if input is invalid
> or out of range.

AFAICT, the patch doesn't actually cause it to error if the input is out
of range. So the commit message should not be worded to imply that it does.

It is good that it doesn't, I think, because someone might have a
fail-on-unhandled-error program (ex: shell script) that writes this file
deployed on hardware with different cpuinfo_max_freq. A new
unanticipated error would cause such a program to crash where it hadn't
before.


  parent reply	other threads:[~2023-03-17 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  3:15 [PATCH] cpufreq: warn about invalid vals to scaling_max/min_freq interfaces qinyu
2023-03-16  3:36 ` Viresh Kumar
2023-03-17 11:47 ` Russell Haley [this message]
2023-03-20  7:36   ` qinyu
2023-03-17 15:41 ` Rafael J. Wysocki
2023-03-20  8:17   ` [PATCH v2] " qinyu
2023-03-22 19:12     ` Rafael J. Wysocki

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=42aa3ce0-b1a9-5c4c-173a-eb671ea00f71@gmail.com \
    --to=yumpusamongus@gmail.com \
    --cc=hewenliang4@huawei.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=qinyu32@huawei.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zhangxiaofeng46@huawei.com \
    /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