From mboxrd@z Thu Jan 1 00:00:00 1970 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 8928CC636D4 for ; Fri, 10 Feb 2023 23:25:58 +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:Date:To:Cc:From:Subject:References: In-Reply-To:MIME-Version:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R4p8UhrzFEecHre2XYyz6UxChc84k7P8Hgjo07FrZYI=; b=B5cwij06+hecqm Q3p70tjhkqL0HYkfkJ+DuIOuITcjxzZ/vo11XdhqRUF3q0F2xTD6l9sfmG3dWul0+Mry6ZQgv35mx ENWecP2Q+nP31XNzR0AyyvQgUWZYfC1RDN6mYx6E1Vhz7OFRl1kH7KRkJWZ0hjGb8dlNb+8g2yFUA zJwYwwYpJ8IXjb8VyfZ8eyT3rXkd++S1KeIBkiQDjAmI39AvZki2U3LMHkEXHtL4INL04nxjYJ/PV Ina7eNbgq5iEfSNcEbBRy4jlyvEMR2Mxk4Q8FTCuqruqM78/7IPdKQ3sb3MWjzsr7bKbeewBWFpEr gfx+1AUYDd6nE+9XomXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQclI-007uXv-PH; Fri, 10 Feb 2023 23:25:00 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQclF-007uXO-St for linux-arm-kernel@lists.infradead.org; Fri, 10 Feb 2023 23:24:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A22661EAD; Fri, 10 Feb 2023 23:24:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5BB2C433EF; Fri, 10 Feb 2023 23:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676071496; bh=pY/6dp0qgOqHjnt0x5AtFF4eHqafITwwbuPlyj1PCEM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=eGqnzLgGu/0OmFkFyM2Gms/HqzzYxQwEPdC9U+u4l5Ne5+M8wXBsCtrT+dgnMxFfS bg8E/4pqmYKC180pXyO0KwUIpu7mukf/Y4Girt65V/t+fSY0riyd+DJQrOvE6wFLkT YUrBjoxrW8O+GS077SJhqQ/VBUjSgDGLzyJMZD2FpOMK1oxsW7RsywGweslJ0ChyqX CF2+20omGvZs/92WUnJlKG8LyHRN374U942yHJtD0kamqy7MED9sFS7JY2zejhC31u UYdY3s+iL0O0MARCrbWzRJk61hsfg9wOQhRChr2SgIWYrZCDrc/Hi4grS0bwCdv2ky CtAjKtZi2afzw== Message-ID: <21e4cb835f678faa911ef97d28931246.sboyd@kernel.org> MIME-Version: 1.0 In-Reply-To: <20221210203835.9714-1-kgroeneveld@lenbrook.com> References: <20221210203835.9714-1-kgroeneveld@lenbrook.com> Subject: Re: [PATCH] clk: imx: pll14xx: fix recalc_rate for negative kdiv From: Stephen Boyd Cc: Kevin Groeneveld To: Abel Vesa , Fabio Estevam , Kevin Groeneveld , Michael Turquette , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 10 Feb 2023 15:24:54 -0800 User-Agent: alot/0.10 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230210_152457_989419_69FBACA2 X-CRM114-Status: GOOD ( 11.19 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Kevin Groeneveld (2022-12-10 12:38:35) > kdiv is a signed 16 bit value in the DEV_CTL1 register. Commit > 53990cf9d5b4 ("clk: imx: pll14xx: consolidate rate calculation") changed > the kdiv variable from a short int to just int. When the value read from > the DIV_CTL1 register is assigned directly to an int the sign of the value > is lost resulting in incorrect results when the value is negative. Adding Can the field be negative? > a s16 cast to the register value fixes the issue. > > Fixes: 53990cf9d5b4 ("clk: imx: pll14xx: consolidate rate calculation") > Signed-off-by: Kevin Groeneveld _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel