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 B2C74C43215 for ; Fri, 22 Nov 2019 11:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 833D120708 for ; Fri, 22 Nov 2019 11:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574421795; bh=UcVJUPglSscPWgOYcHOUcXLNRDwLqyUnDRJRi2uan6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gxu4RWonqdj4h5tAXpC5pv004U+KqSwzzA7nPQvGG39a7ZrSPnH6gGXNp1uTT5ULd AycVRxQZ4ouExhtl+5Msmk9wXdUwHOlLZGSndtiPibF4i0E29kmKwT7aosGhEw3tLJ uMJA6nAvd69X9TNNOx5RF231RkkX1A6Z4FVRixns= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbfKVKlc (ORCPT ); Fri, 22 Nov 2019 05:41:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:46110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728282AbfKVKlb (ORCPT ); Fri, 22 Nov 2019 05:41:31 -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 D452920718; Fri, 22 Nov 2019 10:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574419291; bh=UcVJUPglSscPWgOYcHOUcXLNRDwLqyUnDRJRi2uan6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1nG3EM9Z/OP+WBhnhWojqSxG+nu/qQK8zARAiZoUkODWe2aYpNR/0QJ8ylJ6m68uG qMpYzrsnFo9zabHErC5Hsh7s/iNHos08jC4Rz+II4yRx4BTUX/kWtcducH5RV5QLlT hF/JWQnLpMkhEDYQfmMNg9OK6ZfbQyRFERQ3rQZY= 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.9 025/222] ASoC: dpcm: Properly initialise hw->rate_max Date: Fri, 22 Nov 2019 11:26:05 +0100 Message-Id: <20191122100838.904100409@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100830.874290814@linuxfoundation.org> References: <20191122100830.874290814@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 1d00f6e894ef4..d69559e458725 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1592,7 +1592,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