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: 5052071 Return-Path: X-Original-To: patchwork-linux-arm@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 BDCB8C11AB for ; Wed, 8 Oct 2014 08:02:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01C28201FB for ; Wed, 8 Oct 2014 08:02:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 299BB201F2 for ; Wed, 8 Oct 2014 08:02:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xbm9z-0008MA-At; Wed, 08 Oct 2014 07:59:47 +0000 Received: from mail-oi0-f74.google.com ([209.85.218.74]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xbm9T-0007wG-8O for linux-arm-kernel@lists.infradead.org; Wed, 08 Oct 2014 07:59:16 +0000 Received: by mail-oi0-f74.google.com with SMTP id v63so1669904oia.3 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=g2RuAGHfDD3PCyHbTW6N6h+S1SdiS4RJcGjkXl5Fq9EgkhGZuWEkVc4RZoF0992zjc s/39zM+yz2T/f57R3A6BtFaUxowx3MqmBzTPKe8juEAjd3A3h0USxJC1s/B3YH2KtKLg amzxz5QDrlYuC6fePQofvuHLisyLyBGnMxdkZ5jazpCWkVip2TFozAJjFCPvrtAIq4RW DM5oCn1X4TFXJFEOSdq8J5HrR0+uJVaSkahHnPmhvOOm1k23IzlZFf2nUvev1VDsjUTQ LRvIb5k+Z0wiCuTUc5K5MLLY/XC/8VNsSeSa9H4NvwTg4cDgDkEWosvV8+gCCNH0QvwY wQlQ== X-Gm-Message-State: ALoCoQlMToFyffMQy5PioSsCXf2pMjHjsDwfizMR7XcaklBwaLPsB1vA59EzzPPEKZSKPkklldYG 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 Subject: [PATCH] ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141008_005915_439019_F5F92BED X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -0.7 (/) Cc: alsa-devel@alsa-project.org, dianders@chromium.org, Heiko Stuebner , Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , Jaroslav Kysela , linux-rockchip@lists.infradead.org, Sonny Rao , Jianqun , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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; + } } } }