Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2139048ybt; Fri, 3 Jul 2020 01:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbVDDSdkp3TIZ1uEeXvPIz/S+dvOp51ZTCZDCID+Anl3McBsONpf31/TscjRzm4GwgLmZD X-Received: by 2002:a50:f149:: with SMTP id z9mr40054349edl.167.1593765591927; Fri, 03 Jul 2020 01:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593765591; cv=none; d=google.com; s=arc-20160816; b=iYoccs5B4koHN7Cphp7Vq/RB4TXSSwX0IoKYrs05B9iPSay/nD4rtMjYqixxJfwtm0 sWVqIg+U7gVqwCx39jv4RIA2Bi1NRL5l+3U+JegiCGesSEuLkD/efwOuppnsCpASNrT9 LicYBX0k2QjY/YXuyguZ7v6XV74/FgkpI+KZ8MvEoHnTKoYoTc5mdFD12vyHs4jKFckN 0DwQG+JbEWoZrCsWb5TLRt+yntuuHpx8A39gXJj0nfpk56BmzN7citU5EBKoqs7dF0Hv k7zYXM6O0eYw5gRKcI4EzhLisqSmIWXbtPV1/Y2cJjTWV2eazddfMLn2HRQCx6/n/tX4 H/8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ahbRf5JVvVa/DQI/tfpeZWt1n3WoWm0FpUdKjhWjqa8=; b=CzcjGS4Vl7bDeEjShSG0CUAUyRJ3yK4YIKmvSgQ7tW3Jx7Ka8E28SlhJE06KV9ge44 kciCUU49hDXMaOE6NszC6Xp6mT/y+D/mPC3rdx7FYxZAAKenMsG6wwmrYu7oZkFNPevF K04tiHUTmegQMrPTs0jdXDOT0/i8QeSSoIl0QfH2tQ/sVDsrpZXbQjGpE66Fi4Q0s48W 1hHaV9igoBoBUV1aP1ggvkzeIqMqAvlBWMlKQsgZIsVmi4/4RE7e8dHuLolRwus7CLSs uEEKFL31DUs4bcAHCaI5C0ZTLwZjOOQye1ZlIjuMPVYB7jTVV4fR3ig/n4IWoyN6K8IA QiDg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si7519063ejr.532.2020.07.03.01.39.29; Fri, 03 Jul 2020 01:39:51 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726287AbgGCIid (ORCPT + 99 others); Fri, 3 Jul 2020 04:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725648AbgGCIic (ORCPT ); Fri, 3 Jul 2020 04:38:32 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E3ACC08C5C1 for ; Fri, 3 Jul 2020 01:38:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 820C12A62F6 Subject: Re: [PATCH v2] ASoC: cros_ec_codec: Log results when EC commands fail To: Yu-Hsuan Hsu , linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Tzung-Bi Shih , Mark Brown , Guenter Roeck , Benson Leung , Cheng-Yi Chiang References: <20200703071913.2358882-1-yuhsuan@chromium.org> From: Enric Balletbo i Serra Message-ID: <8d21fc0c-b43e-75a0-d5d4-ed4872ec92cb@collabora.com> Date: Fri, 3 Jul 2020 10:38:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200703071913.2358882-1-yuhsuan@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yu-Hsuan, Thank you for your patch On 3/7/20 9:19, Yu-Hsuan Hsu wrote: > Log results of failed EC commands to identify a problem more easily. > > Replace cros_ec_cmd_xfer_status with cros_ec_cmd_xfer because the result > has already been checked in this function. The wrapper is not needed. > Nack, we did an effort to remove all public users of cros_ec_cmd_xfer() in favour of cros_ec_cmd_xfer_status() and you are reintroducing again. You can do the same but using cros_ec_cmd_xfer_status(). In fact, your patch will not build on top of the upcoming changes. > Signed-off-by: Yu-Hsuan Hsu > --- > 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); > 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); > >