Received: by 10.223.164.202 with SMTP id h10csp789242wrb; Tue, 14 Nov 2017 09:39:51 -0800 (PST) X-Google-Smtp-Source: AGs4zMaRlAaGA6qli/sUiLm41VfBpwuGApMxjXFfmER6kGcdaJNwJb2FBUb764nFVCxHbR/6iRf8 X-Received: by 10.101.83.70 with SMTP id w6mr12643814pgr.361.1510681191827; Tue, 14 Nov 2017 09:39:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510681191; cv=none; d=google.com; s=arc-20160816; b=p13sHlW1drYlO+45LkzLLhC38TK9IJ5Olffm68blmvBiBxfHt5GGvg+ndiQtANMmiI n8D/LkyTGtLtTvwKHZKMZMS13lDqLUuNIwoU1MW2tuURjR+m2jcwnhzKj5i4hdNqzYFD bR5ByO4RnsFv25jJNZ4SBi2mvaYI0zFbOrz6oMp6GAGVjOwZL5Kt60Fwy6oLAfHeKIXt Itno4Sc/UHfVYtjDgHi8Pa2cfyHqN17aI0ZdD2myLxwXVhLp8evW9P5dGAWjopNPr2nH M6nIdiqZ5ntGYP7k0eA/L6blHfMQzY8qCYIDNPnpEMB2uUr14kwhSXk92IeVioCNdtZG 2Jzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=rL7RBYJTRTUkHhIGQrX6bwMOoDEeAEK31QLsrf0ntF4=; b=nheUSem+MID9FlMkIPwafcPYrwCNeBXpnP0vFwt3cRhHhPr4zUshadVNGCzXQMAV+f 8p0FWUCG3r7F5zYPH2O3m+iVfxCfQZeQArzre/En+Ywmf1Byde2sxO9VerpPp1qgLcJ0 r24pTdf3JLJ/snjBpZ8ybc1bvAJokG+0njO49lSg5hUCpz9sJFPc2/6eux6NS6rMT1hT jjga+yWVWT1p0DAAWCGNFfYOd31FESCPegSarDU0tb4t247vOFs7wyGH9leT0HSui/yL zj1pJwQD+WfiTb+rN/tLPFnLp8KJTto/TaDarhYzapOYpEqS8LIr7vnumUn+eTLk+Rnr +uoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=oCdqRSeT; dkim=fail header.i=@chromium.org header.s=google header.b=a684Dw11; 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=fail (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 t11si4125669plm.360.2017.11.14.09.39.39; Tue, 14 Nov 2017 09:39:51 -0800 (PST) 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=fail header.i=@google.com header.s=20161025 header.b=oCdqRSeT; dkim=fail header.i=@chromium.org header.s=google header.b=a684Dw11; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755977AbdKNRBL (ORCPT + 88 others); Tue, 14 Nov 2017 12:01:11 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:53140 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755662AbdKNRBA (ORCPT ); Tue, 14 Nov 2017 12:01:00 -0500 Received: by mail-wr0-f193.google.com with SMTP id j23so18099990wra.9 for ; Tue, 14 Nov 2017 09:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rL7RBYJTRTUkHhIGQrX6bwMOoDEeAEK31QLsrf0ntF4=; b=oCdqRSeTchD1aLLihQBvbBec8SpuANCwLuRVydZ98qyfdYiU99luW3EkH1OgNLTnr/ 0vLefa00QdQ6NRy7cBv4TtegLh94x1V449zSxEywcHYX/hexXFrGklrPPQQbBejAyRhO 7+Oc19VBNwwIzAhtjaT56ES3qAxEic9bdaON8+gpk+sFICiNAAUNuc3ngG01wdFAM14L vkruH43aLeZBLf+Ze3weyXQGo/EHrwbpxcEoRA8s2cfE81LBBZfm50Ja4SyEpAz9bOcn WHLjmy6y6un7CG+I5YLGL4kOTBU27fxiR33T6fcv1Jn+gqY57XXleAGFlZgsngRCFKsU tSvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rL7RBYJTRTUkHhIGQrX6bwMOoDEeAEK31QLsrf0ntF4=; b=a684Dw11Tu1UpQhboIRjpjPkdWXWlkFq5F92mc8u4JyY4ygIqEBubQpx/vAZrJnuri K+wsqjoh5xZOL7w+7Kz7jofCFZHoP5hmab97xXrZD204UvMJrW3ad3rP5JVRfg0zdbIE H16RHukuuQK5xGFB9bI0TcXgOvTujw2DFWhnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rL7RBYJTRTUkHhIGQrX6bwMOoDEeAEK31QLsrf0ntF4=; b=kecCmA3i4JHhlSUPbyj92XKUTNK98LcS+5poROvwufTAl7za5MDOFtn1/4rL+gWCrE usjmw2nNUjAm9jBXn19tC7IKW65PAcKw5lCDNG95ChorzugaJahRELpwTcGakcFwahUB QaPs0nkL8pSr6eqmtGQFVEUvY5zi5ZWeaGYYZARMPCb+mc+bEfi998kuRMwRS0Orh2ZO lnog/+SWHmjj4ekaklgwHouP/ZJjZm/dfg4ht35FL9s+D+/HPiXIqC0naI4qGK9s4RZn kui8XiByPeCA9nm+P3SW8oooyS1LQRlMmEBkuCSFLfdFQPB0pg+oGaAyxOw+5T8VIzWQ SBkw== X-Gm-Message-State: AJaThX6F9d8XQCFmTdSeD904dDYavCzFh27UJQyxQR9s2I/tDZpKkE/k 9LpW5SyoBLHrxG+lSzMSCAgjt5kw56FqHKepAvtQqA== X-Received: by 10.223.139.73 with SMTP id v9mr11413232wra.77.1510678858312; Tue, 14 Nov 2017 09:00:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.127.150 with HTTP; Tue, 14 Nov 2017 09:00:57 -0800 (PST) In-Reply-To: <20170927221908.GA7699@google.com> References: <20170927213527.31416-1-shawnn@chromium.org> <20170927221908.GA7699@google.com> From: Shawn N Date: Tue, 14 Nov 2017 09:00:57 -0800 X-Google-Sender-Auth: G8BXICsQxEiDse0w8QrV3oa80Mo Message-ID: Subject: Re: [PATCH] mfd: cros ec: spi: Fix "in progress" error signaling To: Brian Norris Cc: linux-kernel@vger.kernel.org, Lee Jones , Jon Hunter , Benson Leung Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 27, 2017 at 3:19 PM, Brian Norris wrote: > On Wed, Sep 27, 2017 at 02:35:27PM -0700, 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(-) > > I'm still not sure I understand the full extent of the > originally-reported error (it's still likely a SPI transport issue?), > but I believe this patch is good anyway: > > Reviewed-by: Brian Norris Jon tracked down the root cause of the originally-reported error, but we should still land this patch, as it fixes error signaling that was previously broken. > > I wonder if we should tone down the BUG_ON()'s in drivers/mfd/cros_ec* > and drivers/platform/chrome/* too. That's basically a no-no these days, > as all of these type of things should be able to gracefully propagate > errors, no matter how "unlikely" it should be to see a crazy protocol > version number or a bad message length. From 1579733012745858952@xxx Wed Sep 27 22:20:01 +0000 2017 X-GM-THRID: 1579730367073760625 X-Gmail-Labels: Inbox,Category Forums