From: Tzung-Bi Shih <tzungbi@kernel.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Sebastian Reichel <sre@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org,
Mario Limonciello <mario.limonciello@amd.com>,
Dustin Howett <dustin@howett.net>,
Stephen Horvath <s.horvath@outlook.com.au>,
Rajas Paranjpe <paranjperajas@gmail.com>,
linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev,
Matt Hartley <matt.hartley@gmail.com>
Subject: Re: [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions()
Date: Tue, 11 Jun 2024 10:14:41 +0000 [thread overview]
Message-ID: <ZmgjkVXZEe6BkZzq@google.com> (raw)
In-Reply-To: <f2a361aa-a256-41a5-8100-703e40df975d@t-8ch.de>
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.
next prev parent reply other threads:[~2024-06-11 10:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 15:51 [PATCH v3 0/5] ChromeOS Embedded Controller charge control driver Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 1/5] ACPI: battery: add devm_battery_hook_register() Thomas Weißschuh
2024-06-13 19:33 ` Rafael J. Wysocki
2024-06-10 15:51 ` [PATCH v3 2/5] platform/chrome: Update binary interface for EC-based charge control Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 3/5] platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions() Thomas Weißschuh
2024-06-11 6:32 ` Tzung-Bi Shih
2024-06-11 7:23 ` Thomas Weißschuh
2024-06-11 10:14 ` Tzung-Bi Shih [this message]
2024-06-11 11:35 ` Tzung-Bi Shih
2024-06-11 12:14 ` Thomas Weißschuh
2024-06-12 2:25 ` Tzung-Bi Shih
2024-06-10 15:51 ` [PATCH v3 4/5] power: supply: add ChromeOS EC based charge control driver Thomas Weißschuh
2024-06-10 15:51 ` [PATCH v3 5/5] power: supply: cros_charge-control: don't probe if Framework control is present Thomas Weißschuh
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=ZmgjkVXZEe6BkZzq@google.com \
--to=tzungbi@kernel.org \
--cc=acpica-devel@lists.linux.dev \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dustin@howett.net \
--cc=groeck@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=mario.limonciello@amd.com \
--cc=matt.hartley@gmail.com \
--cc=paranjperajas@gmail.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=s.horvath@outlook.com.au \
--cc=sre@kernel.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