Received: by 10.213.65.68 with SMTP id h4csp511016imn; Tue, 27 Mar 2018 03:51:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELt9Dib8KrpgLDq1K9LJkhYSr84QbM2HlvE1KG0fy7CB8cAknKYU04AsR1vWfmLIuHJsU+lR X-Received: by 10.98.217.85 with SMTP id s82mr30266580pfg.208.1522147909598; Tue, 27 Mar 2018 03:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522147909; cv=none; d=google.com; s=arc-20160816; b=oYeJuIgnUk35Fir4O4cTGLtYRs2fcUdijlOVE6WXtpGxSAxp2soDQ6rM73I87lXm9z LnxCAu/AkQJJl9TIFeY0df3OHy239st0QMlFYAe8rn+HM1cD49W1jGJw9s0NTt7gtRxU sohz4U56klttvbxQ4eXL8zyQNd2Qu8eLzNx5VHAbZXbVICXLJ8/IPqxHzn41BV+5niWY WmQ9jpeayZDbeOy1OCPQARJb9u6DP5qJCE/jVKsHkSAo9XfMqSjuxp28VTnGjpl+sxsU AqFnMGWZ2YvXh4wQAoXz94sBuKHY8LYUPgLGiq0wQG5FWqBmIfz1QpXcCr2O94UnUTUM EMSg== 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=idFaisAKwaIgND3fAYvvdfbHdYnWM29WIbd02jgeR0U=; b=Fw29pvtr6ytsqm9tr42zuqm1GDpGy+8gx3ZMT1xsImoUA64MoxsS0lHHFaXbts4UoD Ksag+EYctN8DqzQl8I53j2GWkZJYe+W/T+u8Kc9et0Rqfu981zQ04iQPyIrJsV9pV5J+ 28iG70C/NKsdfbEo4JmeT2A6vkkKKDFnRsVIe1xiKkepwKdQiKONZP5YcnlvnT25WVST 85GgdI4WjnqgbD9BHlAEpAQc6heL9UKbuycRgJ5ck+pRIR0n3ZKABDF0kgNf+NPh16OT 2/5kuLvz3jOLEqRvmWoVv8eymaN164uXsZ1wOxHB069Z9d+YRZz2lSNr9kwYr0BABvli NIgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QFasnL72; 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 m190si690003pga.710.2018.03.27.03.51.35; Tue, 27 Mar 2018 03:51:49 -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=QFasnL72; 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 S1752086AbeC0KtX (ORCPT + 99 others); Tue, 27 Mar 2018 06:49:23 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:34434 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbeC0KtW (ORCPT ); Tue, 27 Mar 2018 06:49:22 -0400 Received: by mail-qt0-f196.google.com with SMTP id l18so7036064qtj.1 for ; Tue, 27 Mar 2018 03:49:21 -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=idFaisAKwaIgND3fAYvvdfbHdYnWM29WIbd02jgeR0U=; b=QFasnL72XbXIt1sZ9YSzGL2Gcqqj4EEFbPd4M3eXVe32FtFbeMYxZLwfBhdUzjgtZc dX5Yn+F7OZ7Eq2NVvdo59AQng47UeO+13UANRyrU+hRxNxx9t/M92HJJj3bLFA4JNPRl Xk10ypY1qkfyRxr6X7DTurBHWyNIpKfXigGmPcRJEbpIHO9dghegh358pvmMkG/dA63w tsTIt2uN1O+RJE8cIC3gE5DVAYOAv1qnh/kG3VpNwijxd5p3OHAnKhYaGyxgB3NUuNcs KoQuGv/gk8FhEGLKwwqVG+b1NyZjgnbNBINrSWaFcFKaPPibkr4P0936BXmVVxUoeiUy DmwQ== 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=idFaisAKwaIgND3fAYvvdfbHdYnWM29WIbd02jgeR0U=; b=TIl+rgc1abe7BNlOa9hOX3LVfEyIH6Su7Wx0rDTaPabiabsXxpqBlj9lLtxSqARsHF OfjNn3SVkCIs6zMI+RruskTAGDaFUl2K5s/QPAs/vuHT3xvnbE9CZN67ZT/hboXWt+7v z0WK3uLihJUWpjB4zojyN6fSXufUnHH/rsezefEdANfIJ0bci4zRMowPlhKQGm11pS2E wy/rE2g0aZ5lR4XcEbUTxSwyd8pVMCp4DjY/wzIuf17/DBT1cJNMAz21s0IJ/LVPkyRd uxgTYr46mvJSe5OkOaLSOpr70bRGEyccIeM2dCzlq78czofSOa2B7KwLA2PUI1P6T7me fORw== X-Gm-Message-State: AElRT7EOd1gZjyHAJYTn4g2oAnjP0ufcGADdAWednR0tzPlK2xuOHO1r JImpE3gmGTkOTdfRWRqWQPmTIg/kvWi8lMgwyEE= X-Received: by 10.200.42.37 with SMTP id k34mr47734083qtk.101.1522147761345; Tue, 27 Mar 2018 03:49:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.17.138 with HTTP; Tue, 27 Mar 2018 03:49:20 -0700 (PDT) In-Reply-To: References: <20170927213527.31416-1-shawnn@chromium.org> <20171129121123.7zg63mjy7pufokg5@dell> From: Enric Balletbo Serra Date: Tue, 27 Mar 2018 12:49:20 +0200 Message-ID: Subject: Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling To: Alexandru M Stan 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 Hi Alexandru 2018-03-26 19:26 GMT+02:00 Alexandru M Stan : > 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 pol= l >>>> 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. > I think that accessing to the ec console should give the same result, right= ? In such case here is: Veyron Minnie ( ASUS Chromebook Flip C100PA ) ------------------------------------------------------------------- Chip: stm stm32f07x Board: 0 RO: minnie_v1.1.2697-faafaa5 RW: minnie_v1.1.2712-242f6bd Build: minnie_v1.1.2712-242f6bd 2016-11-03 00:34:41 @build196-m2 Veyron Jaq ( Haier Mighty MP ) -------------------------------------------------------------------- Chip: stm stm32f07x Board: 0 RO: mighty_v1.1.2680-6727e1d RW: mighty_v1.1.2712-242f6bd Build: mighty_v1.1.2680-6727e1d 2015-03-24 01:12:48 @build290-m2 We're running the RW firmware and I just discovered that our jaq is a mighty (but I guess it's the same?) Thanks, Enric > You can find both ectool and the code the ec runs on > https://chromium.googlesource.com/chromiumos/platform/ec/+/firmware-veyro= n-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.