Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp141169pxb; Tue, 12 Jan 2021 23:03:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSyV502XlNgSQvzNh4wkvjTNBcst64xgNQD1On8xpu2AnQqG6rmt0/+aZ+8HHy8PUPY4ey X-Received: by 2002:a17:906:4e52:: with SMTP id g18mr545490ejw.385.1610521414041; Tue, 12 Jan 2021 23:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610521414; cv=none; d=google.com; s=arc-20160816; b=yYozRXaCaWya64++0bjx89jiz3eQ9Ql7i6sUSY2CEaGbzW5J475FUt+lcafqpAAi9+ DyG8mLMlxO3joJwTuYOidRQzf78/TkpCtQXuGn/a0KfjP2gM97xGhb9ePT60/hU2lFs6 Pc2Bl5+f6vmqJWkMsLDMaHzYmv35CI86yj/OhwIxG1kuLe8I1wtaNN26+rvwrNhEWyKA hXKGjywU5wWTAITuG5MJR/fd2DzjXMSuBIEFjkGGw553QkgnT5W/QZgid03rSr7OodGd M1lZpiWjxnfSja75//w1NhfccO5Frn3LdPVzjnb84Zmm6DVLMX650SSoKRjvj6ACzHC0 Kp8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HwL4VtEmHEKSYqG0Wvuo3dQa7ufy0vjsTEWXXFOnu14=; b=TkxOUsbwNleVeL8xQUoMELzSuab5nnuNQ55hvKx15RlNa3YMLvrHLD3XwKBhn59nTI 6ux38tbGA9xwhmkjW5Fm8YboxqMMN3mbb0S2qH44W+Tca453pAjcnqMs29RxqHm7dvlF IMbZ2iuOlwdbfAUTPzrCZmWZYl63x1VhF0WA1LdZAqXozeILXZbeHrMrCtpA6/DfiO8m 6kGHi0NglKFIxrkFxi9IaDVMwpShW6u5nmDlQ7Wy+8Vj6gKgCtwBhh6UUCtZQJsZnqiJ AGbynV0pEGh7e9m3Z6NWRB1ObZzwV2Ms/ciCncnndkrQy1ujDro65xX8QZ5l1m0klR7Q D1nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CnqsXl9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si539756eds.556.2021.01.12.23.03.06; Tue, 12 Jan 2021 23:03:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CnqsXl9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbhAMG7e (ORCPT + 99 others); Wed, 13 Jan 2021 01:59:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbhAMG7d (ORCPT ); Wed, 13 Jan 2021 01:59:33 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45B08C061575 for ; Tue, 12 Jan 2021 22:58:53 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id g25so3043683wmh.1 for ; Tue, 12 Jan 2021 22:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HwL4VtEmHEKSYqG0Wvuo3dQa7ufy0vjsTEWXXFOnu14=; b=CnqsXl9UR6w85yvNdQL0vLBU7n+ka9WgCSzhuPnh63gS7svyKH9TbaWEdN008kdcgm nEhgm615vMhPE76ZyPVOrwE1graAlb0iSk8+QF2z9FoyUOnNSZvm4A5M7eqEtPSFu0nO tYbs95sfEvBTrTQ9QrnG4FegciWkcfnaCaa1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=HwL4VtEmHEKSYqG0Wvuo3dQa7ufy0vjsTEWXXFOnu14=; b=F7KmvhBFQwqgUI5q4czz5yLq1sfHchrHSImTIL97UMnGrw8RVvpO+W0Z5XFqWPdT/7 suigc1FZX6+piQYv7iQLs0tdL8EhZF+bW3X6bIrODR9fyBLyYmp6ZtuVc66EQNs1rg0/ D9xYtiqRVfIic5dbeStTIi85rh/uCzPsTzHSUx27QwUOTe7IWyk5qrK4qOo5vul8oS/C KerxFxNvDqc/dfv92PAbeBhp19Bsj+EVFBF/uXVSLiHtw9JMIvMbMzpjEP7HDEklwza8 28BAdB7pfvW485PP3ZAyCkmo+RIjv5QD47vAzRpy6h9NB63wWKvuqtPkKGfYMr6W0kBf uGBw== X-Gm-Message-State: AOAM533PYGOb9ln9sPc5BKQk3nuqLYkw+h3DoJYNJLoKZesOcG8Ngaft Y+0lDeYvajTTCVOqYA1C77/7GutPTmGDVt1j1G0e4w== X-Received: by 2002:a1c:a145:: with SMTP id k66mr694572wme.18.1610521131935; Tue, 12 Jan 2021 22:58:51 -0800 (PST) MIME-Version: 1.0 References: <20210107085942.2891525-1-yuhsuan@chromium.org> <20210107085942.2891525-2-yuhsuan@chromium.org> In-Reply-To: From: Yu-Hsuan Hsu Date: Wed, 13 Jan 2021 14:58:41 +0800 Message-ID: Subject: Re: [PATCH 2/2] ASoC: cros_ec_codec: Reset I2S RX when probing To: Enric Balletbo i Serra Cc: Linux Kernel Mailing List , ALSA development , "Gustavo A . R . Silva" , Takashi Iwai , Liam Girdwood , Guenter Roeck , Mark Brown , Prashant Malani , Pi-Hsun Shih , Benson Leung , Cheng-Yi Chiang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enric Balletbo i Serra =E6=96=BC 2021=E5=B9= =B41=E6=9C=8813=E6=97=A5 =E9=80=B1=E4=B8=89 =E4=B8=8A=E5=8D=8812:34=E5=AF= =AB=E9=81=93=EF=BC=9A > > 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 > > 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/17093= 3.html > v3: > https://patchwork.kernel.org/project/alsa-devel/patch/20210106050559.1459= 027-1-yuhsuan@chromium.org/ > v4: https://patchwork.kernel.org/project/alsa-devel/list/?series=3D410441 Sorry that I forgot to add version. Will add v5 in the next patch. Thanks! > > > --- > > 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_e= c_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 p= latform_device *pdev) > > } > > priv->ec_capabilities =3D r.capabilities; > > > > + /* Reset EC codec i2s rx. */ > > + p.cmd =3D EC_CODEC_I2S_RX_RESET; > > + ret =3D 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 app= ear 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 poss= ible now. Oh, I didn't notice it. Thanks for the remind. I will work on it. > > Thanks, > Enric > > > platform_set_drvdata(pdev, priv); > > > > ret =3D devm_snd_soc_register_component(dev, &i2s_rx_component_dr= iver, > >