Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6818755pxb; Wed, 17 Feb 2021 14:32:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYEn5tJccYUh4TVqiCoky37lwe9qBYxuNRwnIqN6epYezx39SL5jkPOyWkQ9QeHVuhEYKN X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr981279edb.243.1613601145210; Wed, 17 Feb 2021 14:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613601145; cv=none; d=google.com; s=arc-20160816; b=SKFkN5HR+YZrj/fFvL0dYde5Wo+jOwAT3ReQ4jlf68+Fz28Bl4xte+LzqcPuOt7VAv HY1HypoF6lFbaOKUwcI3V0yxZdfvUyXe8wzCmtZlC2bww/2NKtrjOW8Du5g64/MpZVbo YVYD96qc6aYdhGTMKNZcGrA3TvIZsUZXTCe71Shu/9asJK8MbmOVDPB/Zx/ea7BSO4x6 uFiiLKPDgWipV7c2H0Nj2XRGJCiG9Pbx8XBkR6wsFVMOFFdVqw8NWb8WzQIYH8dpq3fI esFOZn40FgOmvKyl/JhfAes4s8EOfGFIsa24Xnm9QkSOwAsbn4HUItMxA0Q53XtMXvbn A+sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-filter:from; bh=qcHkDiWeuZJwaE8KC5P4fY1TNb7Og+nXRokLCY5UEZY=; b=UYs8dRRvWZoQudj4bYq/LhUqsOSTlk0erbq7OI1r5oCZW/WBtWwOD8zVkcmCECJIRL h6QCVBwbn3ogdACz1K4EPuUoMWr7K0yWnq7PTZvheDDweWCT1O0KPPfp+yvq3OULJPlS ZK8duvlJAp2isStaiamoMOjqReBB8quk/2tUrroknI2OSnaelPZguL41Fjo+2VnYIuaM 6eHWxGHc4roh/umQzyMIg5DlaJkiF+EKdCEhrzt20EjGY/41e/FBsyWf1sW6WFY4oigi cqbuyh9qL1btpm7CWPGyptgmykN4bYoqwxUQqT7FxgTl8Uw1wlGcwhQtPNnmpAF6TYUC Ugww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=fn87dt6i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb10si2253689ejc.75.2021.02.17.14.32.01; Wed, 17 Feb 2021 14:32:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=fn87dt6i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbhBQTTS (ORCPT + 99 others); Wed, 17 Feb 2021 14:19:18 -0500 Received: from ec2-44-228-98-151.us-west-2.compute.amazonaws.com ([44.228.98.151]:58882 "EHLO chill.innovation.ch" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232548AbhBQTTN (ORCPT ); Wed, 17 Feb 2021 14:19:13 -0500 Received: from localhost (localhost [127.0.0.1]) by chill.innovation.ch (Postfix) with ESMTP id 9600C1B6411; Wed, 17 Feb 2021 19:07:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at chill.innovation.ch Received: from chill.innovation.ch ([127.0.0.1]) by localhost (chill.innovation.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6nrywUIMZ8Du; Wed, 17 Feb 2021 19:07:31 +0000 (UTC) From: =?UTF-8?q?Ronald=20Tschal=C3=A4r?= DKIM-Filter: OpenDKIM Filter v2.11.0 chill.innovation.ch E8A221B640F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=innovation.ch; s=default; t=1613588851; bh=qcHkDiWeuZJwaE8KC5P4fY1TNb7Og+nXRokLCY5UEZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fn87dt6iKXKD/mZFkNdDq702zSjtc8dJjGOULqt1mchETIXEIRPxLPqht9FhdJp0a vtQrCDZ+La77bSTBMsdK26hb3ymmblOPAEY32vmIZheYJXm93yDwTQAqCVnQCXTcFU A8HQUTOLsf2SC3rR0dZHV+P4OTs2NliMurUv1LuLA7H9DnK5nD7GjpHN27uuyCgQno QrJWfTFsnBruRUWHKEct+CTa+Gm0VeqqfsmeC1nUXJuJQA+vSBtdXwLK1mqti0da7F br0Zoo+9IuPdTVdAao0Sjnkg3cHaf37usfl8jp2xSlSuXJvOWrGgTORLxEth3KSfbQ /l0G6Vr7jvw7Q== To: Dmitry Torokhov Cc: "Gustavo A. R. Silva" , Sergiu Cuciurean , Lee Jones , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] Input: applespi: Fix occasional crc errors under load. Date: Wed, 17 Feb 2021 11:07:17 -0800 Message-Id: <20210217190718.11035-2-ronald@innovation.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210217190718.11035-1-ronald@innovation.ch> References: <20210217190718.11035-1-ronald@innovation.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For some reason, when the system is under heavy CPU load, the read following the write sometimes occurs unusually quickly, resulting in the read data not being quite ready and hence a bad packet getting read. Adding another delay after reading the status message appears to fix this. Signed-off-by: Ronald Tschalär --- drivers/input/keyboard/applespi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index 8494bf610fd70..f0a0067c48ff6 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -749,6 +749,8 @@ static void applespi_async_write_complete(void *context) applespi->tx_status, APPLESPI_STATUS_SIZE); + udelay(SPI_RW_CHG_DELAY_US); + if (!applespi_check_write_status(applespi, applespi->wr_m.status)) { /* * If we got an error, we presumably won't get the expected -- 2.26.2