Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp129240ybc; Mon, 18 Nov 2019 21:48:59 -0800 (PST) X-Google-Smtp-Source: APXvYqz3ChmBodKNiAFU09TJtnFsBLB3IIvbQGyW7PmYyHTV4SgvHpWHiBMs+/UaoKgiU0fv3+Zn X-Received: by 2002:a17:906:8548:: with SMTP id h8mr32195401ejy.290.1574142539170; Mon, 18 Nov 2019 21:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574142539; cv=none; d=google.com; s=arc-20160816; b=B2WufAAE42jytw0wgdvDUzEIQHIwfbmagZCFLudBxsPDTg3CiQ7kf5d3ZZ5b9RWpgh ylchpw+FUk16gjIskravsjgz5LLWY0jOChTGFUDOrWS10DLrFmb3UbZa9v2hf/OghPum 1OGq0Cd2MZkWXdku1Dp3gzc8Ck5tZYvIFMcqSTFMpRg9QNM94z0ZVBiVU5ZR8SAUlHYX mqxS2NFIwZZ+w2ek2NsrTQexyh6q3eHLZEa6BpP8OcYTGJGDR5p1koTDzrdeUjG1Szk4 2K1iIbr63NapnPIm5QoSRKLIF2LNg3oO1JKq0qqoPZG0BiMDv7lBKwPd1ynwqBsCo/K4 SgEg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wyo6ovVlbs8NkB06tzY6E4qDdOwFReY1Xw7iCYb2P0U=; b=WjFLkgsJ4UXMwEDdqJ7I/xkUfAhg5Ks7rSXHUxKKFjEpz3MjD1WACKrd2F1AYSfLUb tE4RceqohvBoRZ5Kt76fmYXEYsb7z5l81/Oc94IgrVxcBA3EvEJFrisGPcgLeJHKGlJF WUhOvIqec4S/xhaJSo5jmRj1/AjfezM0sDIt4ey3IcdZtpHTa8TRTsoZMpfLpnL6Jvrf Bxg81aLwTShDz6eeHls6VTvf+hmb2d074GNhvZfVjK0lbYpIzhABemUWTrIou5HHc8fi jU+L1hb9P83tinooqf3u8W2xs3pPvlGSuUx4IFkKc5VafOiXfXAT4C6pG2ZmCBY0+L40 xPMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g1ohZ2sN; 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 a11si13313329eju.356.2019.11.18.21.48.33; Mon, 18 Nov 2019 21:48:59 -0800 (PST) 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=@kernel.org header.s=default header.b=g1ohZ2sN; 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 S1731251AbfKSFrh (ORCPT + 99 others); Tue, 19 Nov 2019 00:47:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:43888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728376AbfKSFra (ORCPT ); Tue, 19 Nov 2019 00:47:30 -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 6BB512071B; Tue, 19 Nov 2019 05:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142449; bh=TH9xCLF2rAa8rVklfhnNV7Qx4tBI5zCAyNdwfNZCEoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g1ohZ2sN7nKo5fRyCp02VA8yGDzo8n0+cKPEgu5i72YENupWxpMVPHWT8TWBnYnFS 4psEaMi98MdjkbD9RthX1tnA6Mh2KilRYDKnz4n1wYgv5vZR30fAfdygJljv03q258 OPyMPsCAxP2gzEohwfRWkqJ1LrxNVJFpGF0LQiCo= 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.14 045/239] ASoC: dpcm: Properly initialise hw->rate_max Date: Tue, 19 Nov 2019 06:17:25 +0100 Message-Id: <20191119051306.454651087@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 052b6294a4283..24047375c2fbb 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1578,7 +1578,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