Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp973614rwr; Wed, 3 May 2023 08:34:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4H+780WGEtIMTKapfxcYWFDxRVregDJ7E3XBk+mZKoyIOsjGcy+Pw+YOmFF62RAX7f4Q0E X-Received: by 2002:a05:6a20:548e:b0:f6:7bb8:c8e5 with SMTP id i14-20020a056a20548e00b000f67bb8c8e5mr8650700pzk.6.1683128048416; Wed, 03 May 2023 08:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683128048; cv=none; d=google.com; s=arc-20160816; b=M4u8Zjuxks+w5TaGrBv0Vc7gsgLw/+3LopTjHMlF/JcQXZ+j5lpooTdgib6xImbHon u7Vzi7nADxi/cfpDLDRPUGQ9FSDn0lyA3Rqb8q6D0Y2frXpq4vpIoITkE/qXXv52rRwU ZgoPcPYh0YRR8V6u3kzXAA88ijW721pn4zNYZICiBX/S7KnoFjVqaap1Rqi559m4y7EG DZ4f+AKLV+iROoJii+b5psPC+nR7YSjZ2LmQ6/JLslI8PF9rXwVqj/9RrXQrrONHgwRf ulg6Xq0LXP8ox/S9lrd1VdrvgJhQ+cq9dgDpYMfTSSwdCipLmHiUClYaqOHjEuFhLC0R 8g9w== 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=oK2D4Q/JXYurPEW+XQZMGUYdhIsYqZiR+pGROcGdaJs=; b=i+mt4e+F+Bf7Ql8a41KLJlY3HLqIBq3dhUuBKblvJZUPrN8aW7WLGo8s+yZyraODMa 3Cess1A11zbJj9TSmljml4mDz+cAxaNqA/GG5yBtABA6iwE+ENM6zHRNfa2DbRkdDXCr m7RrFDT027OD9SmJ/82D+AA8KLl52dr7R8xpw2py7OzjhdOgdXWh/HAbcIuWMoJSpmZJ 9GikMi3inB+KPn8KtBLmZ9vHZUrzkSwIuCKk8PqzN57PVl2wuoSw2kx+JTa8xkdLOpQ0 QFBs6YZOGNCtxVYWgRlAhTnelIC/ONRHAvYh9+Pr61PhxN4qA1g9RyFb/mgkCOlH04KK l80w== 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 n127-20020a632785000000b0051b7f0d0df3si36311438pgn.895.2023.05.03.08.33.56; Wed, 03 May 2023 08:34:08 -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 S230491AbjECPco (ORCPT + 99 others); Wed, 3 May 2023 11:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbjECPcm (ORCPT ); Wed, 3 May 2023 11:32:42 -0400 Received: from harvie.cz (harvie.cz [77.87.242.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 580E45271; Wed, 3 May 2023 08:32:40 -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 9F8EA1800F6; Wed, 3 May 2023 17:32:37 +0200 (CEST) From: Tomas Mudrunka To: tomas.mudrunka@gmail.com Cc: dmitry.torokhov@gmail.com, jeff@labundy.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5] Fix freeze in lm8333 i2c keyboard driver Date: Wed, 3 May 2023 17:32:31 +0200 Message-Id: <20230503153231.1136114-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 before 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..52108c370 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -178,6 +178,8 @@ static int lm8333_probe(struct i2c_client *client) dev_warn(&client->dev, "Unable to set active time\n"); } + lm8333_irq_thread(client->irq, lm8333); + err = request_threaded_irq(client->irq, NULL, lm8333_irq_thread, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "lm8333", lm8333); -- 2.40.1