Received: by 10.223.164.202 with SMTP id h10csp3254314wrb; Tue, 28 Nov 2017 08:27:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMY9HBWOUnrosso5b5lcjg06QpORqpDfBqALDosNh3LZiaGNdQD1rc3O3V6SY4NxnRfAUr/3 X-Received: by 10.84.143.34 with SMTP id 31mr23759697ply.82.1511886438355; Tue, 28 Nov 2017 08:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511886438; cv=none; d=google.com; s=arc-20160816; b=iabA708zFPbd/yDOIOod8wpZ8pUGdEnlA+aPbhxJXzZgz6WuNxjkpE47BqOoSfPAKu Sb+eTW0IayTr87SohynhgalXl3VHzWclh1arFe4BXOMPr2BGiJAZivHxG7pYnEON+6cJ KzTmQCXfNYP/eWO3yPmdy5Rk0cpJJ6Pljv/wdPB/4S8HKS0Ga8KlFzgoBMCZud0Q9UqU SWdIiTp81MUMY8p4kIunGQwpkbptr1pxmR2RqEVQjhzMCOR5ZALjhTK1KZbpMOoganv9 iRuPLMfu5S9Xj3fzNzHLlg4fOkmNYvBiidN8FM8MSGNEtSMSf4+0ygcNPK5gzLpZrH15 z77A== 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:arc-authentication-results; bh=TEt2rwhqDI0tUEtEvIFmSZl7U5nGk7aQBOESmR04KYk=; b=I4diR9inA5/mm4zG/HA/fO1/w4gjw3VS2e+TJTk6uoeSx3LiYycCYJDd/B1UQmaXEJ f3rEJ9qb2Si4knxIgCnJKvQmI/63a6l9SBxVUdUCw2nizMK5z5D+GdF3hx8aj5rG0h3a +QH2j9jcyzWPOJnpG9/4qtIs5/0tE+WZY3MTs/aWofqNSwMHPTGpLiasKxddqhC3e58d pCX1vYRfZ2iVKvOAy9UCvtZ7gyqB6GQai7WJtSNAc55ATw/AXJxOa0JEdGvt3UV6UJ8X 3Nvpt6cip4ZgbvxHM/zl9L9yjQeoslhwycPDgOS4LZx5rAwl3LmNLOpdmyMJUWix6Hhl KVXQ== ARC-Authentication-Results: i=1; mx.google.com; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si6408256pli.140.2017.11.28.08.27.06; Tue, 28 Nov 2017 08:27:18 -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; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753252AbdK1QZx (ORCPT + 77 others); Tue, 28 Nov 2017 11:25:53 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:15232 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbdK1QZv (ORCPT ); Tue, 28 Nov 2017 11:25:51 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Tue, 28 Nov 2017 08:25:44 -0800 Received: from HQMAIL104.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 28 Nov 2017 08:25:50 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 28 Nov 2017 08:25:50 -0800 Received: from UKMAIL101.nvidia.com (10.26.138.13) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 28 Nov 2017 16:25:50 +0000 Received: from [10.21.132.149] (10.21.132.149) by UKMAIL101.nvidia.com (10.26.138.13) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 28 Nov 2017 16:25:46 +0000 Subject: Re: [PATCH V2 1/2] mfd: cros ec: spi: Don't send first message too soon To: Lee Jones CC: , , "Brian Norris" , Shawn Nematbakhsh , Benson Leung , References: <1510670608-19594-1-git-send-email-jonathanh@nvidia.com> From: Jon Hunter Message-ID: <419f195f-8c38-5dd2-7742-3fff98d6795b@nvidia.com> Date: Tue, 28 Nov 2017 16:25:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1510670608-19594-1-git-send-email-jonathanh@nvidia.com> X-Originating-IP: [10.21.132.149] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) 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 Lee, On 14/11/17 14:43, Jon Hunter wrote: > On the Tegra124 Nyan-Big chromebook the very first SPI message sent to > the EC is failing. > > The Tegra SPI driver configures the SPI chip-selects to be active-high > by default (and always has for many years). The EC SPI requires an > active-low chip-select and so the Tegra chip-select is reconfigured to > be active-low when the EC SPI driver calls spi_setup(). The problem is > that if the first SPI message to the EC is sent too soon after > reconfiguring the SPI chip-select, it fails. > > The EC SPI driver prevents back-to-back SPI messages being sent too > soon by keeping track of the time the last transfer was sent via the > variable 'last_transfer_ns'. To prevent the very first transfer being > sent too soon, initialise the 'last_transfer_ns' variable after calling > spi_setup() and before sending the first SPI message. > > Cc: > > Signed-off-by: Jon Hunter > Reviewed-by: Brian Norris > --- > Changes since V1: > - Added stable-tag and Brian's reviewed-by. > > Looks like this issue has been around for several Linux releases now > and it just depends on timing if this issue is seen or not and so there > is no specific commit this fixes. However, would be good to include for > v4.15. > > drivers/mfd/cros_ec_spi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c > index c9714072e224..a14196e95e9b 100644 > --- a/drivers/mfd/cros_ec_spi.c > +++ b/drivers/mfd/cros_ec_spi.c > @@ -667,6 +667,7 @@ static int cros_ec_spi_probe(struct spi_device *spi) > sizeof(struct ec_response_get_protocol_info); > ec_dev->dout_size = sizeof(struct ec_host_request); > > + ec_spi->last_transfer_ns = ktime_get_ns(); > > err = cros_ec_register(ec_dev); > if (err) { Can you queue this as a fix for v4.15-rc1? Cheers Jon -- nvpublic From 1584473784531988709@xxx Sun Nov 19 06:12:33 +0000 2017 X-GM-THRID: 1584053015570192756 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread