Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp295256ybz; Fri, 24 Apr 2020 00:05:55 -0700 (PDT) X-Google-Smtp-Source: APiQypI7f9j8fMArAhk45vvVmwSRlHfy9uYGkAqJHjCLZd4mEuaQY+h9oIf5VbEdG8tM30+WeseP X-Received: by 2002:a17:907:2719:: with SMTP id w25mr6051973ejk.107.1587711955818; Fri, 24 Apr 2020 00:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587711955; cv=none; d=google.com; s=arc-20160816; b=TfQ61zaC8vf8sVcJ6ljJxtn9VJtvNwVX6n041cNvlbx8P42+JRr2oKOPT132lkrGRk BAXYqOUPKLhdB1fCUTTOoUPbTEtFmP4FXjYaWrje+6Pc0zMoyCxgYC2B8qP7t535Dorb V6PsaH6m4WQ8jnbBQrpel8+78iGSnS5nX1ghnlSt/WRTGquFoA9BwrdG0BR0xgMqMrsN S/CRZOZzVtRmQBufhCUJx0jjZ6Q97U1d/1yQhb5+DthyLtsyd2fty2b7vdaki+uTxFMg PoOn6eEGgbPcCmCkjGSF3kv/rtp1quaKBQZPaBAl8WjiKnRa8TMA8JqzVHVAxDtJno1h gHQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=5IM2XyrRQY32+lSGO1E+/AfddEiEo+1ZB1QwRcyLGLU=; b=LCtBYq54M+XX3CN7dKIYtGRhxpIc0fXtNhsn2nei4N10USsKnPOWjz98ajWHisTP5U cU1MDoJ9k3fuwX02WAekYLsxwvw8+E9hzWdRxiOan0fqwuabjEOnTOetuyfZhfLaT7zA yygwoQNu7T/4WFHXGWBdLI48maVLVD3LEygz8O3c5tP55/+Ga4jYCcdC0lmavAxVDchl /jlkF9pYXTKZ4/Zbi06Q9k4GlzsTCpweuI1V7SvhJKvJpz2I2I5x7ZDmDgbuya/Wo2nA qOkNBS98E5zBzKrHhGT3CL77zHfGbp6Qyyh992QvbosuMiV5Iv7lSZc4RBG6OTzFE/W4 a/PQ== 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 do22si3316239ejc.1.2020.04.24.00.05.32; Fri, 24 Apr 2020 00:05:55 -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 S1726383AbgDXHDb (ORCPT + 99 others); Fri, 24 Apr 2020 03:03:31 -0400 Received: from inva021.nxp.com ([92.121.34.21]:33498 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbgDXHDb (ORCPT ); Fri, 24 Apr 2020 03:03:31 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DACB1205243; Fri, 24 Apr 2020 09:03:29 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 666D9204FE9; Fri, 24 Apr 2020 09:03:25 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 121E74034F; Fri, 24 Apr 2020 15:02:32 +0800 (SGT) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_esai: Remove the tasklet Date: Fri, 24 Apr 2020 14:54:06 +0800 Message-Id: <1587711246-27226-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove tasklet for it may cause the reset operation can't be handled immediately, then there will be endless xrun interrupt. Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_esai.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index c7a49d03463a..1ad0859da5e2 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -32,7 +32,6 @@ * @extalclk: esai clock source to derive HCK, SCK and FS * @fsysclk: system clock source to derive HCK, SCK and FS * @spbaclk: SPBA clock (optional, depending on SoC design) - * @task: tasklet to handle the reset operation * @lock: spin lock between hw_reset() and trigger() * @fifo_depth: depth of tx/rx FIFO * @slot_width: width of each DAI slot @@ -56,7 +55,6 @@ struct fsl_esai { struct clk *extalclk; struct clk *fsysclk; struct clk *spbaclk; - struct tasklet_struct task; spinlock_t lock; /* Protect hw_reset and trigger */ u32 fifo_depth; u32 slot_width; @@ -74,6 +72,8 @@ struct fsl_esai { char name[32]; }; +static void fsl_esai_hw_reset(struct fsl_esai *esai_priv); + static irqreturn_t esai_isr(int irq, void *devid) { struct fsl_esai *esai_priv = (struct fsl_esai *)devid; @@ -87,7 +87,7 @@ static irqreturn_t esai_isr(int irq, void *devid) if ((saisr & (ESAI_SAISR_TUE | ESAI_SAISR_ROE)) && esai_priv->reset_at_xrun) { dev_dbg(&pdev->dev, "reset module for xrun\n"); - tasklet_schedule(&esai_priv->task); + fsl_esai_hw_reset(esai_priv); } if (esr & ESAI_ESR_TINIT_MASK) @@ -674,9 +674,8 @@ static void fsl_esai_trigger_stop(struct fsl_esai *esai_priv, bool tx) ESAI_xFCR_xFR, 0); } -static void fsl_esai_hw_reset(unsigned long arg) +static void fsl_esai_hw_reset(struct fsl_esai *esai_priv) { - struct fsl_esai *esai_priv = (struct fsl_esai *)arg; bool tx = true, rx = false, enabled[2]; unsigned long lock_flags; u32 tfcr, rfcr; @@ -1034,9 +1033,6 @@ static int fsl_esai_probe(struct platform_device *pdev) return ret; } - tasklet_init(&esai_priv->task, fsl_esai_hw_reset, - (unsigned long)esai_priv); - pm_runtime_enable(&pdev->dev); regcache_cache_only(esai_priv->regmap, true); @@ -1050,10 +1046,7 @@ static int fsl_esai_probe(struct platform_device *pdev) static int fsl_esai_remove(struct platform_device *pdev) { - struct fsl_esai *esai_priv = platform_get_drvdata(pdev); - pm_runtime_disable(&pdev->dev); - tasklet_kill(&esai_priv->task); return 0; } -- 2.21.0