From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Benson Leung" <bleung@chromium.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Lee Jones" <lee.jones@linaro.org>,
"Gwendal Grignou" <gwendal@chromium.org>,
"Yu-Hsuan Hsu" <yuhsuan@chromium.org>,
"Prashant Malani" <pmalani@chromium.org>,
linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 0/7] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes
Date: Tue, 1 Sep 2020 11:10:06 +0200 [thread overview]
Message-ID: <5fe68c6d-ae3d-e756-ca5d-873f3ca1cc45@collabora.com> (raw)
In-Reply-To: <20200822150857.205775-1-linux@roeck-us.net>
Dear all,
On 22/8/20 17:08, Guenter Roeck wrote:
> The EC reports a variety of error codes. Most of those, with the exception
> of EC_RES_INVALID_VERSION, are converted to -EPROTO. As result, the actual
> error code gets lost. In cros_ec_cmd_xfer_status(), convert all EC errors
> to Linux error codes to report a more meaningful error to the caller to aid
> debugging.
>
> To prepare for this change, handle error codes other than -EPROTO for all
> callers of cros_ec_cmd_xfer_status(). Specifically, no longer assume that
> -EPROTO reflects an error from the EC and all other error codes reflect a
> transfer error.
>
> v2: Add patches 1/4 to 3/4 to handle callers of cros_ec_cmd_xfer_status()
> v3: Add patches 4/6 and 5/6 to handle additional callers of
> cros_ec_cmd_xfer_status()
> Use -ENOPROTOOPT for EC_RES_INVALID_VERSION
> Implement function to convert error codes
> v4: Add coments describing the functionality of cros_ec_num_pwms().
> Add patch 7/7 to clean up cros_ec_num_pwms() after the new error code
> support has been implemented.
> Rebased series to v5.8.
> v5: If there is no error, cros_ec_cmd_xfer_status() needs to return the
> number of received bytes, not 0. While fixing that (in patch 6/7),
> rearranged the function to reduce its indentation.
> Rebased series to v5.9-rc1
>
> ----------------------------------------------------------------
> Guenter Roeck (7):
> iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code
> cros_ec_lightbar: Accept more error codes from cros_ec_cmd_xfer_status
> platform/chrome: cros_ec_sysfs: Report range of error codes from EC
> pwm: cros-ec: Accept more error codes from cros_ec_cmd_xfer_status
> platform/input: cros_ec: Replace -ENOTSUPP with -ENOPROTOOPT
> platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes
> pwm: cros-ec: Simplify EC error handling
>
> .../iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +-
> drivers/input/keyboard/cros_ec_keyb.c | 2 +-
> drivers/platform/chrome/cros_ec_lightbar.c | 10 ++--
> drivers/platform/chrome/cros_ec_proto.c | 57 +++++++++++++++++-----
> drivers/platform/chrome/cros_ec_sysfs.c | 24 ++++-----
> drivers/pwm/pwm-cros-ec.c | 37 +++++++-------
> 6 files changed, 78 insertions(+), 54 deletions(-)
>
I applied all the patches and queued for 5.10 in the chrome-platform tree. If at
some point we need to create an immutable branch I can provide it.
Thanks,
Enric
prev parent reply other threads:[~2020-09-01 9:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 15:08 [PATCH v5 0/7] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 1/7] iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 2/7] cros_ec_lightbar: Accept more error codes from cros_ec_cmd_xfer_status Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 3/7] platform/chrome: cros_ec_sysfs: Report range of error codes from EC Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 4/7] pwm: cros-ec: Accept more error codes from cros_ec_cmd_xfer_status Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 5/7] platform/input: cros_ec: Replace -ENOTSUPP with -ENOPROTOOPT Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 6/7] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-08-22 15:08 ` [PATCH v5 7/7] pwm: cros-ec: Simplify EC error handling Guenter Roeck
2020-09-01 9:10 ` Enric Balletbo i Serra [this message]
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=5fe68c6d-ae3d-e756-ca5d-873f3ca1cc45@collabora.com \
--to=enric.balletbo@collabora.com \
--cc=bleung@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=pmalani@chromium.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=yuhsuan@chromium.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;
as well as URLs for NNTP newsgroup(s).