[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABXOdTezM+N+kO=BYTggfDvCyqBtQzYzVEZtrd183VUYP6KwKA@mail.gmail.com>
Date: Thu, 2 Jul 2020 22:33:46 -0700
From: Guenter Roeck <groeck@...gle.com>
To: Yu-Hsuan Hsu <yuhsuan@...omium.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Tzung-Bi Shih <tzungbi@...gle.com>,
Cheng-Yi Chiang <cychiang@...omium.org>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Guenter Roeck <groeck@...omium.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Benson Leung <bleung@...omium.org>, alsa-devel@...a-project.org
Subject: Re: [PATCH] ASoC: cros_ec_codec: Log results when EC commands fail
On Thu, Jul 2, 2020 at 8:30 PM Yu-Hsuan Hsu <yuhsuan@...omium.org> wrote:
>
> Log results of failed EC commands to identify a problem more easily.
>
> Signed-off-by: Yu-Hsuan Hsu <yuhsuan@...omium.org>
> ---
> sound/soc/codecs/cros_ec_codec.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c
> index 8d45c628e988e..a4ab62f59efa6 100644
> --- a/sound/soc/codecs/cros_ec_codec.c
> +++ b/sound/soc/codecs/cros_ec_codec.c
> @@ -90,10 +90,17 @@ static int send_ec_host_command(struct cros_ec_device *ec_dev, uint32_t cmd,
> if (outsize)
> memcpy(msg->data, out, outsize);
>
> - ret = cros_ec_cmd_xfer_status(ec_dev, msg);
> + ret = cros_ec_cmd_xfer(ec_dev, msg);
This change isn't explained in the description.
Guenter
> if (ret < 0)
> goto error;
>
> + if (msg->result != EC_RES_SUCCESS) {
> + dev_err(ec_dev->dev, "Command %d failed: %d\n", cmd,
> + msg->result);
> + ret = -EPROTO;
> + goto error;
> + }
> +
> if (insize)
> memcpy(in, msg->data, insize);
>
> --
> 2.27.0.212.ge8ba1cc988-goog
>
Powered by blists - more mailing lists