From patchwork Mon Feb 8 08:49:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 8247061 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67CF0BEEE5 for ; Mon, 8 Feb 2016 08:51:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83BC8201C0 for ; Mon, 8 Feb 2016 08:51:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB03C20173 for ; Mon, 8 Feb 2016 08:51:47 +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 1aShWF-0000A0-Ha; Mon, 08 Feb 2016 08:50:03 +0000 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aShWB-00008F-41 for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2016 08:50:00 +0000 Received: by mail-lf0-x22a.google.com with SMTP id 78so90773733lfy.3 for ; Mon, 08 Feb 2016 00:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=g42ZAGa1SaGx53qS/CPc3NBQGffO+lteVkFvaf2eeJc=; b=JpFaDwmLmPjymz2k8AANLO+GNYkWUUN+USZ+cqj9wx3SiB49/F5egNEo81ttT0IYSm cyHgKlKu0IkB/r5zdTU0ibTQLzgkfy9VlXWjWB+p0Ga6+OkwZrOM0PnFF4wTmEVb7Ef1 zxnTVVWkzTpjevRlc1z71zyHBJ8Hot9QXWc2s= 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=g42ZAGa1SaGx53qS/CPc3NBQGffO+lteVkFvaf2eeJc=; b=It0ZdRnCVSm0TAmQATGIPlyK1QiqOycxIzmDnY+2tBRhavFmA2jTTH4hwtlh2uSPzG PZuwsUfcoEjluJJHrftBwmGO81lw/rwzMaiqepbvx/L4Vv1XGIWKheHP6UyLSZmJ/bT6 6a3NOx1FUjyyjwAWmAVPFb0gUwbh9rn5cRplp+1+7ZV1BHp5iOh4HfT2x4uvUia2MdMF O/olYfXDnb3PGJ6K68ms0MdQRwB8DNtIz/C0MpKEnTC/gAkTcvBWGAHjos1A6YU9unst m527CJtTFDlzN9hbbVtbvxQ48mXC3Y6W5DV01GYEjYjl7PDlOVMWsF2e85HZhzitqppG YRzg== X-Gm-Message-State: AG10YORJzXoURRjtrtbcqXC5bn16CGMUX3yfWpsw88D8OjXGckMAo7Nfq0VLMh2ppoofjkQU X-Received: by 10.25.83.137 with SMTP id h131mr2038622lfb.0.1454921376026; Mon, 08 Feb 2016 00:49:36 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id ay2sm837995lbc.39.2016.02.08.00.49.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 00:49:35 -0800 (PST) From: Linus Walleij To: Russell King Subject: [PATCH] ARM: ICST: try other dividends than 1 Date: Mon, 8 Feb 2016 09:49:25 +0100 Message-Id: <1454921365-4140-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160208_004959_353218_CBC6A010 X-CRM114-Status: GOOD ( 14.48 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Since the dawn of time the ICST code has only supported divide by one or hang in an eternal loop. Luckily we were always dividing by one because the reference frequency for the systems using the ICSTs is 24MHz and the [min,max] values for the PLL input if [10,320] MHz for ICST307 and [6,200] for ICST525, so the loop will always terminate immediately without assigning any divisor for the reference frequency. But for the code to make sense, let's insert the missing i++ Reported-by: David Binderman Cc: Russell King Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij --- I ran into the mail David sent in december and looked closer at this. It's not a regression in any deployed systems but it's disturbing so let's fix it. --- arch/arm/common/icst.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/common/icst.c b/arch/arm/common/icst.c index 2dc6da70ae59..3b3e58b7ba74 100644 --- a/arch/arm/common/icst.c +++ b/arch/arm/common/icst.c @@ -58,6 +58,7 @@ icst_hz_to_vco(const struct icst_params *p, unsigned long freq) if (f > p->vco_min && f <= p->vco_max) break; + i++; } while (i < 8); if (i >= 8)