lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <042c2c0a-f9bf-4ca9-8c53-fa39d4edc5ca@amlogic.com>
Date: Mon, 12 May 2025 10:47:47 +0800
From: Keke Li <keke.li@...ogic.com>
To: Jacopo Mondi <jacopo.mondi@...asonboard.com>,
 Hans Verkuil <hverkuil@...all.nl>,
 Daniel Scally <dan.scally@...asonboard.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
 llvm@...ts.linux.dev, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] media: amlogic: c3-mipi-csi2: Handle 64-bits division

Hi Jacopo

Thanks for your patch.

On 2025/5/10 16:48, Jacopo Mondi wrote:
> [ EXTERNAL EMAIL ]
>
> 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@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505101334.UHxNcUUO-lkp@intel.com/
> Signed-off-by: Jacopo Mondi <jacopo.mondi@...asonboard.com>


I agree with you.


Reviewed-by: Keke Li <keke.li@...ogic.com>

> ---
> Hi Hans,
>     this should likely be fast-tracked to land in v6.16 with the Amlogic
> C3 ISP support.
>
> Thanks
> ---
>   drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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,
>
> ---
> base-commit: 3328eb4dfec23cb3055cda24087cd1cdee925676
> change-id: 20250510-amlogic-div64-div-6d0d5a6ec566
>
> Best regards,
> --
> Jacopo Mondi <jacopo.mondi@...asonboard.com>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ