From patchwork Fri Dec 1 13:43:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 120323 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1154674qgn; Fri, 1 Dec 2017 05:43:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMaGmhGHWcMtGfiR+T6wdfIaTRzNFSYPLBvz8kTES9ri7qUsf/33mmF5M0yQ20Dn8llPthjo X-Received: by 10.28.141.211 with SMTP id p202mr1218324wmd.61.1512135822509; Fri, 01 Dec 2017 05:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512135822; cv=none; d=google.com; s=arc-20160816; b=UeNgcj4ogjI28krFUFoqCPVsi4LEkq1EVO82q5yP5JpSFh8497CYnbNzybGHwLCdmX wGuhhhbS2+3SP+4p+79rGRvCqOvogFZq19yOi+NtPeJapejTjK9ZeUUobcC/Bg3i1AxL fjCAy9Av3tOLofdM29S3M9P/ruAEANzT/g5VcfBikSRZXMfBxOAbgiGd9qaTxVRTcmLu XdqA7Mgyr+kNzbJlAo4oO4smXoDC4kCL2nfNBSldv6/ll4E13DInfiXwaQY4y3xPvce7 60EpV4ft3m3ZcVzdvGpbc7WtE93/bJp2SdHgxsI+uaMUInZX7QozOY1Q707CeDh5UBZ0 tbqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=QL22O1TSJzB8W8HptBzThi852vs+EF+WBiKpWyQsg3I=; b=v4sCscyMn/07oGepeC2r0iuuEAWgS4MiRFVDBwgyh/6haNuN3LwhzS4Js1Z5n6Q0AQ 1OnGt7zAo15jWUH/nZrdsfAfNhGC3grQb4rQ4CI+l1XFWMF0E9l+Kcoa2OPWDl+cPOiR lAGv/F3QAU/YdW+qk7j/hWvCARATGXxkkJzbY35Qn9U9nkPQYDnpu24d04SqHN/fDPQv FPQTZfqaH5/zFlp12qtZLny47t3OHqoRyaiRINgPHdB3JwlC5jl5d6RXGn3SEIFuycQ8 vG2k9j5h5bsPrc1rtwFBumtWb3/cY/93qVPJgNbw17rCMrU7PJFcpXF1veQHtSnTC6Pl 6Epw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iq78oN+q; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id l34si5233186wre.522.2017.12.01.05.43.42; Fri, 01 Dec 2017 05:43:42 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iq78oN+q; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4AD33267C7A; Fri, 1 Dec 2017 14:43:39 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 181C0267C6C; Fri, 1 Dec 2017 14:43:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 58231267C5D for ; Fri, 1 Dec 2017 14:43:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=CUCnDaHN5S6tQi/ob10VosMgeyiaMwVmV995WMfwa9M=; b=iq78oN+q5htV m1rIm2pWYvLaYojuGeSdb95JWVeVYwh7zViTT8fCPo8X1g5X3LlxWextPD3mVsHIFtIXQUcOcYSlN cJDiwNmoozOUopZTlz8r+Lqml7/axXElNBinGgzTkFFemLZosj9vCLhiUp0/nV5wek0LRikL7bzox 2uaC4=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eKlb8-0005NI-5L; Fri, 01 Dec 2017 13:43:22 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eKlb7-0001B2-Ob; Fri, 01 Dec 2017 13:43:21 +0000 From: Mark Brown To: Andrew F. Davis In-Reply-To: <20171109002741.10897-9-afd@ti.com> Message-Id: Date: Fri, 01 Dec 2017 13:43:21 +0000 Cc: Mark Rutland , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Tony Lindgren , Liam Girdwood , Rob Herring , linux-kernel@vger.kernel.org, Mark Brown , =?utf-8?q?Beno=C3=AEt_Cousson?= , "Andrew F . Davis" Subject: [alsa-devel] Applied "ASoC: tlv320aic31xx: Check clock and divider before division" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: tlv320aic31xx: Check clock and divider before division has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From c6b8c779213dfe2a31e12400b1a2cf2a9a843236 Mon Sep 17 00:00:00 2001 From: "Andrew F. Davis" Date: Wed, 29 Nov 2017 15:32:52 -0600 Subject: [PATCH] ASoC: tlv320aic31xx: Check clock and divider before division If our set_sysclk DAI callback has not been called yet p_div will be 0 and dividing by this will cause an error. Print an error message and leave before this. Signed-off-by: Andrew F. Davis Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic31xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.15.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index ab03a19f6aaa..05e6d194d6a9 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -754,11 +754,17 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec, { struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); int bclk_score = snd_soc_params_to_frame_size(params); - int mclk_p = aic31xx->sysclk / aic31xx->p_div; + int mclk_p; int bclk_n = 0; int match = -1; int i; + if (!aic31xx->sysclk || !aic31xx->p_div) { + dev_err(codec->dev, "Master clock not supplied\n"); + return -EINVAL; + } + mclk_p = aic31xx->sysclk / aic31xx->p_div; + /* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */ snd_soc_update_bits(codec, AIC31XX_CLKMUX, AIC31XX_CODEC_CLKIN_MASK, AIC31XX_CODEC_CLKIN_PLL);