From patchwork Wed Jul 4 09:49:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10506377 X-Patchwork-Delegate: agross@codeaurora.org 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 D063A603D7 for ; Wed, 4 Jul 2018 09:52:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC2FF289D2 for ; Wed, 4 Jul 2018 09:52:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFFBB28A97; Wed, 4 Jul 2018 09:52:04 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71CC3289D2 for ; Wed, 4 Jul 2018 09:52:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932733AbeGDJwC (ORCPT ); Wed, 4 Jul 2018 05:52:02 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:34528 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbeGDJwA (ORCPT ); Wed, 4 Jul 2018 05:52:00 -0400 Received: by mail-wm0-f41.google.com with SMTP id l15-v6so12590478wmc.1 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=U2hFfWmmsNEuowUtZFEQCnLNHtXFTHE2eMSugD1fOFs=; b=fcQhHFce0+XGd0vzjSI/rSY7zQ8hSEEOVD2G7ZvhxbU5F/hywUR0bcxr3P9V0wRk2K 9Oqq8jwIkFrZlJasfWif+HcBaA7/UAus5s4Gq02XaRccSmHUDUV0P0kGExnjr9l62AT4 j9Fzf5uXG/tPc4AyQrEA3Nf+jgf9lqG6p8Fpk= 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=U2hFfWmmsNEuowUtZFEQCnLNHtXFTHE2eMSugD1fOFs=; b=R/kr7I9wCy8PVC7nqwAraxHLW6s1olPmwjtgGSsgwTtOQArTw9Ao2H395iOeELc2+y SCps56NubILf/2S18mJkOo1ToX5Hh7UrMYPuZSf72+yTmSKLlmBGjm3WGDMaynCDQsZx 1NzBoUQ4vrhNDLsSxXn4X7Swm3ZQlpPhfyvK++ty3uXoCRfKzuzXRxYftF9h+D2iYFx4 7dNyUsCjbWe2n3mUIoEbt77B+2G9si2//8aV8zNMrrSp75sXgtSkup82KRmUn29AmHta aFUdPQmgOUuN2CQ65UoU22wnni9lWJdfcgC6nIz8ziRmeugKjMmYOqUGTxYdB4Mh3iNi 1ylg== X-Gm-Message-State: APt69E0xRvvuLVzNox5+I5hhS3RSdU9iybgxiAin4y00VMkndmyq0Dfj gOJYLgs76V6auOVyKXXvmGJRlVIuI+c= X-Google-Smtp-Source: AAOMgpdjCWZX2FMBTsRSU7/nlCZpG5La0JWTbxVqG6Exn0J7n4DXKmZrbrTdR9DQKUkIdOhdEUn6UA== X-Received: by 2002:a1c:17d4:: with SMTP id 203-v6mr1087806wmx.75.1530697918899; Wed, 04 Jul 2018 02:51:58 -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.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jul 2018 02:51:58 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Cc: linux-arm-msm@vger.kernel.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, tiwai@suse.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla Subject: [PATCH 6/6] ASoC: qdsp6: q6asm-dai: do not close port if its not opened Date: Wed, 4 Jul 2018 10:49:44 +0100 Message-Id: <20180704094944.16440-7-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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP asm 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/q6asm-dai.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 1196dc7483d2..199d0fb6f90a 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -390,7 +390,9 @@ static int q6asm_dai_close(struct snd_pcm_substream *substream) struct q6asm_dai_rtd *prtd = runtime->private_data; if (prtd->audio_client) { - q6asm_cmd(prtd->audio_client, CMD_CLOSE); + if (prtd->state) + q6asm_cmd(prtd->audio_client, CMD_CLOSE); + q6asm_unmap_memory_regions(substream->stream, prtd->audio_client); q6asm_audio_client_free(prtd->audio_client);