[xlnx:master 58/146] drivers/clk/clk-xlnx-clock-wizard.c:184: undefined reference to `__udivdi3'
From: kernel test robot <hidden>
Date: 2020-09-21 16:06:50
Also in:
oe-kbuild-all
tree: https://github.com/Xilinx/linux-xlnx master head: 3cb48250f25110e9aed4699c993e1b229e363402 commit: b271f193cc94e177383886cc00e3bc62a7c3ead7 [58/146] clk: clock-wizard: Use all stages of the MMCM config: i386-randconfig-s002-20200921 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-201-g24bdaac6-dirty git checkout b271f193cc94e177383886cc00e3bc62a7c3ead7 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <redacted> All errors (new ones prefixed by >>): ld: drivers/clk/clk-xlnx-clock-wizard.o: in function `clk_wzrd_calc_hints':
quoted
drivers/clk/clk-xlnx-clock-wizard.c:184: undefined reference to `__udivdi3' ld: drivers/clk/clk-xlnx-clock-wizard.c:186: undefined reference to `__udivdi3'
ld: drivers/clk/clk-xlnx-clock-wizard.c:207: undefined reference to `__udivdi3' ld: drivers/clk/clk-xlnx-clock-wizard.c:198: undefined reference to `__udivdi3' # https://github.com/Xilinx/linux-xlnx/commit/b271f193cc94e177383886cc00e3bc62a7c3ead7 git remote add xlnx https://github.com/Xilinx/linux-xlnx git fetch --no-tags xlnx master git checkout b271f193cc94e177383886cc00e3bc62a7c3ead7 vim +184 drivers/clk/clk-xlnx-clock-wizard.c 150 151 /* 152 * This is where all the magic happens. For arbitrary frequency generation 153 * applications all of the knobs for adjusting the frequency must be 154 * considered together. Nothing is set in this function we just provide 155 * hints for use by the actual set_rate functions. If things don't match 156 * up the hints can always be ignored 157 */ 158 static void clk_wzrd_calc_hints(struct clk_wzrd *clk_wzrd, unsigned long rate, 159 unsigned long in_rate) 160 { 161 int i, j; 162 163 unsigned int divclk_divide_max, divclk_divide_max_calc; 164 unsigned int clkbout_min, clkbout_max; 165 unsigned int clkout_divide = 1; 166 unsigned int best_divclk = 1; 167 unsigned int best_clkfbout_mult_f = 1; 168 unsigned int best_clkout_divide = 1; 169 unsigned int best_out_freq = 1; 170 u64 vco_freq, best_vco_freq = 1; 171 u64 out_freq = 1; 172 u64 error; 173 u64 min_error = 100000000000; 174 175 clk_wzrd->hints.valid_rate = false; 176 177 divclk_divide_max_calc = in_rate / MIN_IN_FREQ; 178 divclk_divide_max = min(DIVCLK_DIVIDE_MAX, 179 divclk_divide_max_calc); 180 181 /* First go through all possible DIVCLK_DIVIDE values */ 182 for (i = 1; i <= divclk_divide_max; i++) { 183 /* 8*125 is x1000 */ > 184 clkbout_min = DIV_ROUND_UP(MIN_VCO_FREQ * i * 8, in_rate) * 185 125; > 186 clkbout_max = (MAX_VCO_FREQ * i * 8 / in_rate) * 125; 187 clkbout_min = max(CLKFBOUT_MULT_F_MIN, clkbout_min); 188 clkbout_max = min(CLKFBOUT_MULT_F_MAX, clkbout_max); 189 /* Second go through all CLKFBOUT_MULT values */ 190 for (j = clkbout_min; j <= clkbout_max; j += 125) { 191 vco_freq = in_rate * j / i; 192 /* 193 * Finally calculate out the CLKOUT_DIVIDE 194 * there is no need to iterate here 195 * just calculate the closest 196 */ 197 clkout_divide = 198 DIV_ROUND_CLOSEST(vco_freq, 199 (u64)rate * 125) * 125; 200 clkout_divide = clamp(clkout_divide, 201 CLKOUT_DIVIDE_F_MIN, 202 CLKOUT_DIVIDE_F_MAX); 203 out_freq = in_rate * j / i / clkout_divide; 204 error = abs(rate - out_freq); 205 if (error < min_error) { 206 min_error = error; 207 best_vco_freq = vco_freq / 1000; 208 best_out_freq = out_freq; 209 best_divclk = i; 210 best_clkfbout_mult_f = j; 211 best_clkout_divide = clkout_divide; 212 } 213 } 214 } 215 216 clk_wzrd->hints.req_rate = rate; 217 clk_wzrd->hints.vco_rate = best_vco_freq; 218 clk_wzrd->hints.div_rate = in_rate / best_divclk; 219 clk_wzrd->hints.best_rate = best_out_freq; 220 clk_wzrd->hints.divclk_divide = best_divclk; 221 clk_wzrd->hints.clkfbout_mult_f = best_clkfbout_mult_f; 222 clk_wzrd->hints.clkout_divide = best_clkout_divide; 223 clk_wzrd->hints.valid_rate = true; 224 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Attachments
- .config.gz [application/gzip] 35501 bytes
- (unnamed) [text/plain] 176 bytes · preview