From patchwork Wed Jul 4 09:49:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10506425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14EF860325 for ; Wed, 4 Jul 2018 09:54:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13A2F28D96 for ; Wed, 4 Jul 2018 09:54:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07A2328DB0; Wed, 4 Jul 2018 09:54:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84DA328D96 for ; Wed, 4 Jul 2018 09:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=AehzzB67t5677sAvIALfiRgb10YLugCB0p368hPseiU=; b=Uid2ZyTbeRsJ4wTOFip2ifoTbR xhLLpDRwnbDW74EWKZRYkAEs8x9wrnJ8IjA36WVr6Zsmnr3gt49JM3VPWvwqJPb+B/MV7MDYYFuJA Ez9Z3eBZRggmC1vMFrU1HjDaZVFqj9A+YF16PZb2xqw1iiJ07IppHD9QKgS0jgtxIzno7/nGfZsF+ eHUQVWnovJ1n7Fs7hKVipZe+q/meOsZXB2gxo06zYWMc6G+Ct84Tt8+YVpwTZFiK7W5yxYMEdfP3V JjFS3GtBW9wpx2Q8wJORmTwgsf+Xh72/v4MhTIJOUHXoZt/wb+gsUJmwDBm6c4P6j0FCL9HMckHz8 C+svx8zQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1faeU5-0003YG-LI; Wed, 04 Jul 2018 09:54:01 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1faeSH-0001yu-Sx for linux-arm-kernel@lists.infradead.org; Wed, 04 Jul 2018 09:52:16 +0000 Received: by mail-wm0-x230.google.com with SMTP id v25-v6so5157082wmc.0 for ; Wed, 04 Jul 2018 02:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GIK9ORkO2DwcYCiUPFLrufSRQfHEUxj9xTjfzebPSEw=; b=Ns36ydYVLOgeXR+/ijNVnsCla/eMMYZhEX+kLFlGzZJvheVDtNG5JoNUuSf5scqxZE e1Wg/OQBnTa/61j+xU4gyE6NAUG+XpKQWnxHMer4jJkG75jJyZwpdHCP62wbn3gKI/9r UfKdGiFudxNvXOAq7v7McjGkNuxCZuBYnHYoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GIK9ORkO2DwcYCiUPFLrufSRQfHEUxj9xTjfzebPSEw=; b=fcZOc9sFKA99XGNxtk54DPcrkcK6fGiPO+6elPlo08HCjC5nMsCwhZ6nZDU81Bjfaw wzpiHb1KXtzEPOy5RhacIpiaXkeUz7DJOlkz7lz1dSpbZ8e1HtoGG6nv0teAj5OFyVuN SZ6g6krKDRutkXmfSEXv41nNDfGMEiNFfPWpDPeVKWQvNLMmsB4riZ7aMNPNcC0HbdqV bVKQxYOpP3GhEIFnk8so6oyUEfbKDoLk1nNx3Nulc/YSe9T5oen1nEMpMM+QaRMaseYi ih+eACJ76yYm2UqUp/EOm7yinEit8OghxpVlC+0++v1rl2nY5rGByeWK7eXeX3EnjlTZ +26A== X-Gm-Message-State: APt69E3BYVDNQTov8DIyUYY/uttGigCemFqSdthA9zaqV8d6fKt1etSL zWZNocEYqidouVPFWW4L2usmig== X-Google-Smtp-Source: AAOMgpcTXcJH9lO/hIe8WphygL1zzqXPtIAdndRXObgojCJpcSm3QZ9ra98anvj2BNffIgL42+QVkw== X-Received: by 2002:a1c:2e90:: with SMTP id u138-v6mr1042157wmu.156.1530697917996; Wed, 04 Jul 2018 02:51:57 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 125-v6sm6370089wmw.9.2018.07.04.02.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jul 2018 02:51:57 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 5/6] ASoC: qdsp6: q6afe-dai: do not close port if its not opened Date: Wed, 4 Jul 2018 10:49:43 +0100 Message-Id: <20180704094944.16440-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180704094944.16440-1-srinivas.kandagatla@linaro.org> References: <20180704094944.16440-1-srinivas.kandagatla@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180704_025210_387060_4BD6B647 X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bgoswami@codeaurora.org, linux-arm-msm@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP afe ports are open as part of prepare, so for use cases like "aplay sample.wav" were sample.wav is not present. This would call port close eventhough port was never opened. DSP would return errors for such use cases. Avoid doing this by checking the port state. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6afe-dai.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index 074582afda85..e7f809e3ee1f 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -314,6 +314,9 @@ static void q6afe_dai_shutdown(struct snd_pcm_substream *substream, struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); int rc; + if (!dai_data->is_port_started[dai->id]) + return; + rc = q6afe_port_stop(dai_data->port[dai->id]); if (rc < 0) dev_err(dai->dev, "fail to close AFE port (%d)\n", rc);