Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\calibrate.c Create Date:2022-07-28 13:55:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:calibrate_delay_converge

Proto:static unsigned long calibrate_delay_converge(void)

Type:unsigned long

Parameter:Nothing

191  trials = 0 , band = 0 , trial_in_band = 0
193  lpj = 1 << 12
196  ticks = jiffies
197  When ticks == jiffies cycle
200  ticks = jiffies
201  Do
202  If ++trial_in_band == 1 << band Then
203  ++band
204  trial_in_band = 0
206  __delay(lpj * band)
207  trials += band
208  When ticks == jiffies cycle
213  trials -= band
214  loopadd_base = lpj * band
215  lpj_base = lpj * trials
217  recalibrate :
218  lpj = lpj_base
219  loopadd = loopadd_base
225  chop_limit = lpj >> This is the number of bits of precision for the loops_per_jiffy. Each* time we refine our estimate after the first takes 1.5/HZ seconds, so try* to start with a good estimate.* For the boot cpu we can skip the delay calibration and assign it a value
226  When loopadd > chop_limit cycle
227  lpj += loopadd
228  ticks = jiffies
229  When ticks == jiffies cycle
231  ticks = jiffies
232  __delay(lpj)
233  If jiffies != ticks Then lpj -= loopadd
235  loopadd >>= 1
242  If lpj + loopadd * 2 == lpj_base + loopadd_base * 2 Then
243  lpj_base = lpj
244  loopadd_base <<= 2
245  Go to recalibrate
248  Return lpj
Caller
NameDescribe
calibrate_delay