RE: [PATCH v9 09/13] cpufreq: amd-pstate: add driver working mode switch support
From: Yuan, Perry
Date: Thu Jan 05 2023 - 21:53:03 EST
[AMD Official Use Only - General]
Hi Wyes.
> -----Original Message-----
> From: Karny, Wyes <Wyes.Karny@xxxxxxx>
> Sent: Friday, January 6, 2023 12:04 AM
> To: Yuan, Perry <Perry.Yuan@xxxxxxx>; rafael.j.wysocki@xxxxxxxxx;
> Limonciello, Mario <Mario.Limonciello@xxxxxxx>; Huang, Ray
> <Ray.Huang@xxxxxxx>; viresh.kumar@xxxxxxxxxx
> Cc: Sharma, Deepak <Deepak.Sharma@xxxxxxx>; Fontenot, Nathan
> <Nathan.Fontenot@xxxxxxx>; Deucher, Alexander
> <Alexander.Deucher@xxxxxxx>; Huang, Shimmer
> <Shimmer.Huang@xxxxxxx>; Du, Xiaojian <Xiaojian.Du@xxxxxxx>; Meng,
> Li (Jassmine) <Li.Meng@xxxxxxx>; linux-pm@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v9 09/13] cpufreq: amd-pstate: add driver working mode
> switch support
>
> Hi Perry,
>
> On 12/25/2022 10:04 PM, Perry Yuan wrote:
> -------------------------------->8--------------------------------
> > +
> > +static int amd_pstate_update_status(const char *buf, size_t size) {
> > + int ret;
> > + int mode_idx;
> > +
> > + if (size > 7 || size < 3)
> > + return -EINVAL;
> > + mode_idx = get_mode_idx_from_str(buf, size);
>
> if (size > 7 || size < 6) right?
> because possible strings are: "disable", "passive" and "active".
>
Since I remove the "off" string for the v10 series, So Yes, It will be good to update the size checking.
Perry.
> --
> Thanks & Regards,
> Wyes