All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "clk: scpi: fix return type of __scpi_dvfs_round_rate" has been added to the 4.4-stable tree
@ 2018-04-10  9:03 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-04-10  9:03 UTC (permalink / raw)
  To: sudeep.holla, alexander.levin, gregkh, mturquette, sboyd
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    clk: scpi: fix return type of __scpi_dvfs_round_rate

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clk-scpi-fix-return-type-of-__scpi_dvfs_round_rate.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Apr 10 10:31:53 CEST 2018
From: Sudeep Holla <sudeep.holla@arm.com>
Date: Thu, 18 May 2017 17:19:28 +0100
Subject: clk: scpi: fix return type of __scpi_dvfs_round_rate

From: Sudeep Holla <sudeep.holla@arm.com>


[ Upstream commit 7374aec95636ca39409545eba4ef5ff3125c2346 ]

The frequencies above the maximum value of signed integer(i.e. 2^31 -1)
will overflow with the current code.

This patch fixes the return type of __scpi_dvfs_round_rate from 'int'
to 'unsigned long'.

Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)")
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/clk/clk-scpi.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -71,15 +71,15 @@ static const struct clk_ops scpi_clk_ops
 };
 
 /* find closest match to given frequency in OPP table */
-static int __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate)
+static long __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate)
 {
 	int idx;
-	u32 fmin = 0, fmax = ~0, ftmp;
+	unsigned long fmin = 0, fmax = ~0, ftmp;
 	const struct scpi_opp *opp = clk->info->opps;
 
 	for (idx = 0; idx < clk->info->count; idx++, opp++) {
 		ftmp = opp->freq;
-		if (ftmp >= (u32)rate) {
+		if (ftmp >= rate) {
 			if (ftmp <= fmax)
 				fmax = ftmp;
 			break;


Patches currently in stable-queue which might be from sudeep.holla@arm.com are

queue-4.4/clk-scpi-fix-return-type-of-__scpi_dvfs_round_rate.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-10  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10  9:03 Patch "clk: scpi: fix return type of __scpi_dvfs_round_rate" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.