[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZmgjkVXZEe6BkZzq@google.com>
Date: Tue, 11 Jun 2024 10:14:41 +0000
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>,
Sebastian Reichel <sre@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Robert Moore <robert.moore@...el.com>,
chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org,
Mario Limonciello <mario.limonciello@....com>,
Dustin Howett <dustin@...ett.net>,
Stephen Horvath <s.horvath@...look.com.au>,
Rajas Paranjpe <paranjperajas@...il.com>,
linux-acpi@...r.kernel.org, acpica-devel@...ts.linux.dev,
Matt Hartley <matt.hartley@...il.com>
Subject: Re: [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce
cros_ec_cmd_versions()
On Tue, Jun 11, 2024 at 09:23:24AM +0200, Thomas Weißschuh wrote:
> On 2024-06-11 06:32:38+0000, Tzung-Bi Shih wrote:
> > On Mon, Jun 10, 2024 at 05:51:08PM +0200, Thomas Weißschuh wrote:
> > > If the command is not supported at all the EC returns
> > > -EINVAL/EC_RES_INVALID_PARAMS.
> > >
> > > This error is translated into an empty version mask as that is easier to
> > > handle for callers and they don't need to know about the error details.
> >
> > I'm not sure whether the behavior is what we want or not as existing
> > EC_CMD_GET_CMD_VERSIONS usages don't have it.
>
> At least the caller of cros_ec_get_host_command_version_mask() expects
> it:
>
> ret = cros_ec_get_host_command_version_mask(..., &ver_mask);
> if (ret < 0 || ver_mask == 0)
> ...
>
> ver_mask == 0 will never happen as in that case -EINVAL would have been
> returned.
>
> Others, like cros_ec_cec_get_write_cmd_version(), expect the current
> semantic of ver_mask != 0 but log spurious errors in case of -EINVAL.
> cros_pchg_cmd_ver_check(), works with both semantics, but currently also
> logs a spurious error message.
>
> To me the new semantic looks more obvious and much easier to handle.
> For each command version a bit is set. no command versions -> no bits.
Ack.
Powered by blists - more mailing lists