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: 141054 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp600723ljj; Wed, 4 Jul 2018 02:52:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfeHFziVEHkLWj7m+7C3u1VdeuNboUy9qKjamjfOGzO870dT26CKnOzHwuPxwaHQ4FWqd6I X-Received: by 2002:a62:df4e:: with SMTP id u75-v6mr1438974pfg.195.1530697940680; Wed, 04 Jul 2018 02:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530697940; cv=none; d=google.com; s=arc-20160816; b=vJkpsWUCm7WzFjPC7h2XB7sdX7GdcwzxHtkMCJ3pS35obo9Tl1INaBko+VnRrh/u/N PNd9KMkH9q1stJLZKlON99vdiXI87tRbqnF6ySkTncVfpKOf/Jtz5qwSM2GUfG7J1GBu BUC9IXG3sBjOmLDl2JnbAX0pJud5/QBUGLJJqUzfZ+KSUxSn0jRrr3hgwzq+qk3M+xcm WGiveFndR4UusbBRTwidJ+IhTuY7FTcYadWGRmMV/HfYu2KTxSLDN0tVRv+/M9Iqqqr2 ncIydzRZlQiBTV3PN7mt42Xsqd7JcW6uAm+czkhLr1EDOsh/HhsZrgnLgzGtICGI1lo4 aybg== 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=GzRnCqEkYUdSxzSEw1NuPBJ6aHJcnfYqFrff481jP0M=; b=juJQo4KNEstosO15+5EKFHJdSXhIWEkP5cs0SkZYXgyj9G9wQo89/i51tnDYJG9vvo GOH1QGXe9BhL3xRXKEfXE27PhaN0/4lR5o6w8YrZ40B+gjpyIZDHKBzgdHiTzL2qB+As 9UoEDzxcMwMRfMAcfKSuu0XYyMpOCxx9qjfAG6vVxBpqA1cipgQbwcfeHXrNwD1VBA+R XvM2GynPu+RBbxn0oxa3kWA4pUGVfBL6wJcDhjC80Orco3mC7tTRXdACN5uk2n+iVCwJ Oy7RoOSO+wf4brOAs2SiocGQNyE+41GsA0PmNEkRUO58T2ojC9JaB6SkCopVLYuoMqPZ /6OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ns36ydYV; 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 c6-v6si2828400pgq.616.2018.07.04.02.52.20; Wed, 04 Jul 2018 02:52:20 -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=Ns36ydYV; 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 S933299AbeGDJwR (ORCPT + 13 others); Wed, 4 Jul 2018 05:52:17 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:52617 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932882AbeGDJv7 (ORCPT ); Wed, 4 Jul 2018 05:51:59 -0400 Received: by mail-wm0-f44.google.com with SMTP id w16-v6so5118734wmc.2 for ; Wed, 04 Jul 2018 02:51:58 -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=mTQp1j7SqPr7rAyRHdAQDcv5/sWbyqbHXDELuNc4PI8a4qv6rZS+opBER3kQEzZZgo dovFPVoY9s+Aj3NRhXvO+Y8CkgM4N4HWYz8ainWAqXy7IGmmr6HnvM8m+kXsiJ7Rqkks 93hxpCblf1ax3QRER1VeOW+4hpo8NS6HbeoNxeW42rEejFeg8dPZ7njETy5XErkldffN pkHAtoTDw90OYA118h2iPHNRyNsaWBfRO7/Ju5UC21zJGlhJ7Z6oLn118mADiFQCGRBZ SO+yfxR2VtVejgAFIn+oXZW+dBk9i158IyX+Gdrc0o8Lf/H286k3QsA2TvtBzb6kEzLl 1uyg== X-Gm-Message-State: APt69E2zW1wq0LKJTbZsW1dlaMbYrXlNLxzdUKTrLFc3LUGO5ixpvMf0 eYS4tQqYmwqA0dH34428kZiJ7Q== 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 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 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(+) -- 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/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); 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);