From patchwork Wed Oct 8 07:58:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonny Rao X-Patchwork-Id: 5053061 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4DE80C11AB for ; Wed, 8 Oct 2014 10:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EA67201F2 for ; Wed, 8 Oct 2014 10:22:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0A883201CD for ; Wed, 8 Oct 2014 10:22:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D34B52608B2; Wed, 8 Oct 2014 12:22:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F1988260424; Wed, 8 Oct 2014 12:21:29 +0200 (CEST) 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 6A6AC26041D; Wed, 8 Oct 2014 09:59:02 +0200 (CEST) Received: from mail-oi0-f73.google.com (mail-oi0-f73.google.com [209.85.218.73]) by alsa0.perex.cz (Postfix) with ESMTP id 4F88F260416 for ; Wed, 8 Oct 2014 09:58:55 +0200 (CEST) Received: by mail-oi0-f73.google.com with SMTP id u20so1669322oif.4 for ; Wed, 08 Oct 2014 00:58:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ij7N7GKCdrWCxHpxOJBU+P+jQzfqmHOjmS2YJncORjA=; b=F7SbCeTftNveJu4694NDaV9i5/lOK6CAnKldndXiTgX8VClwqGmkj7oellUdo8gob+ StJtg5HyRJX4hORwfnjViwlCBQVJ3MxBkjTBTlfWFjxDyYslCHNn9Xo/CFY5dqyWXkoD X+r7vIuk5brNCS2PCvEn37GtNWELMD8TXuMSofBRXE+PV+1mMREc4LP2ErPfkz43dj9E Xe8UO1xYIntCg67AuqZelKzazgmsa8VZ2KrqKe6HoMoOV11ncRuzRpc6rBCprH34SVLt Vtd7CE6gjJTckaVz7AKhv9Z8KIFF6tQ4JPPqPhiVlYdXkusp6Iip+ygMA64ozVGqKv9V 4X6Q== X-Gm-Message-State: ALoCoQmY94ywqvb3Y9xvgMtkPwmkAcX8cm6AE/Xi62xcZLe/PSisFBB01w0uh9gtcSN0VFY5c/JCK1oSOAM3boup8YExp+TSs4PLGwEDW79g3aXTEtUOFnZcy6c7nYJvYpd2AIyCMQ4Lcn5kJnn1Cw0+VLDIaIOVon+I2UojFgUc1IvQVVAxGyI= X-Received: by 10.42.213.201 with SMTP id gx9mr5675017icb.13.1412755133918; Wed, 08 Oct 2014 00:58:53 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id n63si985263yho.5.2014.10.08.00.58.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Oct 2014 00:58:53 -0700 (PDT) Received: from sonnyrao.mtv.corp.google.com ([172.22.162.1]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id UJqLUPsG.1; Wed, 08 Oct 2014 00:58:53 -0700 Received: by sonnyrao.mtv.corp.google.com (Postfix, from userid 129445) id 945E9A0C03; Wed, 8 Oct 2014 00:58:52 -0700 (PDT) From: Sonny Rao To: Mark Brown Date: Wed, 8 Oct 2014 00:58:51 -0700 Message-Id: <1412755131-27542-1-git-send-email-sonnyrao@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 X-Mailman-Approved-At: Wed, 08 Oct 2014 12:21:27 +0200 Cc: alsa-devel@alsa-project.org, dianders@chromium.org, Heiko Stuebner , Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , linux-rockchip@lists.infradead.org, Sonny Rao , Jianqun , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl 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 X-Virus-Scanned: ClamAV using ClamSMTP We can get into an infinite loop if the I2S_CLR register fails to clear due to a missing break statement, so add that. Signed-off-by: Sonny Rao --- sound/soc/rockchip/rockchip_i2s.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 033487c..f373e37 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -108,8 +108,10 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) while (val) { regmap_read(i2s->regmap, I2S_CLR, &val); retry--; - if (!retry) + if (!retry) { dev_warn(i2s->dev, "fail to clear\n"); + break; + } } } }