Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCFF0C433ED for ; Tue, 18 May 2021 08:55:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9357F61364 for ; Tue, 18 May 2021 08:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347601AbhERI4W (ORCPT ); Tue, 18 May 2021 04:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:60642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240325AbhERI4V (ORCPT ); Tue, 18 May 2021 04:56:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE0986135B; Tue, 18 May 2021 08:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621328104; bh=pzxfb66QN2ANJJUwd1jPAEiSOUrGsJN1z35uOPl5HJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=erzd/c0nbLs8HowykFsNM57r/bRC6gm+xcvL2re0NReaVr+fpzogn9ty42YGboYr6 XjeD0Jc6GCAUmbJUbFxBSvU7t/9G5z0BbRViQUywS2n7Zb0JiB1+IIkCAcHyHkuw4G W7kirNhxEg/14KsHns/DFmFEkRL+KMtE5mlEUh+s= Date: Tue, 18 May 2021 10:55:02 +0200 From: Greg KH To: Patryk Duda Cc: stable@vger.kernel.org Subject: Re: [PATCH] platform/chrome: cros_ec_proto: Send command again when timeout occurs Message-ID: References: <20210518084823.14392-1-pdk@semihalf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518084823.14392-1-pdk@semihalf.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Tue, May 18, 2021 at 10:48:23AM +0200, Patryk Duda wrote: > Sometimes kernel is trying to probe Fingerprint MCU (FPMCU) when it > hasn't initialized SPI yet. This can happen because FPMCU is restarted > during system boot and kernel can send message in short window > eg. between sysjump to RW and SPI initialization. > > Cc: # 4.4+ > Signed-off-by: Patryk Duda > --- > Fingerprint MCU is rebooted during system startup by AP firmware (coreboot). > During cold boot kernel can query FPMCU in a window just after jump to RW > section of firmware but before SPI is initialized. The window was > shortened to <1ms, but it can't be eliminated completly. > > Communication with FPMCU (and all devices based on EC) is bi-directional. > When kernel sends message, EC will send EC_SPI* status codes. When EC is > not able to process command one of bytes will be eg. EC_SPI_NOT_READY. > This mechanism won't work when SPI is not initailized on EC side. In fact, > buffer is filled with 0xFF bytes, so from kernel perspective device is not > responding. To avoid this problem, we can query device once again. We are > already waiting EC_MSG_DEADLINE_MS for response, so we can send command > immediately. > > Best regards, > Patryk > drivers/platform/chrome/cros_ec_proto.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.