From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753518AbdKHVB3 (ORCPT ); Wed, 8 Nov 2017 16:01:29 -0500 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:61529 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbdKHVBZ (ORCPT ); Wed, 8 Nov 2017 16:01:25 -0500 X-Host: surveyor.tdc.vzwcorp.com From: "Levin, Alexander (Sasha Levin)" To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Takashi Iwai , "Levin, Alexander (Sasha Levin)" Subject: [PATCH AUTOSEL for-4.9 30/53] ALSA: vx: Don't try to update capture stream before running Thread-Topic: [PATCH AUTOSEL for-4.9 30/53] ALSA: vx: Don't try to update capture stream before running Thread-Index: AQHTWNMmDtmKnfXTb0KLLLrdPCdfXA== Date: Wed, 8 Nov 2017 20:50:02 +0000 Message-ID: <20171108204940.27321-30-alexander.levin@verizon.com> References: <20171108204940.27321-1-alexander.levin@verizon.com> In-Reply-To: <20171108204940.27321-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vA8L1Z93003766 From: Takashi Iwai [ Upstream commit ed3c177d960bb5881b945ca6f784868126bb90db ] The update of stream costs significantly, and we should avoid it unless the stream really has started. Check pipe->running flag instead of pipe->prepared. Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/drivers/vx/vx_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 11467272089e..69f252585780 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream int size, space, count; struct snd_pcm_runtime *runtime = subs->runtime; - if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) + if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE)) return; size = runtime->buffer_size - snd_pcm_capture_avail(runtime); -- 2.11.0