From patchwork Mon Apr 29 09:47:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 163013 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp1665754ill; Mon, 29 Apr 2019 02:48:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjFoVqIcMChg5mllPOi2jouVIsdoe1PSmVuGqcR0spaoJR+wMGslhTiBDcXK3zdstv2O2f X-Received: by 2002:a62:480d:: with SMTP id v13mr63159727pfa.125.1556531290902; Mon, 29 Apr 2019 02:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556531290; cv=none; d=google.com; s=arc-20160816; b=wbrxw5ZCCxUB10/I9E8jACy4Onbl9uU/7l5YiZjhybioUKDAE6urbqYK535Ac68a70 MZweZBiBq5Qn+Z95a7TpK1f9ldo91rimEs3Y4utbcbVqp5T5dG5m/kZhwGat71TDczq0 smm5gW4cNL3wOssa+t+N4W2QZ0wWl6hwJvQOHix371D89YiFxxvWqEEgdpwdv1BZABHL GtcORRZqn7N24OzQBSSUr2DO/GqkMivzJHP4kTrFKX70V7r9PbIJScGmy3bAUkHE4GGj 7iPiXaYcfW/gslJhalGDr5h/zckvekbKF2d5iJsa1pTrPnEHcpnO7sDECbNJtZMB4GNP WBTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5lwkmI0zOv7BLpsbZZC29sb6Qw7tCofqiIoNLObPe54=; b=sXO2Z7WxkUHa50D0qDvAsVNWKhYksxvYU0qwLIjw0/GnYVrxZ0Gt/jU6Hi6oUy3joK ab4rs4loxwFeXbLLu0sXgmSdZzoxTyTD97EtPlbWA+Tn52Ak5JsoYHfrbF39hvednJoO QoFfxOjpw102OBHp/RUVdO2nEnKQwCYlG0iLSYr5O6yOvEzX9leeJLT+NDMMWiYP602G qviACqq72WyJjUhnaAkr7q4xlyos4kzZRwDgMpUx2hMC+NF3Q3HRrwatFeuoZ8rVEWXc CrPIMkH+jSUm0wcMABVY9amyLn+bDN0K1a0b8lOgOxbGZa3zMe/fwSzifDfEQlPTv11Q BhgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=L3oVRjgu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si31693219plk.297.2019.04.29.02.48.10; Mon, 29 Apr 2019 02:48:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=L3oVRjgu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727788AbfD2JsE (ORCPT + 30 others); Mon, 29 Apr 2019 05:48:04 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50652 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727726AbfD2JsD (ORCPT ); Mon, 29 Apr 2019 05:48:03 -0400 Received: by mail-wm1-f67.google.com with SMTP id p21so11350395wmc.0 for ; Mon, 29 Apr 2019 02:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5lwkmI0zOv7BLpsbZZC29sb6Qw7tCofqiIoNLObPe54=; b=L3oVRjguMhqlA0Z2Bbxuj4vY1G3zFDofgG8TuQyhbayfUvqNiThGHm0Efy3YfZ0PMr pO79kWWVi6mW3pYWM/LmvlWPj9OcUqbaUteiHlO4O7ee/5XpL5PsJZ0o2EhRpDZcbqXr aVpbS95VmUUu4eJMyM+FQaxlPVcZ+ya60i4bdWLgqfdYLzdK51kFkwv1bg/XzlSEX5lh nJv41NX75qyNsvaUVPcMxG0PhOeIhD2iutryaSn/ak9rnsAfcsZMy3UGwiJbiKQb9v1r rmKwEtIeTabuJubq1d3hXZNL9hIrJWb9pgdV/PYbdNrl31kp54ZGSGRn7IWP1P2VclTN CISA== 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:mime-version:content-transfer-encoding; bh=5lwkmI0zOv7BLpsbZZC29sb6Qw7tCofqiIoNLObPe54=; b=itIpbjKZkShuGinmDnpM/iz9WsMUJ6sAUWF8GB5V9HSF38mltfkqZSdhBC1eqZtO94 RgHNeWlEh1mPVdSxf2OZB9Ng2/1w8njnEQteYXg7VP1+8o4dYmTY+TSrmwo5htPw0Mx9 2qSBJY7J6Fhy+NQ8+ZiYrlS6uvlaQzw6XvltALUNMYVKK56d3Sdf1RclBbJV6zXTYHZK 4HCI/mCMowXBL+fpz3VU+OXs0mZdobin5kgOOPC8KLX/zXP8lN0ugnIuiA23LDPMYY2k G4+4FiqnKUNtd4KJ69/MY+0aiCTUL+jCdJBqxfcyKMPyJEVxQ6fxJgMnf8o9u7ZCDkao LKWw== X-Gm-Message-State: APjAAAUfUIAqLR+tpbakh9VKeYCd29TIMg9k96VJ30/Im0bMv45jFBWI psY3Xp2P5T7wS74uVQBqwBzGSw== X-Received: by 2002:a7b:cc97:: with SMTP id p23mr15087366wma.24.1556531281035; Mon, 29 Apr 2019 02:48:01 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id 192sm47987465wme.13.2019.04.29.02.47.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2019 02:48:00 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, patchwork-bot+notify@kernel.org Subject: [PATCH 2/2] ASoC: skip hw_free on codec dai for which the stream is invalid Date: Mon, 29 Apr 2019 11:47:50 +0200 Message-Id: <20190429094750.1857-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190429094750.1857-1-jbrunet@baylibre.com> References: <20190429094750.1857-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Like for hw_params, hw_free should not be called on codec dai for which the current stream is invalid. Fixes: cde79035c6cf ("ASoC: Handle multiple codecs with split playback / capture") Signed-off-by: Jerome Brunet --- sound/soc/soc-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 263086af707d..04ccdc59295d 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1020,6 +1020,9 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, codec_err: for_each_rtd_codec_dai_rollback(rtd, i, codec_dai) { + if (!snd_soc_dai_stream_valid(codec_dai, substream->stream)) + continue; + if (codec_dai->driver->ops->hw_free) codec_dai->driver->ops->hw_free(substream, codec_dai); codec_dai->rate = 0; @@ -1077,6 +1080,9 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) /* now free hw params for the DAIs */ for_each_rtd_codec_dai(rtd, i, codec_dai) { + if (!snd_soc_dai_stream_valid(codec_dai, substream->stream)) + continue; + if (codec_dai->driver->ops->hw_free) codec_dai->driver->ops->hw_free(substream, codec_dai); }