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: 141052 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp600543ljj; Wed, 4 Jul 2018 02:52:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPWT1eI/Vb78/qTWRb7MBA2KRHrf//iTnX6PWJ/GF7nLLjjKi8c5847ghkwXEUiwxAmxLL X-Received: by 2002:a63:a543:: with SMTP id r3-v6mr1269983pgu.336.1530697924396; Wed, 04 Jul 2018 02:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530697924; cv=none; d=google.com; s=arc-20160816; b=glmqLyyeRMMRscCDtS0EpvM27cJ1OF6Ww/oKOJab0YJYpk4Sw7d8J9/sx3rdZh3iyv 4LvlcnlM1oE35QDfrbGbb9S+8fZKqFki63fGvp6jEh0WLfDJecpUvsGo1kFm24ZSOTtf uUSE5blIiJkR0QvbAK6HYX7xWKmyv9PGbPnAmlF06Nz6apubbe5qNRAIo2HO+rdV1TSX b07J7Vnu6Dzv2HJgSSSwieA3cm9S7wYihuRuQkHwDsfnGMPK/RTXCSlFrgm+KDZihjKY zKR3nO6yXXPLxJTC81Z2A6gPmuu3UhmUJE7M1bG5Zg5dnZG8ddmFSs0Q7UJwSt42oe76 2bGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eLTaYXFfEvWJwtTV9XE/FK3rylA4/eO3eW5Jop9xwpM=; b=lmjApsl3mRqkQpOa2eJ+Ck/m5ivn7ZrGtFeA10L18tl9mAfhZWRzHW0dKEPqmYSD2H VcLEUkYvYLzrStNm9AXKah2uiUinUpeU6X1xQtGwa9ObqAYytw2vz3YZvUg64FOik5u/ vX54FRd3cdQ25zZVqFptmPV2kD9qxAcZazJpebr5TE6EHVjC+PnxREl7Q+W8Wo6ETyNe /qd1/Ud8qK28dfHVf1wIgFAOHRgHDU2bW4EJClHomuF+fOxqLUyM/pNphxhXJb56T/ZM 3g+/GV4A7q54SzuibuV4BuOELyQN09vppXe2IR1B6ItMg3lxmUozK9tVMisuhhISEX59 z/lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fcQhHFce; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si2922624pgo.330.2018.07.04.02.52.04; Wed, 04 Jul 2018 02:52:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fcQhHFce; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932733AbeGDJwC (ORCPT + 13 others); 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-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 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(-) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);