Message ID | 20230717193737.161784-2-dmy@semihalf.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;hadasmailinglist@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 12:38:20 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fc8049fd8bso7626381e87.2 for <linux-kernel@vger.kernel.org>; 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 <dmy@semihalf.com> To: Support Opensource <support.opensource@diasemi.com>, DLG Support Opensource <DLG-Support.Opensource@lm.renesas.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Dmytro Maluka <dmy@semihalf.com> 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771700077792343015 X-GMAIL-MSGID: 1771700077792343015 |
Series |
ASoC: da7219: Patches related to a spurious AAD IRQ issue
|
|
Commit Message
Dmytro Maluka
July 17, 2023, 7:37 p.m. UTC
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] <TASK>
[ 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] </TASK>
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 <dmy@semihalf.com>
---
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)