linux-stable/drivers/platform/chrome
Guenter Roeck 5278ad676f platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls
[ Upstream commit 57b888ca25 ]

Commit 413dda8f2c ("platform/chrome: cros_ec_chardev: Use
cros_ec_cmd_xfer_status helper") inadvertendly changed the userspace ABI.
Previously, cros_ec ioctls would only report errors if the EC communication
failed, and otherwise return success and the result of the EC
communication. An EC command execution failure was reported in the EC
response field. The above mentioned commit changed this behavior, and the
ioctl itself would fail. This breaks userspace commands trying to analyze
the EC command execution error since the actual EC command response is no
longer reported to userspace.

Fix the problem by re-introducing the cros_ec_cmd_xfer() helper, and use it
to handle ioctl messages.

Fixes: 413dda8f2c ("platform/chrome: cros_ec_chardev: Use cros_ec_cmd_xfer_status helper")
Cc: Daisuke Nojiri <dnojiri@chromium.org>
Cc: Rob Barnes <robbarnes@google.com>
Cc: Rajat Jain <rajatja@google.com>
Cc: Brian Norris <briannorris@chromium.org>
Cc: Parth Malkan <parthmalkan@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:26:01 +02:00
..
wilco_ec
chromeos_laptop.c
chromeos_pstore.c
chromeos_tbmc.c
cros_ec.c platform/chrome: cros_ec: fix error handling in cros_ec_register() 2022-06-09 10:26:01 +02:00
cros_ec.h
cros_ec_chardev.c platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls 2022-06-09 10:26:01 +02:00
cros_ec_debugfs.c platform/chrome: cros_ec_debugfs: detach log reader wq from devm 2022-05-25 09:59:01 +02:00
cros_ec_i2c.c
cros_ec_ishtp.c HID: intel-ish-hid: fix module device-id handling 2021-11-11 22:45:40 +01:00
cros_ec_lightbar.c
cros_ec_lpc.c platform/chrome: cros_ec: Fix spelling mistake "responsed" -> "response" 2021-09-30 10:09:47 +02:00
cros_ec_lpc_mec.c platform/chrome: cros_ec_lpc: Use DEFINE_MUTEX() for mutex lock 2021-04-21 10:00:30 +02:00
cros_ec_lpc_mec.h
cros_ec_proto.c platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls 2022-06-09 10:26:01 +02:00
cros_ec_rpmsg.c
cros_ec_sensorhub.c platform/chrome: cros_ec_sensorhub: simplify getting .driver_data 2021-09-27 09:18:58 +02:00
cros_ec_sensorhub_ring.c platform: chrome: Split trace include file 2022-04-08 13:58:51 +02:00
cros_ec_sensorhub_trace.h platform: chrome: Split trace include file 2022-04-08 13:58:51 +02:00
cros_ec_spi.c
cros_ec_sysfs.c
cros_ec_trace.c
cros_ec_trace.h platform: chrome: Split trace include file 2022-04-08 13:58:51 +02:00
cros_ec_typec.c platform/chrome: cros_ec_typec: Check for EC device 2022-04-08 13:58:58 +02:00
cros_ec_vbc.c
cros_kbd_led_backlight.c
cros_usbpd_logger.c
cros_usbpd_notify.c platform/chrome: cros_ec_proto: Add version for ec_command 2021-09-30 10:09:47 +02:00
Kconfig
Makefile platform: chrome: Split trace include file 2022-04-08 13:58:51 +02:00