[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVkdn_X=tEas5DxWz_o9QE2sktnfii=qPJRu1+u+97Fvg@mail.gmail.com>
Date: Sat, 29 Jan 2022 17:15:35 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: kernel test robot <lkp@...el.com>
Cc: Chenjieqin <Jessica.Chen@...rfivetech.com>,
kbuild-all@...ts.01.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Emil Renner Berthing <kernel@...il.dk>
Subject: Re: [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3'
On Sat, Jan 29, 2022 at 2:15 AM kernel test robot <lkp@...el.com> wrote:
> tree: https://github.com/esmil/linux visionfive
> head: 31606e93b454de33cd75c74d622f35eee020dc5b
> commit: d8f87b24049876b29ade8ed4e49f975d32eeec79 [36/74] drivers/pwm: Add SiFive PWM PTC driver
> config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220128/202201280855.Boip1DFz-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/d8f87b24049876b29ade8ed4e49f975d32eeec79
> git remote add esmil https://github.com/esmil/linux
> git fetch --no-tags esmil visionfive
> git checkout d8f87b24049876b29ade8ed4e49f975d32eeec79
> # 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@...el.com>
>
> All errors (new ones prefixed by >>):
>
> m68k-linux-ld: drivers/pwm/pwm-sifive-ptc.o: in function `sifive_pwm_ptc_apply':
> >> pwm-sifive-ptc.c:(.text+0x1c2): 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
+ /* calculate period count */
+ period_data = state->period / pwm_clk_ns;
64-by-32 division (pwm_state.period is u64, pwm_clk_ns is uint32_t).
Please #include <linux/math64.h> and use div_u64():
period_data = div_u64(period, pwm_clk_ns);
+
+ if (!state->enabled)
+ /* if is unenable,just set duty_dat to 0 , means low
level always */
+ duty_data = 0;
+ else
+ /* calculate duty count*/
+ duty_data = state->duty_cycle / pwm_clk_ns;
Likewise.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
Powered by blists - more mailing lists