* [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3'
@ 2022-01-28 0:44 kernel test robot
2022-01-29 16:15 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-01-28 0:44 UTC (permalink / raw)
To: Chenjieqin; +Cc: kbuild-all, linux-kernel, Emil Renner Berthing
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@intel.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
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3'
2022-01-28 0:44 [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3' kernel test robot
@ 2022-01-29 16:15 ` Geert Uytterhoeven
2022-01-29 16:35 ` Emil Renner Berthing
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-01-29 16:15 UTC (permalink / raw)
To: kernel test robot
Cc: Chenjieqin, kbuild-all, Linux Kernel Mailing List, Emil Renner Berthing
On Sat, Jan 29, 2022 at 2:15 AM kernel test robot <lkp@intel.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@intel.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@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] 3+ messages in thread
* Re: [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3'
2022-01-29 16:15 ` Geert Uytterhoeven
@ 2022-01-29 16:35 ` Emil Renner Berthing
0 siblings, 0 replies; 3+ messages in thread
From: Emil Renner Berthing @ 2022-01-29 16:35 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: kernel test robot, Chenjieqin, kbuild-all, Linux Kernel Mailing List
On Sat, 29 Jan 2022 at 17:15, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> On Sat, Jan 29, 2022 at 2:15 AM kernel test robot <lkp@intel.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@intel.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);
Thanks, I'd only found the raw do_div. This is better.
> +
> + 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@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] 3+ messages in thread
end of thread, other threads:[~2022-01-29 16:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 0:44 [esmil:visionfive 36/74] pwm-sifive-ptc.c:undefined reference to `__udivdi3' kernel test robot
2022-01-29 16:15 ` Geert Uytterhoeven
2022-01-29 16:35 ` Emil Renner Berthing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).