mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [esmil:visionfive 55/61] nvdla_core_callbacks.c:undefined reference to `__udivdi3'
@ 2022-03-08 22:59 kernel test robot
  2022-03-09  8:06 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-03-08 22:59 UTC (permalink / raw)
  To: Farzad Farshchi
  Cc: kbuild-all, linux-kernel, Emil Renner Berthing, kernel test robot

tree:   https://github.com/esmil/linux visionfive
head:   b75fcbba0e03fd9655bc4c8854422d51474664d3
commit: 6146bd9336a5f9d2bb66d6a394863600b61afeb5 [55/61] nvdla: add NVDLA driver
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220309/202203090611.3NpTkqvn-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/esmil/linux/commit/6146bd9336a5f9d2bb66d6a394863600b61afeb5
        git remote add esmil https://github.com/esmil/linux
        git fetch --no-tags esmil visionfive
        git checkout 6146bd9336a5f9d2bb66d6a394863600b61afeb5
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   m68k-linux-ld: drivers/nvdla/nvdla_core_callbacks.o: in function `dla_get_time_us':
>> nvdla_core_callbacks.c:(.text+0x396): undefined reference to `__udivdi3'
   `.exit.text' referenced in section `.data' of sound/soc/codecs/tlv320adc3xxx.o: defined in discarded section `.exit.text' of sound/soc/codecs/tlv320adc3xxx.o

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [esmil:visionfive 55/61] nvdla_core_callbacks.c:undefined reference to `__udivdi3'
  2022-03-08 22:59 [esmil:visionfive 55/61] nvdla_core_callbacks.c:undefined reference to `__udivdi3' kernel test robot
@ 2022-03-09  8:06 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2022-03-09  8:06 UTC (permalink / raw)
  To: kernel test robot
  Cc: Farzad Farshchi, kbuild-all, linux-kernel, Emil Renner Berthing

On Wed, 9 Mar 2022, kernel test robot wrote:
> tree:   https://github.com/esmil/linux visionfive
> head:   b75fcbba0e03fd9655bc4c8854422d51474664d3
> commit: 6146bd9336a5f9d2bb66d6a394863600b61afeb5 [55/61] nvdla: add NVDLA driver
> config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220309/202203090611.3NpTkqvn-lkp@intel.com/config)
> compiler: m68k-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>        chmod +x ~/bin/make.cross
>        # https://github.com/esmil/linux/commit/6146bd9336a5f9d2bb66d6a394863600b61afeb5
>        git remote add esmil https://github.com/esmil/linux
>        git fetch --no-tags esmil visionfive
>        git checkout 6146bd9336a5f9d2bb66d6a394863600b61afeb5
>        # save the config file to linux build tree
>        mkdir build_dir
>        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
>   m68k-linux-ld: drivers/nvdla/nvdla_core_callbacks.o: in function `dla_get_time_us':
>>> nvdla_core_callbacks.c:(.text+0x396): undefined reference to `__udivdi3'
>   `.exit.text' referenced in section `.data' of sound/soc/codecs/tlv320adc3xxx.o: defined in discarded section `.exit.text' of sound/soc/codecs/tlv320adc3xxx.o

From 1df1db244324a715b93af89586e4cce720ad2c94 Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 9 Mar 2022 09:03:03 +0100
Subject: [PATCH] nvdla: Use div_u64() in dla_get_time_us()

On 32-bit (e.g. m68k allyesconfig):

     m68k-linux-ld: drivers/nvdla/nvdla_core_callbacks.o: in function `dla_get_time_us':
     nvdla_core_callbacks.c:(.text+0x396): undefined reference to `__udivdi3'

dla_get_time_us() does a 64-by-32 division, hence div_u64() must be
used instead of a plain division.

Fixes: 6146bd9336a5f9d2 ("nvdla: add NVDLA driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Feel free to fold into the original.

  drivers/nvdla/nvdla_core_callbacks.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvdla/nvdla_core_callbacks.c b/drivers/nvdla/nvdla_core_callbacks.c
index 6d461624adfbda33..e296562d259b7124 100644
--- a/drivers/nvdla/nvdla_core_callbacks.c
+++ b/drivers/nvdla/nvdla_core_callbacks.c
@@ -38,6 +38,7 @@
  #include <linux/interrupt.h>
  #include <linux/irq.h>
  #include <linux/irqdomain.h>
+#include <linux/math64.h>
  #include <linux/module.h>
  #include <linux/of.h>
  #include <linux/of_device.h>
@@ -121,7 +122,7 @@ void *dla_memcpy(void *dest, const void *src, uint64_t len)

  int64_t dla_get_time_us(void)
  {
-	return ktime_get_ns() / NSEC_PER_USEC;
+	return div_u64(ktime_get_ns(), NSEC_PER_USEC);
  }

  void dla_reg_write(void *driver_context, uint32_t addr, uint32_t reg)
-- 
2.25.1

Gr{oetje,eeting}s,

 						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
 							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-09  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 22:59 [esmil:visionfive 55/61] nvdla_core_callbacks.c:undefined reference to `__udivdi3' kernel test robot
2022-03-09  8:06 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®