linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Yu-Hsuan Hsu <yuhsuan@chromium.org>, linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org,
	"Gustavo A . R . Silva" <gustavoars@kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Guenter Roeck <groeck@chromium.org>,
	Mark Brown <broonie@kernel.org>,
	Prashant Malani <pmalani@chromium.org>,
	Pi-Hsun Shih <pihsun@chromium.org>,
	Benson Leung <bleung@chromium.org>,
	Cheng-Yi Chiang <cychiang@chromium.org>
Subject: Re: [PATCH 2/2] ASoC: cros_ec_codec: Reset I2S RX when probing
Date: Tue, 12 Jan 2021 17:34:24 +0100	[thread overview]
Message-ID: <e6c33a5f-1765-7cb6-8479-ff049992f2b7@collabora.com> (raw)
In-Reply-To: <20210107085942.2891525-2-yuhsuan@chromium.org>

Hi Yu-Hsuan,

Thank you for the patch.

On 7/1/21 9:59, Yu-Hsuan Hsu wrote:
> It is not guaranteed that I2S RX is disabled when the kernel booting.
> For example, if the kernel crashes while it is enabled, it will keep
> enabled until the next time EC reboots. Reset I2S RX when probing to
> fix this issue.
> 
> Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>

If I am not mistaken this is the four version of this patchset (see [1]). Please
prefix your patches with the proper version and maintain a changelog for them,
otherwise makes difficult to follow all the discussions already done.

[1]
v1: https://lkml.org/lkml/2020/7/8/173
v2: https://mailman.alsa-project.org/pipermail/alsa-devel/2020-July/170933.html
v3:
https://patchwork.kernel.org/project/alsa-devel/patch/20210106050559.1459027-1-yuhsuan@chromium.org/
v4: https://patchwork.kernel.org/project/alsa-devel/list/?series=410441

> ---
>  sound/soc/codecs/cros_ec_codec.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c
> index f33a2a9654e7..28b3e2c48c86 100644
> --- a/sound/soc/codecs/cros_ec_codec.c
> +++ b/sound/soc/codecs/cros_ec_codec.c
> @@ -1011,6 +1011,13 @@ static int cros_ec_codec_platform_probe(struct platform_device *pdev)
>  	}
>  	priv->ec_capabilities = r.capabilities;
>  
> +	/* Reset EC codec i2s rx. */
> +	p.cmd = EC_CODEC_I2S_RX_RESET;
> +	ret = send_ec_host_command(priv->ec_device, EC_CMD_EC_CODEC_I2S_RX,
> +				   (uint8_t *)&p, sizeof(p), NULL, 0);
> +	if (ret)
> +		dev_warn(dev, "failed to EC_CODEC_I2S_RESET: %d\n", ret);
> +

My comment in the first version is still valid, I guess. This command was
introduced later and with an old firmware I suspect this message will appear on
every boot, right? So, to solve the issue and get rid of this warn you're forced
to upgrade the firmware. Would make sense to handle returned error value to warn
when the firmware needs to be updated and error and break when is really an error?

We have mapped ec error codes to linux error codes. So, it should be possible now.

Thanks,
 Enric

>  	platform_set_drvdata(pdev, priv);
>  
>  	ret = devm_snd_soc_register_component(dev, &i2s_rx_component_driver,
> 

  reply	other threads:[~2021-01-12 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  8:59 [PATCH 1/2] cros_ec_commands: Add EC_CODEC_I2S_RX_RESET Yu-Hsuan Hsu
2021-01-07  8:59 ` [PATCH 2/2] ASoC: cros_ec_codec: Reset I2S RX when probing Yu-Hsuan Hsu
2021-01-12 16:34   ` Enric Balletbo i Serra [this message]
2021-01-13  6:58     ` Yu-Hsuan Hsu
2021-01-07 13:54 ` [PATCH 1/2] cros_ec_commands: Add EC_CODEC_I2S_RX_RESET Mark Brown
2021-01-08  4:57   ` Yu-Hsuan Hsu
2021-01-12  0:42     ` Mark Brown
     [not found]       ` <CABXOdTc-HkVW7UuDLoWf2opVO1n-W2EF-E2hJEm_D6=2P32_qw@mail.gmail.com>
2021-01-12 14:10         ` Mark Brown
2021-01-12 16:40           ` Enric Balletbo i Serra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6c33a5f-1765-7cb6-8479-ff049992f2b7@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bleung@chromium.org \
    --cc=broonie@kernel.org \
    --cc=cychiang@chromium.org \
    --cc=groeck@chromium.org \
    --cc=gustavoars@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pihsun@chromium.org \
    --cc=pmalani@chromium.org \
    --cc=tiwai@suse.com \
    --cc=yuhsuan@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).