linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes
@ 2020-07-20 20:22 Guenter Roeck
  2020-07-20 20:22 ` [PATCH v2 1/4] iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code Guenter Roeck
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Guenter Roeck @ 2020-07-20 20:22 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: Benson Leung, Jonathan Cameron, linux-iio, linux-kernel,
	Yu-Hsuan Hsu, Prashant Malani, Guenter Roeck

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

----------------------------------------------------------------
Guenter Roeck (4):
      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
      platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes

 .../iio/common/cros_ec_sensors/cros_ec_sensors.c   |  2 +-
 drivers/platform/chrome/cros_ec_lightbar.c         | 10 +++---
 drivers/platform/chrome/cros_ec_proto.c            | 37 +++++++++++++++++-----
 drivers/platform/chrome/cros_ec_sysfs.c            | 24 ++++++--------
 4 files changed, 43 insertions(+), 30 deletions(-)

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

end of thread, other threads:[~2020-07-26 12:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 20:22 [PATCH v2 0/4] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-07-20 20:22 ` [PATCH v2 1/4] iio: cros_ec: Accept -EOPNOTSUPP as 'not supported' error code Guenter Roeck
2020-07-26 12:26   ` Jonathan Cameron
2020-07-20 20:22 ` [PATCH v2 2/4] cros_ec_lightbar: Accept more error codes from cros_ec_cmd_xfer_status Guenter Roeck
2020-07-20 20:22 ` [PATCH v2 3/4] platform/chrome: cros_ec_sysfs: Report range of error codes from EC Guenter Roeck
2020-07-20 20:22 ` [PATCH v2 4/4] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes Guenter Roeck
2020-07-21 11:29   ` Enric Balletbo i Serra
2020-07-21 14:11     ` Guenter Roeck
2020-07-21 14:23     ` Guenter Roeck
2020-07-22 21:52       ` Brian Norris
2020-07-22 22:01         ` Guenter Roeck
2020-07-22 22:03 ` [PATCH v2 0/4] " Brian Norris
2020-07-22 22:31   ` Guenter Roeck

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