summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2025-05-10 10:48:52 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2025-05-10 12:11:02 +0200
commit1b83a9f41bd13dae09fabf594918ea36a9bc0cfc (patch)
tree03984241981ac913db37eac4a44ed328d4a9c1f0
parent3328eb4dfec23cb3055cda24087cd1cdee925676 (diff)
media: amlogic: c3-mipi-csi2: Handle 64-bits division
The kernel test robot reports the following error when building on Hexagon with hexagon-allmodconfig. ERROR: modpost: "__hexagon_divdi3" [drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.ko] undefined! The error is caused by using DIV_ROUND_UP() with a 64 bits divisor with a 32-bit dividend, which on Hexagon and clang-17 is resolved with a call to the __hexagon_divdi3() helper function, part of the compiler support library and not available when building Linux. Use DIV_ROUND_UP_ULL() to fix the build error and avoid calling the __hexagon_divdi3() helper function. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505101334.UHxNcUUO-lkp@intel.com/ Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c b/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c
index f92815ffa4ae..1011ab3ebac7 100644
--- a/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c
+++ b/drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c
@@ -5,6 +5,7 @@
#include <linux/clk.h>
#include <linux/device.h>
+#include <linux/math.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
@@ -321,7 +322,7 @@ static void c3_mipi_csi_cfg_dphy(struct c3_csi_device *csi, s64 rate)
u32 settle;
/* Calculate the high speed settle */
- val = DIV_ROUND_UP(1000000000, rate);
+ val = DIV_ROUND_UP_ULL(1000000000, rate);
settle = (16 * val + 230) / 10;
c3_mipi_csi_write(csi, MIPI_PHY_CLK_LANE_CTRL,