Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7237233rwr; Tue, 25 Apr 2023 09:57:20 -0700 (PDT) X-Google-Smtp-Source: AKy350b15dTlTByJxIGrj7zcPnrpPeAYRjv4phnYUSYwpCCA3ewrYeE1qRsaVWiwVYNtDoN0ecCN X-Received: by 2002:a05:6a00:cc6:b0:63b:8a00:4580 with SMTP id b6-20020a056a000cc600b0063b8a004580mr26702071pfv.0.1682441840149; Tue, 25 Apr 2023 09:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682441840; cv=none; d=google.com; s=arc-20160816; b=ASo9SUtjB950Dy2swnQEKKZzZLB39yfxz95qZbsglwqPnfD8/V9EqlJbgUoUfTnbbd jk5F3Up9GQhX5nRHlBiod4Fx+Jg97hN1MKRyLP/ZcP5pudIOBHnKqZrrlOLDB0S93lRF zotTfz7ga2OuXbU0SSXbAoLq9O8itzq4t40jJlqRO2GEwzfk6jq18S5Ej7cqJiLjF/OQ T2s11f4oLYKWufx6UyHxc5h6EXA4/MPJlAsL46HYdtu6XRjWybBUuKsbVAr6bqkn3ieE cdlDlKFmECyyVnD9VeSNaAuYjmrvFJXEEdRBBQLZ3Xagmy/YPMWzET956YBr0fspgmzl cIZQ== 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=sUHFjQtw4RTzCs0Vo3BkKMDTPsbnOjs7XeqmIs5kYC8=; b=Tqo808tUAD8cKGYYzW4zd4EL05xK4TKuotHkKS84GA0Krhk72YPwKc1DIcLhxpraY5 y82UQAQQJmCL8f4ZyN7OO3HGodA1aCgsf5OmPgjjKvddKDbWjyi02/34W8flSU2ZTicU MqHjj523IzOln6j48npmxXH+ILgVswbujYFHYLzl9M8HP0b1yK8RD6sjlEgNS8uMqonx ZFD03A3soBKFvp3vPR/vKrQ3W5F1+RAVmQVfeD/mpwUoZ/Vbni6vZNgoulJz+/z9Zyaf 82m+kGXOh/P1w6whfswV2rwTQcOkZmtkusvfhhsdIyhr4vaFwi3AXXvbkwccihzMRp6X AWQg== 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 bk13-20020a056a02028d00b00528513d5e9dsi4290916pgb.109.2023.04.25.09.57.08; Tue, 25 Apr 2023 09:57:20 -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 S234701AbjDYQtU (ORCPT + 99 others); Tue, 25 Apr 2023 12:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234732AbjDYQtS (ORCPT ); Tue, 25 Apr 2023 12:49:18 -0400 Received: from harvie.cz (harvie.cz [77.87.242.242]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEE29CC1E; Tue, 25 Apr 2023 09:49:17 -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 22B761801B3; Tue, 25 Apr 2023 18:49:16 +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 v2] Fix freeze in lm8333 i2c keyboard driver Date: Tue, 25 Apr 2023 18:49:03 +0200 Message-Id: <20230425164903.610455-1-tomas.mudrunka@gmail.com> X-Mailer: git-send-email 2.40.0 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 activated by falling edge. When button is pressed before driver is loaded, driver will miss the edge and never respond again. To fix this we clear the interrupt via i2c after registering IRQ. 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_read8(lm8333, LM8333_READ_INT); + err = input_register_device(input); if (err) goto free_irq; -- 2.40.0