• G
    platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls · 57b888ca
    Guenter Roeck 提交于
    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: NDaisuke Nojiri <dnojiri@chromium.org>
    Reviewed-by: NBrian Norris <briannorris@chromium.org>
    Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: NTzung-Bi Shih <tzungbi@kernel.org>
    57b888ca
cros_ec_chardev.c 9.8 KB