[PATCH v4 0/3] Fix clock division overflow problem

From: Sebastian Reichel
Date: Tue Oct 24 2023 - 12:19:41 EST


Hi,

I noticed the overflow issue while debugging an issue related to the Rockchip
RK3588 eMMC. It's not an issue on that particular platform and it does not seem
this has been an issue on any other platform so far, so I did not add any
stable Tags. Considering 64 bit platforms are the standard nowadays and 3GHz is
a reasonable small value, I expect this to become an issue soon, though.

Changes since PATCHv3:
* https://lore.kernel.org/all/20230630183835.464216-1-sebastian.reichel@xxxxxxxxxxxxx/
* Add some people to Cc, because similar overflow issue came up during s390 pull request
* Split DIV_ROUND_UP_NO_OVERFLOW into its own patch
* Add patch replacing open-coded abs_diff() from the previously applied patch

Changes since PATCHv2:
* https://lore.kernel.org/all/20230526171057.66876-1-sebastian.reichel@xxxxxxxxxxxxx/
* Drop first patch (applied)
* Update second patch to use newly introduced DIV_ROUND_UP_NO_OVERFLOW

Changes since PATCHv1:
* https://lore.kernel.org/linux-clk/20230519190522.194729-1-sebastian.reichel@xxxxxxxxxxxxx/
* Add Christopher Obbard's Reviewed-by to the first patch
* Update the second patch to use DIV_ROUND_UP instead of DIV64_U64_ROUND_UP

Greetings,

-- Sebastian


Sebastian Reichel (3):
math.h: add DIV_ROUND_UP_NO_OVERFLOW
clk: divider: Fix divisor masking on 64 bit platforms
clk: composite: replace open-coded abs_diff()

drivers/clk/clk-composite.c | 6 ++----
drivers/clk/clk-divider.c | 6 +++---
include/linux/math.h | 11 +++++++++++
3 files changed, 16 insertions(+), 7 deletions(-)

--
2.42.0