Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp315279rwr; Thu, 27 Apr 2023 01:29:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4K5ZgNBb88HZSdD87xblE6LaD0fIZQLbaEUTL1XoB4mOTiE/p3A4+d9njPiNMV5W80TAp+ X-Received: by 2002:a05:6a21:3393:b0:f5:9f72:1aa2 with SMTP id yy19-20020a056a21339300b000f59f721aa2mr1095044pzb.6.1682584171707; Thu, 27 Apr 2023 01:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682584171; cv=none; d=google.com; s=arc-20160816; b=oB4G5q8KcFg5fvhh4wHftsVfjbeOK7Y2saxzK2kzzsZEWy1sITbPPslq/NPvmID11I 6O76s89BZI7YuVBPH3swyZ2qp9u3Lb1va83iIysDpkZxu/873IuRzfU3wap6O0FE7fFU BhbQ/lsploLBEETB7dxWw0B647xPWyBvgbBYY10PHfWWXFXKmiSXW6VZE4unSpLfr6Z5 mbHJ4d78b+cnWMDuGCPC+T5gi+z58FCGTrQ7dHmP8EuOh6KJLfaajOythiMXkXsuOJps aRcbCV8DsRXh/2kq5ihzXiSNIZuiUhDEzdeTWB8p6r3IdR/gO6ie+aNgrvgO6ZEVK1w8 z21g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gzFxCmCViEMHXU5pJcqB4vl+bQBH8MRNorgL7voOk4s=; b=mvxQ31bybv3WK4Gls3XTd+e4V2+D82TBCte7V7CuCJLDpOz4JHYVQGw+Z2gIgN8VZy IZmuab3zyxg+Wad4WZUCH75m+kqWJ/q4pkGdfi94+3DCJyb0mTPLp8/ai60oHw3ko405 ElurkMHwEVqjsctQ1tGJMyBgt3UzCslhTggnMLDi83aFKrm0xniEQ2DfxWRNtlbZ6UVr R4MT9tBmd2JCo2P2G6P6sxrnOkAoFeyuEVEfD8tYQgA+0PKaSHQOV7AECQuadpQ2Dyz9 LTMQFigQj4MoGl0beTisA4Fd3fLPyNZ9MmmWdWLMTaP/aX1Zhy3CjFYbZ2UtCwN5rqjy 8Z0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=LWvz2ZPn; 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=pass (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 v6-20020a655c46000000b0051b10dc3a47si17591977pgr.158.2023.04.27.01.29.17; Thu, 27 Apr 2023 01:29:31 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=LWvz2ZPn; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243028AbjD0IT5 (ORCPT + 99 others); Thu, 27 Apr 2023 04:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243077AbjD0ITx (ORCPT ); Thu, 27 Apr 2023 04:19:53 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FABE3A9A; Thu, 27 Apr 2023 01:19:52 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-2fa36231b1cso5048438f8f.2; Thu, 27 Apr 2023 01:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682583591; x=1685175591; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gzFxCmCViEMHXU5pJcqB4vl+bQBH8MRNorgL7voOk4s=; b=LWvz2ZPnfvG2hf+HjF8rsGqkWnAStW32Cgrx9nJgmk+Ur3BQBcsBcHS0t3XIGc0n4a OdBdVB08Y9NS8yXu82+FqsIfptZceNRaQ2bsBl83aNJVqxN6EAx6ucZGdzJdvm/qiaSR eQ/OLKYc8j3RoiBEf73MG1LzUGD6yqHRFDrcZAvzlYh2VEKQExB3pW4UJ+QPcEef4eT3 8KAc7d+kLG7LI/2VV1fUubxLaceVm1HNdL9xXxR0e2LJ7aEixMOJNtfbaPL8xmBrw4bv rldWwA+HFyIIFW/WyT1fCK8fY8igQ9IfANwxGDgqTp2eZlkR+CXuBFw+LeWtGuzztiOR ol3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682583591; x=1685175591; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gzFxCmCViEMHXU5pJcqB4vl+bQBH8MRNorgL7voOk4s=; b=gFpjMzs2QOjadocMfpEnKYyRp4LvwdcsA58PWFOVc0S3WQkT/Ekb8Yc+b9SIQATWtt RFbYS8cURUax8uAQA2UeSa+uMUY3jOYQuP1ZZw8Jw7ckcIOxFqgvKBF0jPBBYYOck0ta J/n84Cqxtx5hxAQzOrbHNWAMsSnDdX7Hii8QfF+OTh5v2YCSg6XAbKlZ8B5DeA/kCde/ uLSuIEsEvotNuc60PFfMAHXtZDzQ7nivB3XDPumB2Kmap2oYn6bIfvhcm67acnJ739DP lmxcsoZZrHR6b9vBcm6E2gX1UDLY0cG4t3q7D/GM0EDGXUj7gYcc+CV+4eYBEHyqB9EU EEZg== X-Gm-Message-State: AC+VfDxc3QdsHc07DmCcmD56yI64Okw135fkPf5pUnT+DWkG3iPqWvsa NsKljRWklQqOrjp2eEzTwas2JOguHzd2EU8uaw== X-Received: by 2002:adf:da47:0:b0:2f4:4e1a:bea2 with SMTP id r7-20020adfda47000000b002f44e1abea2mr583218wrl.59.1682583590838; Thu, 27 Apr 2023 01:19:50 -0700 (PDT) MIME-Version: 1.0 References: <20230425130054.591007-1-tomas.mudrunka@gmail.com> In-Reply-To: From: =?UTF-8?B?VG9tw6HFoSBNdWRydcWIa2E=?= Date: Thu, 27 Apr 2023 10:19:38 +0200 Message-ID: Subject: Re: [PATCH] Fix freeze in lm8333 i2c keyboard driver To: Jeff LaBundy Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 > Yes that's correct; what I mean to say is that depending on the nature of > the read-to-clear mechanism in the part, there is a chance that the IRQ > has not been deasserted by the time the threaded handler returns. On some > devices for example, the IRQ is not deasserted until some time after the > read's stop condition. > > For these cases, I consider it best practice to measure the I2C and IRQ > lines on a scope and if necessary, add a small delay before the interrupt > handler returns. This is especially true for open-drain interrupts that > may need a few hundred extra us for the pin to rise. Well before posting the patch i did some testing. I was watching the /proc/interrupts and checked that IRQ counter for lm8333 matches number of keypresses. Which i've only tested for like 20-30 times, but haven't seem any glitch. But i still recognize the fact that the gpio line getting stuck for some reason (short circuit on PCB?) might cause troubles by unnecessarily loading the CPU, while with edge trigger it's more likely to affect only the function of keyboard itself rather than bringing down whole system. But i am not sure if this case is supposed to be expected and handled in SW.