Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4679872pxj; Tue, 22 Jun 2021 05:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw85rYDzc6U/wYU0CuuI987rtahk9J4J+sx1LrVa0+HDFBRz4w9gP5EKxG24QJ4q1Pwp4YX X-Received: by 2002:a02:c6a6:: with SMTP id o6mr3801129jan.20.1624366323095; Tue, 22 Jun 2021 05:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624366323; cv=none; d=google.com; s=arc-20160816; b=Rjc6O2utBI8VLrrCmNAT8+FNVZ+Z2kkJLTHf45RVg50CQNbQMEJc9KngYqWLLh1MFl 2lMd3aflzlaltmdHergUFSI4ZCyS5bpCtQyA26dmTbM9woMWiuTsruHEpt/VnKo/9p1k rC1ygv9kqL7vyW+AdQOJ/4Hp2A3wTfbzN06YsYzwSftF0hNAQTJb4upoEgZ5GrOUIquh kTGFxlxFfxMDPGOenT9si76yHqkdhFfywlqBV9/R9vDAt0FO4hO1QN7PzfxFopAx6Efd R9pdq9JBAArDUQYw/Cj+VL1/TFKv3F+M2Fd5M+Zy/KRNEwGwqf83zn2ClTCKzHdROH8h ks8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=N/m/XxEJnJz5Yfn40GLA+cO0TBXA9TSivVsMS6sD+7U=; b=wxn0EzDSqI07GREyB/AxEPona6q6XN7Npenan8hXukLnPBduwggBLqgEY0wos6QdM7 zXb6yd/UcM0+fArKAm47FTdxa+WKufdTIcs6lsZhjp+CHntjjiHyAUUlp2sNF9djWETF P0pzRJuvkI2Z+VnmFCebeSwGB44bjEcSp1Rou/yqz734JGXueJjWI4GD4Xhu5BT5NERM dpQyOkpzoCsZvSvgX0gF0a+TsWaoo+HralRjwclg+Eey7UIEohYXmperZgxBYB1Uq4qn UmxQRy5nr1nU6Zwe2LEbhA1w3RosFBX7xfY1CbdBs5W7YKfaFXGZn7XY0ExbDR5AzRm2 qwqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si9852685ioo.70.2021.06.22.05.51.51; Tue, 22 Jun 2021 05:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbhFVMwY (ORCPT + 99 others); Tue, 22 Jun 2021 08:52:24 -0400 Received: from inva020.nxp.com ([92.121.34.13]:35548 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhFVMwY (ORCPT ); Tue, 22 Jun 2021 08:52:24 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6C6C21A0E58; Tue, 22 Jun 2021 14:50:07 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 65EF81A0E88; Tue, 22 Jun 2021 14:50:03 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 199354024D; Tue, 22 Jun 2021 20:49:58 +0800 (+08) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_spdif: Fix unexpected interrupt after suspend Date: Tue, 22 Jun 2021 20:31:24 +0800 Message-Id: <1624365084-7934-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When system enter suspend, the machine driver suspend callback function will be called, then the cpu driver trigger callback (SNDRV_PCM_TRIGGER_SUSPEND) be called, it would disable the interrupt. But the machine driver suspend and cpu dai driver suspend order maybe changed, the cpu dai driver's suspend callback is called before machine driver's suppend callback, then the interrupt is not cleared successfully in trigger callback. So need to clear interrupts in cpu dai driver's suspend callback to avoid such issue. Fixes: 9cb2b3796e08 ("ASoC: fsl_spdif: Add pm runtime function") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_spdif.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index a9c6b930b04a..8ffb1a6048d6 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1467,6 +1467,9 @@ static int fsl_spdif_runtime_suspend(struct device *dev) struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); int i; + /* Disable all the interrupts */ + regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SIE, 0xffffff, 0); + regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC, &spdif_priv->regcache_srpc); regcache_cache_only(spdif_priv->regmap, true); -- 2.27.0