• Guenter Roeck's avatar
    platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls · 57b888ca
    Guenter Roeck authored
    Commit 413dda8f ("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: 413dda8f ("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: default avatarDaisuke Nojiri <dnojiri@chromium.org>
    Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
    57b888ca
cros_ec_chardev.c 9.85 KB