Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1905742rwr; Fri, 28 Apr 2023 03:35:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4499GgsvUw/RE2ntEC+6+tuiqrH0OuMbeevwkzOiBLwKlctPZlrIJATNYj7dauE/6UFUau X-Received: by 2002:a17:902:d50c:b0:1a9:b0a3:f03a with SMTP id b12-20020a170902d50c00b001a9b0a3f03amr5584043plg.9.1682678125705; Fri, 28 Apr 2023 03:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682678125; cv=none; d=google.com; s=arc-20160816; b=KPrgLjyAYKhdXb2V9pEWPi7PfQIga45xOC4rHmHSmHgIdIAiufNcibXJrZxv2zDjuu St2nYhvPEGONkYwGoK3xRSZi/Gc/Tj+jWg1mzq6hiXfh5/nmimsf89turfZcxvsJDPHW N/eYHZlEnRYTiq1vZPAOuhDfy6alc3wyVnYC6uXE7bHSi939AOYF4YXPJzl0horOt7VG k1ToTxsATiLiZJul2HlQ8uWJTX3vOdMKuwt2K26SXhonWpHJv4pa9khixiV+ahZIdTxc d85+Ax9D0KKaluYlwG/ZhyUmDRY5d9MSTr9gNZDPKXfbYW5brOUiJDd86++XlrWLYmzQ WmEA== 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=3NUDkpsZt9byq/m57k1qVLnshS9cu2YiC8Dva8HP4f8=; b=JcEGvMzz2ZFgXfJqXa/WjIZPSjrILi7FDBwnUBDs9gGvzoolc6BF4x7z/flviwlkeQ Z+pbfp0kc56Vc7QIS6F2ldu7QbGMSoEj5aWT7DCBgkFGZeuQUXCjZvA8j6Vv8fXxRSZ+ 98Z9o/xnVK+Rq+2686WMl9w7a8tiMPoFQtYM90gIqb/koc6m9Yq3UATryMc9D46U7RaH M3Wh+VN3lzh2OeZXHj0U1qPZyC6qi+WMQaSAZHjnJ58XV1pe8Lf9tnHW72+gsYjWtIW4 +d4K/NrPjB5QLQYAwnosTLV1LDRQrxr0+xbPIyFNlzrsgnu1DL8c9+z7Ce3MU1c5HHEb fL0w== 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 x4-20020a170902a38400b001a66c2f479asi20417927pla.219.2023.04.28.03.35.12; Fri, 28 Apr 2023 03:35:25 -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 S1345956AbjD1KUY (ORCPT + 99 others); Fri, 28 Apr 2023 06:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345477AbjD1KUW (ORCPT ); Fri, 28 Apr 2023 06:20:22 -0400 Received: from harvie.cz (harvie.cz [77.87.242.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 73CC819A5; Fri, 28 Apr 2023 03:20:21 -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 A126F18027D; Fri, 28 Apr 2023 12:20:20 +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 v4] Fix freeze in lm8333 i2c keyboard driver Date: Fri, 28 Apr 2023 12:20:15 +0200 Message-Id: <20230428102015.810686-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, lm8333); + err = input_register_device(input); if (err) goto free_irq; -- 2.40.0