Re: [PATCH v2] platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls

From: Brian Norris
Date: Fri Mar 18 2022 - 21:22:19 EST


On Fri, Mar 18, 2022 at 09:54:22AM -0700, Guenter Roeck wrote:
> Commit 413dda8f2c6f ("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: 413dda8f2c6f ("platform/chrome: cros_ec_chardev: Use cros_ec_cmd_xfer_status helper")

Probably could use a Cc: <stable@xxxxxxxxxxxxxxx> in here, since this is
a user-space ABI regression. But these days, there's effectively no
difference vs. just a Fixes tag, because someone's bot will usually pick
it up.

> Cc: Daisuke Nojiri <dnojiri@xxxxxxxxxxxx>
> Cc: Rob Barnes <robbarnes@xxxxxxxxxx>
> Cc: Rajat Jain <rajatja@xxxxxxxxxx>
> Cc: Brian Norris <briannorris@xxxxxxxxxxxx>
> Cc: Parth Malkan <parthmalkan@xxxxxxxxxx>
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
> v2: Updated comments / return value description. No functional change.

Reviewed-by: Brian Norris <briannorris@xxxxxxxxxxxx>