Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1907383rwr; Fri, 28 Apr 2023 03:36:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6k4dFMkDPEFbOSU9BukjVpyH8S1Esp+CQvhoyzNqqEtQa8u+IV2/8V7flSwZo9ok5allYC X-Received: by 2002:a17:90a:49ca:b0:23f:7649:f011 with SMTP id l10-20020a17090a49ca00b0023f7649f011mr5069096pjm.43.1682678218543; Fri, 28 Apr 2023 03:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682678218; cv=none; d=google.com; s=arc-20160816; b=pkC+JKJdchdJvtnZ4HiRhAbJLVlsTuvz3lK/dlEEeI23rdIVo6gM5QQtIuyECqhbhp LUiTB6hY0v/IdmAzUs1pVtmL0U3XgysQ+HbDFIASuPI2QfNVm1Qc55eW6wjc2oyOO+pD I/RA5V1Njs3J1twvdzFO7NrkOTBTEEnkvs/CATp+fb/GZF+aZIOQOJ2MiViYkwgQwK7N NDKFD11KyhMWz1tCQAJtvRYXXmNp4oSOzQIXHq1vdtwD41WZCrINrvPkAAFLQ0/8Hsz+ 4bIj3n0YB2hZMmsdBa2kESOJmaXAq2/2Xq8zeY3JtsQfSb7XWlbMGehfqGeq9xLwJGz3 PZ8Q== 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:from; bh=qrpDLoiV+jf21qupqATqx3VRymzm13/U1zdJnUSHNVE=; b=S9ZQHnqj9ywGZIqvZk9uEygpou0f5GyzEUlqSy9BPR4ih29EVMnMr9C1ddMP8UMJl2 ofNDGKNnL15+yod6q19jwfntm9N/LGzg6s15gAMuFiV3jtJ5v5w1CMYurM4fGPoYISF3 m96Ji3oD16UNh9xsGo2eFSmdocBJ9Wbc7HJlmpGTDGl+cPcBBfaytcImHNV/wXRj8TWL c6Wg5aLeoct+pseOn8qdgy2uZSJXHpc7zRd2vrG59nVZ05ThadGKJCPVqt9xkh4ZIxL1 ARXEHylDwPogCF7NMI14qFkYAguqRvsSUEFOgj4CXH2i2bsjUqiUOV1SKRd6J6NOpOsb 3Btg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a17090aa40600b0024675623f8esi1947189pjp.40.2023.04.28.03.36.44; Fri, 28 Apr 2023 03:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345982AbjD1KJi (ORCPT + 99 others); Fri, 28 Apr 2023 06:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345883AbjD1KJh (ORCPT ); Fri, 28 Apr 2023 06:09:37 -0400 Received: from harvie.cz (harvie.cz [77.87.242.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 809BC40F8; Fri, 28 Apr 2023 03:09:36 -0700 (PDT) Received: from anemophobia.amit.cz (unknown [31.30.84.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by harvie.cz (Postfix) with ESMTPSA id 418B618027D; Fri, 28 Apr 2023 12:09:34 +0200 (CEST) From: Tomas Mudrunka To: jeff@labundy.com Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, tomas.mudrunka@gmail.com Subject: [PATCH v3] Fix freeze in lm8333 i2c keyboard driver Date: Fri, 28 Apr 2023 12:09:25 +0200 Message-Id: <20230428100925.809527-1-tomas.mudrunka@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org LM8333 uses gpio interrupt line which is triggered by falling edge. When button is pressed before driver is loaded, driver will miss the edge and never respond again. To fix this we run the interrupt handler after registering IRQ to clear the interrupt via i2c command. Signed-off-by: Tomas Mudrunka --- drivers/input/keyboard/lm8333.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index 7457c3220..9a810ca00 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -184,6 +184,8 @@ static int lm8333_probe(struct i2c_client *client) if (err) goto free_mem; + lm8333_irq_thread(client->irq, (void *) lm8333); + err = input_register_device(input); if (err) goto free_irq; -- 2.40.0