Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp8760pja; Fri, 22 Nov 2019 02:44:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwDgf18X8gHz3bWMj7gTASBkJk7wsiXhc1+v9t/o9zv7Zr7jMO31d5kZXHEMepSuDkNY99Z X-Received: by 2002:a17:907:2099:: with SMTP id pv25mr2454668ejb.144.1574419450319; Fri, 22 Nov 2019 02:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574419450; cv=none; d=google.com; s=arc-20160816; b=UZ8a02YP5yfjFhCeXt6HbRF8G/dybeFce/1C/aew7+ReKRTOi5lm3eNDc0t9lokzAi yiFWrqWXcHaDMwwepPKbTAARMEGoGCAUl4ayv37S9OErtO9saaNs6LzJRu7aMppwFwYt LwrzueIxRIpnBZKIuH8Rturc9R78goij2CGV9CPpr8BOuKXWda7DZxn9msJ9fS9JxpAy b8Q9X46MimpDgLRmMqDIJQzsH9zIiprXhYD96DtW5RzSSOxcJLpebIJk9ISbzC0Pwgn1 9pboTbJXWpBdfMdD4uWJfo23hIjFNd+OqN2aYv7efTrKyy0SJTSx7MDGSQAuA70GEBHu XrSA== 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=I+oJwhhoxCEkk96Wn1KALOYpQ+RECcNvKf6yvJmpyEI=; b=mjWMG7NzwOsbB70f1nflccjYNPt4XC/8XlWwmaK9bp+sWHT4Q0XWXRptL0G24hh6vm o1SkTrRbJt6qXFxJL2B+abfmyrWsycaKIwmNyarVCWXVTFQHmuK/jeHi0ymIjD9su1Yh rb6Lkfc42umTk1ijAlv44Jqo2T0irrwSltYbtZ074g+TIkx6r+bs3tdOUZH1/lHYEOfG Iztor99embTZeHCYiOH8jMmEa2xwBC07S255ZxZHveo9qdbi4eAuVChRFeJdRiI/kVdc K8lEuHj+rCJqzE0qnOddZ9MRYMLT1lKeism+ENfb20g2feCb+POywxSCUKFQpSsZV2Ib E94g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1nG3EM9Z; 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 mj10si4020514ejb.7.2019.11.22.02.43.47; Fri, 22 Nov 2019 02:44:10 -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=1nG3EM9Z; 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 S1729026AbfKVKld (ORCPT + 99 others); Fri, 22 Nov 2019 05:41:33 -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: 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 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