Received: by 10.213.65.68 with SMTP id h4csp1556410imn; Mon, 26 Mar 2018 09:49:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx48stCyH6gEJC9SIjn4974ZPgEYQsmN0h/hDP3cMrAsDvwWKtrCDLB6Ksr3BDutRmotiG8U7 X-Received: by 2002:a17:902:b10c:: with SMTP id q12-v6mr690855plr.399.1522082969793; Mon, 26 Mar 2018 09:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522082969; cv=none; d=google.com; s=arc-20160816; b=vm1iFX2xuDKeX9GI9IADKRqo21sWMAVpzbucqq2f+262iDECtDKjXd8isMVVnvDTn8 kKt6zwjxiq5Ud696iBJWNNva9ZlTfrUgBSAvp5kBdami05ygdLXQhj2boW3Y8XWfFeRB 0mZRdxfv7axs270ayqrrhz6I+9J0tTNxIl3XHfrPqmn8c7GIalmPoHdoSVj+65yp/+4y g59WHlWEb07qMW8txif/NFGNUhHIiulJazfawAVGt1lZb+AtGhbiz87YdRmgglKplTN5 86mj8zYVoLDwPeu6A7YHVC5rdpVSqUZiQGopRTYPQg8aMIDootIoNF3aRhicMIh9tAjB ExTA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=WpZrgTUOq3ccZtaoDiE5vv/MrZoO8nwo7n4f/PJfPKc=; b=lwUDutP+TIsK8O6/Dg29WUb4bTS1WyXWgW319BUdbi4RyJeSoNlK+LLGk7J/8zd0nU U9+vdkzltiJO6lk3rSYwgDMpEeHEaf1vISELqDedfze+jd8dRlFtlgquUcAQSyTMvPT6 FJUc8VtTGlp/355iWYOp3tQhJDTAJsd7DHJ3T2tonRos3MChrVcWLnw8UWHadHlf0uh2 Qli/pzO9hBjgLQUgikUKsUv8PYoRdyK4SyjP0rdJWr8ow5G3GUC18bhpFV0iFFoLz5ho wR0E64U0trhOgHLCcKDVx7ypXdcYD2MUQ4JzF3epdpsCPgnIYqQy/kVWMWl7VYyAyk2Y UkRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ed/8qkmt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si11636831pfh.101.2018.03.26.09.49.13; Mon, 26 Mar 2018 09:49:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ed/8qkmt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbeCZQsI (ORCPT + 99 others); Mon, 26 Mar 2018 12:48:08 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:38343 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbeCZQsH (ORCPT ); Mon, 26 Mar 2018 12:48:07 -0400 Received: by mail-qk0-f193.google.com with SMTP id 132so20813982qkd.5 for ; Mon, 26 Mar 2018 09:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=WpZrgTUOq3ccZtaoDiE5vv/MrZoO8nwo7n4f/PJfPKc=; b=ed/8qkmt2MpnWkw4n5VPFAboAdjw9s7y5A87wfdpPSCaHQxIxjNv8VPss65DB4f+ji IEypZ8XuyJd1E8mLP4BC1kJ3MirbJJWeAt4uuwDT1FNc3KRFd/fakBv1Bok6R/Ys2Sl+ SIcmnADmMHiGRIk+ZtselbgdPSD1pGKLGn2PKIFeBobAMhXiUAojOuC4P+E2TE1iWaQf lhVwdKReoKF3g5WTGeyMUNNMNTACAfnf3CRb7eIfLZIiwr7c714DggQF7b1jqZNwSgai Pb8nlH/06VgzFonaxPeZf9IOR0/XqQszUBTaNzIQlQdcqjCe3z6zWqDr3u7mF/mIb6tu Qetw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=WpZrgTUOq3ccZtaoDiE5vv/MrZoO8nwo7n4f/PJfPKc=; b=LqpzvrasRYcVMyzSEfeCMMoQqTXGe6u/vlzbZUAA3t2XzYd+lRdxtAkHGqLM4NyEDQ 2+eH4ZCeRnafFppBkBdklGr+Ms/yFRnv+EIjDtTR8uDaf7kMOqdMEz8RMKqFUVvAQOE4 V6SqIiX42aGDbH7h1ZZWcokDa++2pY1VjcWb0kFm5TEWcxOLxznPUB8k3zYqX83Gc/og TyoGzaN43RCLl1hGsTO2pB2w/wxx0yVYVJZLIEtdqkAQXdBW5+74uwXGDypDrAh9TzBX XW+eVhIA0Z63i+HQsPV9H2cQAJCiYPQ85CfwB7MkUYaoce8R5fxfkpVsUpxvNDXv/PPO cO/A== X-Gm-Message-State: AElRT7EKh29kNE0QcC5KcnSibszNl8ip1C2etNPlpzROpUr9/mx6HRyG ZazPTYsKW4sJwGkAYZszzi1iPrU/VEH5rY3hfep7h73a X-Received: by 10.55.159.201 with SMTP id i192mr55469280qke.125.1522082886995; Mon, 26 Mar 2018 09:48:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.17.138 with HTTP; Mon, 26 Mar 2018 09:48:06 -0700 (PDT) In-Reply-To: <20171129121123.7zg63mjy7pufokg5@dell> References: <20170927213527.31416-1-shawnn@chromium.org> <20171129121123.7zg63mjy7pufokg5@dell> From: Enric Balletbo Serra Date: Mon, 26 Mar 2018 18:48:06 +0200 Message-ID: Subject: Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling To: Lee Jones Cc: Shawn Nematbakhsh , linux-kernel , jonathanh@nvidia.com, Brian Norris , Tomeu Vizoso , Doug Anderson , Alexandru M Stan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear all, Cc'ing some more chromium folks. 2017-11-29 13:11 GMT+01:00 Lee Jones : > On Wed, 27 Sep 2017, Shawn Nematbakhsh wrote: > >> For host commands that take a long time to process, cros ec can return >> early by signaling a EC_RES_IN_PROGRESS result. The host must then poll >> status with EC_CMD_GET_COMMS_STATUS until completion of the command. >> >> None of the above applies when data link errors are encountered. When >> errors such as EC_SPI_PAST_END are encountered during command >> transmission, it usually means the command was not received by the EC. >> Treating such errors as if they were 'EC_RES_IN_PROGRESS' results is >> almost always the wrong decision, and can result in host commands >> silently being lost. >> >> Reported-and-tested-by: Jon Hunter >> Signed-off-by: Shawn Nematbakhsh >> --- >> drivers/mfd/cros_ec_spi.c | 52 ++++++++++++++++++++++------------------= ------- >> 1 file changed, 24 insertions(+), 28 deletions(-) > > Applied, thanks. > This patch is a bit old and is already applied but I would like to discuss an issue that Tomeu found playing with kernelci and a Veyron Jaq attached to our lab. Seems that after this patch, the veyron jaq spits out lots of spi tranfer error messages. See full log here [1] cros-ec-spi spi0.0: spi transfer failed: -121 cros-ec-spi spi0.0: Command xfer error (err:-121) cros-ec-i2c-tunnel ff110000.spi:ec@0:i2c-tunnel: Error transferring EC i2c message -121 The issue is random, not always happens, but when happens makes cros-ec unusable. Reproduce the issue is easier if CONFIG_SMP is not set. What happens is that the master starts the transmission and the cros-ec returns an spi error event (EC_SPI_RX_BAD_DATA - data is 0xfb). The difference between after and before the patch is that now the cros-ec does not recover, whereas without this patch after some tries it succeeds (note that before the patch the affected code returned -EAGAIN whereas now returns -EREMOTEIO) I think that reverting this patch is NOT the solution, but I don't have enough knowledge yet to understand why the cros-ec fails. I need to look at the cros-ec firmware to understand better what is happening, but meanwhile, thoughts? clues? An important note is that I did not reproduce the issue on a Veyron Minnie, even with CONFIG_SMP disabled. [1] https://lava.collabora.co.uk/scheduler/job/1085493#L905 Best regards, Enric > -- > Lee Jones > Linaro STMicroelectronics Landing Team Lead > Linaro.org =E2=94=82 Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog