From patchwork Mon Jul 17 19:37:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmytro Maluka X-Patchwork-Id: 121582 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1322787vqt; Mon, 17 Jul 2023 13:14:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGY1J8n/eRLC3j+R7G5GCyup4dPxoP1t/E+bJw9+wXm9qeGGnm5r9EcnpDki7lExTC2WJIb X-Received: by 2002:a17:903:183:b0:1b6:6f12:502e with SMTP id z3-20020a170903018300b001b66f12502emr15710030plg.49.1689624860334; Mon, 17 Jul 2023 13:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689624860; cv=none; d=google.com; s=arc-20160816; b=bhYeTCqNQ5cYct8wPdimR3RUlcWQQQGDITxK2OdtHUwRjPCGHdwVWvogy+U9aZORnm nDf8wAbgJJZMeYwxa5ydID3P2BALbLZFgrSfH84dccHVmN3ud0PjeoPddmHi2OfQtfla vrjI4o32g7GaSG0Awex1Csm00Hz3bgfP8KYHkbTtFdIx0UiV4z3u1nsgkPuGqzJCjQbi upys5OzQDhnQm5DI8+2QdJy/II4Ss455dkEo0yfDRRR8gAFeROnbGayNAxhkjQTsjFjl IGKXt0upS7ifDBvLGHuyxhbj2QRZAk81pyjGOToUX6KNRDkdulAZRRDUiYVuTPe3ZdiM QaGQ== 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 :dkim-signature; bh=k0jx6KDLfrX0Uj2uqeAAYsN7zB5TQ1Hj76wJYAksz0s=; fh=1yAXhE4HpPWDUWqZ2ipyZ6AU48nt43DA/f7u2z0wBa8=; b=pZy+njBhl3+abY1ueCs12xnuXBAF6QErOiPokWRrKYtKPXVJDzlsqW8wn+rBWYv8+H fmefKI+zr0O+US5uhUGRRKJnRYQPSTCFydhuLtiziJTEewt4jhSBU9dPVzQrXfPsr7ST 5ZK5qA9fW5/+L75GOoC1lQbOllWd3A/2jlh3ER0GKB0BRBIEiM5BHXZic1BhIpL3ddHb pzYmbX2k/pzu9uWHB0rCmqQXokl9Au+YwoUy0JypWLRsWMGAXku7PpqhDvphqYdDRBWP UT3yiHvEfh7bgnQ9tZZVhU/AY2iVRTjjqKeYqtGQSrywyalzUvpG1VmcwFeraMMmE+HC GGJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=SXlAzV3t; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a170903230800b001b85ab52371si387249plh.428.2023.07.17.13.14.07; Mon, 17 Jul 2023 13:14: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; dkim=pass header.i=@semihalf.com header.s=google header.b=SXlAzV3t; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbjGQTiX (ORCPT + 99 others); Mon, 17 Jul 2023 15:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjGQTiW (ORCPT ); Mon, 17 Jul 2023 15:38:22 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74B0BB for ; Mon, 17 Jul 2023 12:38:20 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fc8049fd8bso7626381e87.2 for ; Mon, 17 Jul 2023 12:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; t=1689622699; x=1692214699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k0jx6KDLfrX0Uj2uqeAAYsN7zB5TQ1Hj76wJYAksz0s=; b=SXlAzV3tbaSQ6pNe0nZHU/rEvYdEXgPHQJctTCRlEfb/0NE9pSyD9zDF/VkZJL2i4/ eQ3sYSGI+4dqA4+g95uJuENy9nwxOOyokDFM58PvZ+4WAMNjIx5nolWcpO+F++L6sOEZ Y6iA3CgI4pl35+37ysCrwfiP6RkmtmKRolT2EaoATJHeT8r4YLbYmN1eIex3HwZqrm6T labJ3mUnxRTBqjczKBwHI3qoz6PdQhoYMKn+l2tWbuHuhj4Mkv3UK+cT7RHvi0Kh4p+u eXexdLt6OdcH1Iz3EB8R+4IVD0KU2GstELMILGAOUKzOwaLDJ4tUeT6alWHDl3IkvbMB w//w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689622699; x=1692214699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k0jx6KDLfrX0Uj2uqeAAYsN7zB5TQ1Hj76wJYAksz0s=; b=Wb9xDTBqfitysDcGfOKiacK0BppTNbAz77Oof0uE9Nt7GWA51QfkyeviKjQ7ivxv9g pk9pFWMx+2tucg+d49yjK1qXzXJ9r2wZ+4rI8JxQ9snnimgoOrh4jYmLt67ko/ieuNCe ChKb7uo9bcRTb+mZuJtrq4yIX6zq1CwIdana9Zt5Kbc6yVDmoxE1u9cHooVtUlw2FNJm V/weMiM6rog2rUb3aim9on9Z/czV5CarpuJNzJusJIMxTUQww3cQj5pjXGqUvAYEG9mv DB99U7eQso+lFMd+OsyJ1WYNUq1k00ZYfKHVEIMQqKiJkj2NN9o1wCD8EhsX455O6z4x nadA== X-Gm-Message-State: ABy/qLYurNFj4Ke6ngU1SYduHzCQ0VAuZ4QcS6nlRLZOYVUXl03PEemE gkkU5nXAsxF/ahU1jAKU+1ntTw== X-Received: by 2002:ac2:51ae:0:b0:4f9:607a:6508 with SMTP id f14-20020ac251ae000000b004f9607a6508mr8024325lfk.50.1689622698911; Mon, 17 Jul 2023 12:38:18 -0700 (PDT) Received: from dmaluka.office.semihalf.net ([83.142.187.84]) by smtp.gmail.com with ESMTPSA id e5-20020ac25465000000b004fb75943ab3sm53124lfn.258.2023.07.17.12.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 12:38:18 -0700 (PDT) From: Dmytro Maluka To: Support Opensource , DLG Support Opensource , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Dmytro Maluka Subject: [PATCH 1/2] ASoC: da7219: Flush pending AAD IRQ when suspending Date: Mon, 17 Jul 2023 21:37:36 +0200 Message-ID: <20230717193737.161784-2-dmy@semihalf.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog In-Reply-To: <20230717193737.161784-1-dmy@semihalf.com> References: <20230717193737.161784-1-dmy@semihalf.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771700077792343015 X-GMAIL-MSGID: 1771700077792343015 da7219_aad_suspend() disables jack detection, which should prevent generating new interrupts by DA7219 while suspended. However, there is a theoretical possibility that there is a pending interrupt generated just before suspending DA7219 and not handled yet, so the IRQ handler may still run after DA7219 is suspended. To prevent that, wait until the pending IRQ handling is done. This patch arose as an attempt to fix the following I2C failure occurring sometimes during system suspend or resume: [ 355.876211] i2c_designware i2c_designware.3: Transfer while suspended [ 355.876245] WARNING: CPU: 2 PID: 3576 at drivers/i2c/busses/i2c-designware-master.c:570 i2c_dw_xfer+0x411/0x440 ... [ 355.876462] Call Trace: [ 355.876468] [ 355.876475] ? update_load_avg+0x1b3/0x615 [ 355.876484] __i2c_transfer+0x101/0x1d8 [ 355.876494] i2c_transfer+0x74/0x10d [ 355.876504] regmap_i2c_read+0x6a/0x9c [ 355.876513] _regmap_raw_read+0x179/0x223 [ 355.876521] regmap_raw_read+0x1e1/0x28e [ 355.876527] regmap_bulk_read+0x17d/0x1ba [ 355.876532] ? __wake_up+0xed/0x1bb [ 355.876542] da7219_aad_irq_thread+0x54/0x2c9 [snd_soc_da7219 5fb8ebb2179cf2fea29af090f3145d68ed8e2184] [ 355.876556] irq_thread+0x13c/0x231 [ 355.876563] ? irq_forced_thread_fn+0x5f/0x5f [ 355.876570] ? irq_thread_fn+0x4d/0x4d [ 355.876576] kthread+0x13a/0x152 [ 355.876581] ? synchronize_irq+0xc3/0xc3 [ 355.876587] ? kthread_blkcg+0x31/0x31 [ 355.876592] ret_from_fork+0x1f/0x30 [ 355.876601] which indicates that the AAD IRQ handler is unexpectedly running when DA7219 is suspended, and as a result, is trying to read data from DA7219 over I2C and is hitting the I2C driver "Transfer while suspended" failure. However, with this patch the above failure is still reproducible. So this patch does not fix any real observed issue so far, but at least is useful for confirming that the above issue is not caused by a pending IRQ but rather looks like a DA7219 hardware issue with an IRQ unexpectedly generated after jack detection is already disabled. Signed-off-by: Dmytro Maluka --- sound/soc/codecs/da7219-aad.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c index c65256bd526d..202715b7bbea 100644 --- a/sound/soc/codecs/da7219-aad.c +++ b/sound/soc/codecs/da7219-aad.c @@ -944,6 +944,8 @@ void da7219_aad_suspend(struct snd_soc_component *component) } } } + + synchronize_irq(da7219_aad->irq); } void da7219_aad_resume(struct snd_soc_component *component) From patchwork Mon Jul 17 19:37:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmytro Maluka X-Patchwork-Id: 121569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1312026vqt; Mon, 17 Jul 2023 12:50:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGl2BEi6ppW+lYJkYMhUGBdW3u4p1RkpjgZjSqh06pkyU+i3QLw2/xKP2RAbrEXYa9lao+V X-Received: by 2002:a5d:6102:0:b0:314:3c8f:d267 with SMTP id v2-20020a5d6102000000b003143c8fd267mr13006037wrt.45.1689623424333; Mon, 17 Jul 2023 12:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689623424; cv=none; d=google.com; s=arc-20160816; b=gXzl2CNeCfy9FR7fphfL40SjJSICMVlgK0wu68wD126tFbAK/KlXklLPlEb+6ZdQZh YjlUdqYxXp2YMdfWfz78J7pmt1zaJx3N0NGqYOh0Jvu+/qjyT9s0M8eHIRnDkZcuPVLq yGCebMNf/oi2JaSFhyeXj7A8Q6MRZW/KnAd8EvdOAfWdbQqMp4h/90F7SGx55W8t5cdD SWMQNvfmRjjFc3LWg62ULEdEjOjx9HERDNyTN81WIpKqcRj80zNH5o5J81N/LTnM8tV0 6C04yfBSTgYu/ck6ZKN7iGg13l1QRcs3W9abo7pJVjSlwSoLJ1AIUjY4lq3lAvb59BQ0 ip9g== 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 :dkim-signature; bh=OoBLkK2LHNAZNFLTLXxtcr6P67HJOzOANhsGn4ic+bU=; fh=1yAXhE4HpPWDUWqZ2ipyZ6AU48nt43DA/f7u2z0wBa8=; b=bBTuDwZ5t/TZWTlpQGkgYJbWGkzM1VXJJWSdetAeAsUEdCOvhnpCRkO43F4zdMds3R YbbUglKlLZTgDiHcFrB6w+lvnn1MQRJT/jwQT+e1DxwFBrH31NZ7bqmOaJgOs3wPV+Ks y8ADYoCe1H5K1GvwNcHmGUSNQeIRTcbiXTziQqBatcVSiy0niXXF9dz6faY9FCUctFZD +3uI42EV5hPJWh3Z+4xrT2jjCGi5FweM7Mxm7b+dZGLY8GxYlZVBH42LOoFicEy8VP9i B6xKGhWfg7NTW2pgMorJgUxc/FaN7jpYWKNadE62NExGDkTNbYkHu7M5OHn+pS+PaUM8 ak7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=jzR2pq1r; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020aa7dcc3000000b0051e0e38a950si45994edu.637.2023.07.17.12.50.01; Mon, 17 Jul 2023 12:50:24 -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=@semihalf.com header.s=google header.b=jzR2pq1r; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjGQTic (ORCPT + 99 others); Mon, 17 Jul 2023 15:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbjGQTiZ (ORCPT ); Mon, 17 Jul 2023 15:38:25 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 915B2BB for ; Mon, 17 Jul 2023 12:38:22 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fb41682472so7840692e87.2 for ; Mon, 17 Jul 2023 12:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; t=1689622701; x=1692214701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OoBLkK2LHNAZNFLTLXxtcr6P67HJOzOANhsGn4ic+bU=; b=jzR2pq1rlEtnzLkc6fPM1RWXYa6wSHQD98evZn4wQLLmBFtxJA1ve0TcRf++jhvjjH pLJqnm4FVaQXgItzn2zhGlwyxNeEKYaoxJSZiy37jipmOFbNrWAk+b36NKNMbb1Aos/2 UVaFCgaMfWADG3Oqinf3kIxty8HH6Cq3BoSIm7j9GbU0krP7vcp5xXuBDwWgQtQKQwGS D+RSGRggJQAhFknA9/uiyY1E6bi8li6BNkSEBtq2CkgwYEygGyzUBN479HOBGoxPVHgU hKo/BJ4KJNfDn6SnB1UzymekuU4XH+D1muOxl+0W5G83rjv+HxCqBVR10YwkPo+PO/ZG 1hcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689622701; x=1692214701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OoBLkK2LHNAZNFLTLXxtcr6P67HJOzOANhsGn4ic+bU=; b=IRfVELg5k9I9zrLfrcLExmQrI5shzTPEcHqlAOHLDTgKDg5mIHbFY+wa2Ol0Vfh6rC Fp00sJa/W0V9kHsaOo6PJcPgjO8hkDaccnd1NrwXcWBBTS5vrqVoHxm+YPghZncEbQB0 aHbVXFI3riLKKQ4QEvExeuZGSDcxSE7pF5NzNgoTcw7FDPOPNqhu5aB5necZuunfWDeK ODQTILPRbtGRfXvdqP1UTCLCF5T/JNtIAFnTpqy0sqsZL5Y4Hg6sZT2IlKsW5RgeQwLD qc6oD6c2E4vU37dU505lxBCmS7u9ZW83adcnrajn8MBAoeN0DfhQLJOUlABlO0utmSIk o8bA== X-Gm-Message-State: ABy/qLZER0hcdiumg12hi/JlDNB59DabHwVrGvjmlweB4NQBIyERW/9j yFjyDRMfbhL1V7i7Pn+wYATAYw== X-Received: by 2002:a05:6512:3d03:b0:4fb:8f79:631 with SMTP id d3-20020a0565123d0300b004fb8f790631mr16932345lfv.46.1689622700837; Mon, 17 Jul 2023 12:38:20 -0700 (PDT) Received: from dmaluka.office.semihalf.net ([83.142.187.84]) by smtp.gmail.com with ESMTPSA id e5-20020ac25465000000b004fb75943ab3sm53124lfn.258.2023.07.17.12.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 12:38:20 -0700 (PDT) From: Dmytro Maluka To: Support Opensource , DLG Support Opensource , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Dmytro Maluka Subject: [PATCH 2/2] ASoC: da7219: Check for failure reading AAD IRQ events Date: Mon, 17 Jul 2023 21:37:37 +0200 Message-ID: <20230717193737.161784-3-dmy@semihalf.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog In-Reply-To: <20230717193737.161784-1-dmy@semihalf.com> References: <20230717193737.161784-1-dmy@semihalf.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771698571944852669 X-GMAIL-MSGID: 1771698571944852669 When handling an AAD interrupt, if IRQ events read failed (for example, due to i2c "Transfer while suspended" failure, i.e. when attempting to read it while DA7219 is suspended, which may happen due to a spurious AAD interrupt), the events array contains garbage uninitialized values. So instead of trying to interprete those values and doing any actions based on them (potentially resulting in misbehavior, e.g. reporting bogus events), refuse to handle the interrupt. Signed-off-by: Dmytro Maluka --- sound/soc/codecs/da7219-aad.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c index 202715b7bbea..581b334a6631 100644 --- a/sound/soc/codecs/da7219-aad.c +++ b/sound/soc/codecs/da7219-aad.c @@ -361,11 +361,15 @@ static irqreturn_t da7219_aad_irq_thread(int irq, void *data) struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); u8 events[DA7219_AAD_IRQ_REG_MAX]; u8 statusa; - int i, report = 0, mask = 0; + int i, ret, report = 0, mask = 0; /* Read current IRQ events */ - regmap_bulk_read(da7219->regmap, DA7219_ACCDET_IRQ_EVENT_A, - events, DA7219_AAD_IRQ_REG_MAX); + ret = regmap_bulk_read(da7219->regmap, DA7219_ACCDET_IRQ_EVENT_A, + events, DA7219_AAD_IRQ_REG_MAX); + if (ret) { + dev_warn_ratelimited(component->dev, "Failed to read IRQ events: %d\n", ret); + return IRQ_NONE; + } if (!events[DA7219_AAD_IRQ_REG_A] && !events[DA7219_AAD_IRQ_REG_B]) return IRQ_NONE;