Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1007723imm; Fri, 27 Jul 2018 09:38:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd64y18TWxDwqIuVzQX+SNG9KlHboAPDFvxvpusvsDNZRISb0oLhcWdKX6uqG7Y0dpyQzre X-Received: by 2002:a17:902:8a92:: with SMTP id p18-v6mr6816087plo.148.1532709530623; Fri, 27 Jul 2018 09:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532709530; cv=none; d=google.com; s=arc-20160816; b=rbtx+E2UO+TKYxIaUWzniZOd45JqcNkcZ9kdIP7QZKdwvoKLVgYP6+MYobL47+OI30 VGHFggLf6R7VHL/LSfYeULRuvBN5IhHQnMuZr+uQkkCfspCzM3GvYJUm/uk6QIu629vS nvs3+weE4AmStEveylqa1bOKhjJWKuQElTHOodVe6YbYhrYymWpw2mUXdmg0Iajve1bv mB1C8/YjjAmHtFpZ3eHb0pstj0gZRu5n7KefOPgScPAX2CiPsi2PQsEiUv2Ubs6mt7OF HTtQ5SXcwACMaOQ3UGw6APvKPQHudjguD2b31w9S/M3vYX4HRqzItARgpdAuVrU+UqVs enlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=OJ8ltedo6YAejIRW7aTvuL+D6NUvBpOM5MykBRjpIZM=; b=epqDXiBmVdX+C4V84NYeDVVcMZXyN834WO6Uv4IyKpYHypEF6UbSHwgpAoqTvonA6F EmHh+LmSBopsqLd/gDjAP4xt+BukCQmJ0FD496WnTVQjD5lQ5GWrhbIAoMRRWs4aAELK rMT+tVbnbU8uCt0Zq7V8RILao9GdzD8bS2mM0Eh1QldvXPaS5dXhDRAeOjeO/9Wqd0xy uhT0OVDNR3QVXrkV5fiUHButyZ1vNKq6BnNikfespwh3wFzW37ZgYS+LDvxnyGBfPNsZ PVaXFEvvEC2MIdjy5L+TThpfpuGtFnHcJCDvB7e0QhDSVrXAXdCH+uU5iobR2YgVkayG HoNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cOOkqBLJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34-v6si3929170plf.495.2018.07.27.09.38.35; Fri, 27 Jul 2018 09:38:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cOOkqBLJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732148AbeG0SA2 (ORCPT + 99 others); Fri, 27 Jul 2018 14:00:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730205AbeG0SA2 (ORCPT ); Fri, 27 Jul 2018 14:00:28 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE45B2089B; Fri, 27 Jul 2018 16:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532709468; bh=tAvZRyxzXAURJ2Yay1vs0wJO/rOmGCB9AmY6IZCPbXI=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=cOOkqBLJEhSyzMela7QW05wLSb35lu7v81ugWTIOhVn2jyl0HR6eWJWO9eKu37jl+ NrRa0t0m59o5x2mkTxIVDr3RrBs2lFsZxUA8dBNktF2q5V/Kde6kp3wZlb4E2I3q7T NSIAvJds3t/DyL6VHsly72QhPLOLZNWpb4S8iBdw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.org From: Stephen Boyd In-Reply-To: <1532700112-11852-1-git-send-email-amit.kachhap@arm.com> Cc: Sudeep Holla , Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Amit Daniel Kachhap References: <1532700112-11852-1-git-send-email-amit.kachhap@arm.com> Message-ID: <153270946725.48062.11195853363758024681@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH] clk: scmi: Fix the rounding of clock rate Date: Fri, 27 Jul 2018 09:37:47 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Amit Daniel Kachhap (2018-07-27 07:01:52) > This fix rounds the clock rate properly by using quotient and not > remainder in the calculation. This issue was found while testing HDMI > in the Juno platform. > = > Signed-off-by: Amit Daniel Kachhap Any Fixes: tag here? > --- > drivers/clk/clk-scmi.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > = > diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c > index bb2a6f2..a985bf5 100644 > --- a/drivers/clk/clk-scmi.c > +++ b/drivers/clk/clk-scmi.c > @@ -60,9 +59,9 @@ static long scmi_clk_round_rate(struct clk_hw *hw, unsi= gned long rate, > = > ftmp =3D rate - fmin; > ftmp +=3D clk->info->range.step_size - 1; /* to round up */ > - step =3D do_div(ftmp, clk->info->range.step_size); > + do_div(ftmp, clk->info->range.step_size); > = > - return step * clk->info->range.step_size + fmin; > + return ftmp * clk->info->range.step_size + fmin; Good catch.