From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0EA7C43215 for ; Fri, 22 Nov 2019 11:28:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DADB20674 for ; Fri, 22 Nov 2019 11:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574422089; bh=T1HMhi80T0r4Z48YLTNxWYaKRA822E5fSoTlYrs4cMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cj0O/0n0gymBXURDOyCOXWQ4zCgSH62gcvQJ2c239xeeTB/Ka1sv/7Cau1zX6E5qm 5gs9D3KIkCm9oHqgigqn5N3v+8xLhq2mCla+Ym/qWFqzZCXVt72YSAVL0fcs2qgwp/ jPQE/9MFxzkKR04HgpDO8J6sWCww3Qz60eQtlY1w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbfKVKbY (ORCPT ); Fri, 22 Nov 2019 05:31:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:51502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727263AbfKVKbX (ORCPT ); Fri, 22 Nov 2019 05:31:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B409A20708; Fri, 22 Nov 2019 10:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574418683; bh=T1HMhi80T0r4Z48YLTNxWYaKRA822E5fSoTlYrs4cMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CdfjKLaDeaywvDlQBCTo8xh1PP3bKFzpTx5KnQUa3eBk1aGSaKS1MvnsCNMQ9tWY0 0ec1tYi8/Mpi0zubSrUluxAY6wLHJuG871w3jX6oys/LfzJnXIpmHbpeeiSMopyf0g zKMgZzZqXvqS6ptz2INYPjTX68KNAIHVCJPOjUco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 4.4 017/159] ASoC: dpcm: Properly initialise hw->rate_max Date: Fri, 22 Nov 2019 11:26:48 +0100 Message-Id: <20191122100720.162399840@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100704.194776704@linuxfoundation.org> References: <20191122100704.194776704@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Charles Keepax [ Upstream commit e33ffbd9cd39da09831ce62c11025d830bf78d9e ] If the CPU DAI does not initialise rate_max, say if using using KNOT or CONTINUOUS, then the rate_max field will be initialised to 0. A value of zero in the rate_max field of the hardware runtime will cause the sound card to support no sample rates at all. Obviously this is not desired, just a different mechanism is being used to apply the constraints. As such update the setting of rate_max in dpcm_init_runtime_hw to be consistent with the non-DPCM cases and set rate_max to UINT_MAX if nothing is defined on the CPU DAI. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1c0d44c86c018..78813057167d7 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1541,7 +1541,7 @@ static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, u64 formats) { runtime->hw.rate_min = stream->rate_min; - runtime->hw.rate_max = stream->rate_max; + runtime->hw.rate_max = min_not_zero(stream->rate_max, UINT_MAX); runtime->hw.channels_min = stream->channels_min; runtime->hw.channels_max = stream->channels_max; if (runtime->hw.formats) -- 2.20.1