From patchwork Thu Apr 28 18:30:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12831098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD7C7C433F5 for ; Thu, 28 Apr 2022 18:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hgqvv4hX4L/H9g04T4uUuBZA7+9ylrFhUTJNEslAWok=; b=1eYJYQDyTQjVvD D9V6hCzMzn4OOXab8TAoFs2ucTn2n8HpgA/ClHOnDWcRFoSCKNc/32iPKjwIRa0CzWPHbM6kN/S9H 4ZzSTSMOAtSqimW8NSkucTv4MZ51EKl1yMYvIWQQOMqbQGMGSCouSOA91lPMM5VleD1IvgA1Lmnar 4CgieHB46A5y+95ITV4rBwhxNDaxbxXYGkRvKJwZvaxqqt55On1btrtFtUTwo5smX03mTnbnzdRAV D3yf8LUQhxWUc0U37/e90Zpjallac9K48tNGWWCYgNFb8BWP/rrDC099DtYll9uBBT71erhwyj7vM 0R17TNGrHZ0PY4PRPq5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk8vG-008Bok-8k; Thu, 28 Apr 2022 18:31:27 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk8v8-008BlD-5R; Thu, 28 Apr 2022 18:31:19 +0000 Received: from localhost.localdomain ([37.4.249.94]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MeTHG-1oKIcH3Ufs-00aRvm; Thu, 28 Apr 2022 20:31:05 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Michael Turquette , Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren Subject: [PATCH] clk: bcm2835: fix bcm2835_clock_choose_div Date: Thu, 28 Apr 2022 20:30:10 +0200 Message-Id: <20220428183010.1635248-1-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:ROg9fHO+7lB5ftkBrfzS6z5Xqc0WiEHelZu+8KRp+4H7JD2NLNK 0CQUdONatjMCTxpBiiNSdY+Nb4nNGVYkG404BvDZnW3+ao8ZjF0eFeq0OE/UiwjPrNQT13m rke7opJan1AoEu72mcXIABbNueCdoFdKos/ddLXuCjzvtnOziUzGsbVFt8AS3mGFzcYls1f M4umhJIqagTJRsSDSrQfw== X-UI-Out-Filterresults: notjunk:1;V03:K0:1HqqFbLnT3o=:vmhdHLj7PGOk5jSXwMWq32 rA3esa3S6D43+/pkCwJNboeuBAedAj8OwBQ90339Ccb5n7Z1ymmADUl03cIfMgdMC7t2HmFyI bnsYVJE0HI7tVkziGv1ToF7AcMGyymTJ/nEs8yk4rKVPDo2laljt6WNsqwBEW2rmhqZh8W/cC 3SUg8k4xB48IiSAbmpvdkfUSsntavkdjpuAspB4jxwXGyNGUoFSsA/wRbYkBnL933NvIQhR7d cyaKGvoTMemm0XQ2zB8k4SmGjMO+pwABRaUi4jDhFAhIwulQ+gj1a0ENg9cX5UaE1kjYuR8SN Hyk0xwB35GZC5/0L59grXHUkzal2SXrft/NOHgRh1ay7wZdcIiCGstiZsT4RUiRJWM4uulBlH mu9YuUzP6DpfYxar5Z9hJTKQj9WuxaUeLHVCiycc4gvDx8THT17PpgTO3jz7vaIk9/qRo8MNq imRn0wt4q8bB1B/zaT0c5Dn8oK0VNLUa4GYktVJfmq27tBv83sds476TpXo7alEYIh1jNwu3H HNeNH4igDJ746jO0mTiIYbCqyJCSY/oVnITU0dJcLUd4dhNG8dBY0CbDhPyYILYfTp2ue2w3d V8apEH6GfgWs/qAXVr9Q9Diqqsx0ppSZUVtpPV2zzCxaORtsqPZ6cG5mBLTG71t3oi4tsEFy+ 2R9HcPgYsTdeuQujMte6OUmx+dA0nKDqD7o6cRPSbLhBXrxxZLkTZB3lnS/I2SdKZU/AVdGiu 2UNKmC4vn11tBsFu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220428_113118_425199_97060D2B X-CRM114-Status: UNSURE ( 8.40 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The commit 09e3b18ca5de ("clk: bcm2835: Remove unused variable") accidentially breaks the behavior of bcm2835_clock_choose_div() and booting of Raspberry Pi. The removed do_div macro call had side effects, so we need to restore it. Fixes: 09e3b18ca5de ("clk: bcm2835: Remove unused variable") Signed-off-by: Stefan Wahren Acked-by: Maxime Ripard Tested-by: Maxime Ripard --- drivers/clk/bcm/clk-bcm2835.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 3ad20e75fd23..48a1eb9f2d55 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -941,6 +941,7 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw, u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS; u32 div, mindiv, maxdiv; + do_div(temp, rate); div = temp; div &= ~unused_frac_mask;