linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes
@ 2020-07-26 22:00 Guenter Roeck
  2020-07-26 22:00 ` [PATCH v3 1/6] iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code Guenter Roeck
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Guenter Roeck @ 2020-07-26 22:00 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: Jonathan Cameron, Benson Leung, Dmitry Torokhov, Thierry Reding,
	Uwe Kleine-König, Gwendal Grignou, Brian Norris, linux-iio,
	linux-kernel, linux-input, linux-pwm

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

----------------------------------------------------------------
Guenter Roeck (6):
      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

 .../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            | 52 +++++++++++++++++-----
 drivers/platform/chrome/cros_ec_sysfs.c            | 24 ++++------
 drivers/pwm/pwm-cros-ec.c                          | 21 ++++++---
 6 files changed, 71 insertions(+), 40 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-08-02 20:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 22:00 [PATCH v3 0/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-07-26 22:00 ` [PATCH v3 1/6] iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code Guenter Roeck
2020-07-26 22:00 ` [PATCH v3 2/6] cros_ec_lightbar: Accept more error codes from cros_ec_cmd_xfer_status Guenter Roeck
2020-07-26 22:00 ` [PATCH v3 3/6] platform/chrome: cros_ec_sysfs: Report range of error codes from EC Guenter Roeck
2020-07-26 22:00 ` [PATCH v3 4/6] pwm: cros-ec: Accept more error codes from cros_ec_cmd_xfer_status Guenter Roeck
2020-07-27  8:35   ` Thierry Reding
2020-08-01  7:21   ` Uwe Kleine-König
2020-08-01 16:32     ` Guenter Roeck
2020-08-02 20:27       ` Uwe Kleine-König
2020-07-26 22:01 ` [PATCH v3 5/6] platform/input: cros_ec: Replace -ENOTSUPP with -ENOPROTOOPT Guenter Roeck
2020-07-30  4:53   ` Dmitry Torokhov
2020-07-26 22:01 ` [PATCH v3 6/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-07-29 22:21   ` Brian Norris
2020-07-29 23:22     ` Guenter Roeck
2020-07-29 23:29       ` Brian Norris
2020-07-29 22:27 ` [PATCH v3 0/6] " Brian Norris

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).