Received: by 10.213.65.68 with SMTP id h4csp1591815imn; Mon, 26 Mar 2018 10:28:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELsittOPRUTrEB52G1lYJ1i4rpBOqfO5EX6O0z+B+PbHXwbNCGDQaKXm7QVZF4qy9tZbQqvA X-Received: by 2002:a17:902:7c95:: with SMTP id y21-v6mr18839067pll.170.1522085299366; Mon, 26 Mar 2018 10:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522085299; cv=none; d=google.com; s=arc-20160816; b=QF0cLTJcZeHEKim4sf1VacLtIb72HxKRljUBME98MaV5LCqUdNpTf2l3SN7P5KO9w+ oZiV3xbuTKSyU/XKVBZCqkL59q6WZxE5+PvBF12SN6Okc21n04iXkw0qXxAcxapftM3M 0ThKyEAK0CAgST7B3uAkIlg3VbXsvBt7RK/PpVHOWZqKwQ/nx8dp0tRhU/PmlG5b97bx FfHtDnVylIpQS1Y2F8aYcQtQlRfRY38TUILYs6xvVuH8GzpWjCGZmonQQNFxOedzok/5 /Vs99D0uG/JUpoQu8vxyIOaEBZawjwR9knC4t0XYtipBbVCCZQwN2dHuQLoTYpeF/zWd Do3w== 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=GXqMZa8IWvh481JIvwHNLgQi4+YgaTFM3PQpe62UKCE=; b=xBraD6YW6MRz6IsD+Qj5Tnjk6PxdrDs8Ts2BiHzmoNXVZYbcAUABh1E7ZIwLBZTmd/ NZpZZW0Uw7Lpe/6TFCFyICHMOxSQaq4HSK29tcC/MImjd87ME60xhlMxNePnKlp9mzuy aUQpdkSjzrPy65YK/jA6sVfh2X4CntLhw2st7nUW7HGt9r3PXpiQKBubhaz75ObRayFc 20dPRRHrgdCITz8n9W/eZayrTQFP0D1QjDKe9NN1F9P8P9zFtjLRsBmPQy/Ej2CoM+Gr OTzyNRtPNEPzG/IHkSjDyRBX+YyA7wZ7dmvlIr5HFqq2dZ3RfFUvLMafaTgpT1iAQEyM oFdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZmZ1eI0Y; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y38-v6si1941993plh.476.2018.03.26.10.28.02; Mon, 26 Mar 2018 10:28:19 -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=@chromium.org header.s=google header.b=ZmZ1eI0Y; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbeCZR1G (ORCPT + 99 others); Mon, 26 Mar 2018 13:27:06 -0400 Received: from mail-ot0-f171.google.com ([74.125.82.171]:40030 "EHLO mail-ot0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbeCZR1E (ORCPT ); Mon, 26 Mar 2018 13:27:04 -0400 Received: by mail-ot0-f171.google.com with SMTP id l12-v6so21476389otj.7 for ; Mon, 26 Mar 2018 10:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GXqMZa8IWvh481JIvwHNLgQi4+YgaTFM3PQpe62UKCE=; b=ZmZ1eI0YnTauCFKIjdS4HpwfQ5N9qJ4Ql2QU6hdaUGLlH9tb26VmS4uJ4ngFkEyber LZXDFdx9Qk0QK9RTAfi7tyGlcopX3T2WbzX1eCTzOzSk6RaH5lVRu215mgFsU9T5fOzd tGv8us8Vbe2MDiVXZ5JV3ZJ1/lBHuGdXFhvho= 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=GXqMZa8IWvh481JIvwHNLgQi4+YgaTFM3PQpe62UKCE=; b=bBkqsuUiiuMWaRiDpd8Khgo31e19KIqX/1+L1RiemOyIH+5PYdcZJaGNGiOBxA/sdP t60yGvA2N91G0xoGplLu0JE2UpQXBX9Ds8rN16XWckA5wkuHQrGmAdkofp3xfZoQCU/o GDrrKi2/0nx/eHeMnjnShuUPEzHFdxgNeygh8xUHLj7kqg+M9wr0bf4W5g7J/KpJfMpt bGXwwSxgKvBU26cL/Z5MfOXfnjDwcwBNvEhI7Rhgj+q0jFDbwc++HBgxfHkNnZNKqDlw ztRZKe+F9x/FPCEROJ1gKhloNgmh1xkJZ6b7Kys22EQiqSefsw5mzTCOBFgvF3UEpjWo +YoQ== X-Gm-Message-State: AElRT7F8VOLwdHTEQUBTaJTkKPM/Kv1okXG2vba96VP44SNeLIcK+n+A /a4s7u5Ua5Cfre1C9/c8hPqN0RyFp1M= X-Received: by 2002:a9d:4811:: with SMTP id c17-v6mr10725478otf.291.1522085224015; Mon, 26 Mar 2018 10:27:04 -0700 (PDT) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com. [209.85.218.52]) by smtp.gmail.com with ESMTPSA id h88-v6sm2469317oth.59.2018.03.26.10.27.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 10:27:02 -0700 (PDT) Received: by mail-oi0-f52.google.com with SMTP id u141-v6so16786115oif.1 for ; Mon, 26 Mar 2018 10:27:02 -0700 (PDT) X-Received: by 10.202.214.77 with SMTP id n74mr18007461oig.294.1522085221900; Mon, 26 Mar 2018 10:27:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:447d:0:0:0:0:0 with HTTP; Mon, 26 Mar 2018 10:26:41 -0700 (PDT) In-Reply-To: References: <20170927213527.31416-1-shawnn@chromium.org> <20171129121123.7zg63mjy7pufokg5@dell> From: Alexandru M Stan Date: Mon, 26 Mar 2018 10:26:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling To: Enric Balletbo Serra Cc: Lee Jones , Shawn Nematbakhsh , linux-kernel , jonathanh@nvidia.com, Brian Norris , Tomeu Vizoso , Doug Anderson 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 Hello Enric On Mon, Mar 26, 2018 at 9:48 AM, Enric Balletbo Serra wrote: > 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 Would it be possible for you to run "ectool version" on both your machines? Based on the code the EC is running we might have some hints on what the differences are. You can find both ectool and the code the ec runs on https://chromium.googlesource.com/chromiumos/platform/ec/+/firmware-veyron-= 6588.B. Though I would use ectool from the master branch. One thing I suspect is different is that veyron_minnie regularly polls an accelerometer, depending on the userspace you're running it's possible it unwedged itself with a few accelerometer requests.