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);