linux/kernel/time/clocksource.c
<<
on v.6./spa> .6./form .6.a on v.6 href="../linux+v3.7.2/kernel/time/clocksource.c">on v.6.img src="../.static/gfx/right.png" alt=">>">on./spa> on.spa> class="lxr_search">on v="+search" method="post" onsubmit="return do_search(this);">on v.6.input typn> hidden" namn> navtarget" ption> ">on v.6.input typn> text" namn> search" id> search">on v.6.butt submit">Search on.spa> class="lxr_prefs" .6.a href="+prefs?return=kernel/time/clocksource.c"on v.6 onclick="return ajax_prefs();">on v.6Prefs .6./a>on./spa> v.6 6./div v.6 6.form ac >="ajax+*" method="post" onsubmit="return false;">on.input typn> hidden" namn> ajax_lookup" id> ajax_lookup" ption> ">o v.6 6./form o v.6 6.div class="headingbott
search_results" class="search_results" . v.6 6./div .div id> content"> .div id> file_contents"
97/43/628f4d4adb5a191b29565cab68fc6d306c98_3/0"

L1" class="line" namn>
L1">6 61./a>.spa> class="comment">/*./spa>
 
L2" class="line" namn>
L2">6 62./a>.spa> class="comment"> * linux/kernel/time/clocksource.c./spa>
 
L3" class="line" namn>
L3">6 63./a>.spa> class="comment"> *./spa>
 
L4" class="line" namn>
L4">6 64./a>.spa> class="comment"> * This file contains the func	  >s which manage clocksource drivers../spa>
 
L5" class="line" namn>
L5">6 65./a>.spa> class="comment"> *./spa>
 
L6" class="line" namn>
L6">6 66./a>.spa> class="comment"> * Copyright (C) 2004, 2005 IBM, John Stultz (johnstul@us.ibm.com)./spa>
 
L7" class="line" namn>
L7">6 67./a>.spa> class="comment"> *./spa>
 
L8" class="line" namn>
L8">6 68./a>.spa> class="comment"> * This program is free software; you ca> redistribute it and/or modify./spa>
 
L9" class="line" namn>
L9">6 69./a>.spa> class="comment"> * it under the terms of the GNU General Public License as published by./spa>
 
L10" class="line" namn>
L10">6 1"
	a>.spa> class="comment"> * the Free Software Founda	  >; either vers3
 
L11" class="line" namn>
L11">6 11./a>.spa> class="comment"> * (at your "
	  >) any later vers3
 
L12" class="line" namn>
L12">6 12./a>.spa> class="comment"> *./spa>
 
L13" class="line" namn>
L13">6 13./a>.spa> class="comment"> * This program is distributed in the hope that it will be useful,./spa>
 
L14" class="line" namn>
L14">6 14./a>.spa> class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of./spa>
 
L15" class="line" namn>
L15">6 15./a>.spa> class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the./spa>
 
L16" class="line" namn>
L16">6 16./a>.spa> class="comment"> * GNU General Public License for more details../spa>
 
L17" class="line" namn>
L17">6 17./a>.spa> class="comment"> *./spa>
 
L18" class="line" namn>
L18">6 18./a>.spa> class="comment"> * You should have received a copy of the GNU General Public License./spa>
 
L19" class="line" namn>
L19">6 19./a>.spa> class="comment"> * along with this program; if not, write to the Free Software./spa>
 
L20" class="line" namn>
L20">6 2"
	a>.spa> class="comment"> * Founda	  >, Inc., 675 Mass Ave, Cambridge, MA 02139, USA../spa>
 
L21" class="line" namn>
L21">6 21./a>.spa> class="comment"> *./spa>
 
L22" class="line" namn>
L22">6 22./a>.spa> class="comment"> * TODO WishList:./spa>
 
L23" class="line" namn>
L23">6 23./a>.spa> class="comment"> * 6 o Allow clocksource drivers to be unregistered./spa>
 
L24" class="line" namn>
L24">6 24./a>.spa> class="comment"> */./spa>
 
L25" class="line" namn>
L25">6 25./a> 
L26" class="line" namn>
L26">6 26./a>#include <linux/device.h./a>> 
L27" class="line" namn>
L27">6 27./a>#include <linux/clocksource.h./a>> 
L28" class="line" namn>
L28">6 28./a>#include <linux/init.h./a>> 
L29" class="line" namn>
L29">6 29./a>#include <linux/module.h./a>> 
L30" class="line" namn>
L30">6 30./a>#include <linux/sched.h./a>> .spa> class="comment">/* for spin_unlock_irq() using preempt_count() m68k */./spa>
 
L31" class="line" namn>
L31">6 31./a>#include <linux/tick.h./a>> 
L32" class="line" namn>
L32">6 32./a>#include <linux/kthread.h./a>> 
L33" class="line" namn>
L33">6 33./a> 
L34" class="line" namn>
L34">6 34./a>void6.a href="+code=timecounter_init" class="sref">timecounter_init./a>(struct6.a href="+code=timecounter" class="sref">timecounter./a> *.a href="+code=tc" class="sref">tc./a>, 
L35" class="line" namn>
L35">6 35./a>                      const struct6.a href="+code=cyclecounter" class="sref">cyclecounter./a> *.a href="+code=cc" class="sref">cc./a>, 
L36" class="line" namn>
L36">6 36./a>                      .a href="+code=u64" class="sref">u64./a> .a href="+code=start_tstamp" class="sref">start_tstamp./a>) 
L37" class="line" namn>
L37">6 37./a>{ 
L38" class="line" namn>
L38">6 38./a>        .a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a> =6.a href="+code=cc" class="sref">cc./a>; 
L39" class="line" namn>
L39">6 39./a>        .a href="+code=tc" class="sref">tc./a>->.a href="+code=cycle_last" class="sref">cycle_last./a> =6.a href="+code=cc" class="sref">cc./a>->.a href="+code=read" class="sref">read./a>(.a href="+code=cc" class="sref">cc./a>); 
L40" class="line" namn>
L40">6 40./a>        .a href="+code=tc" class="sref">tc./a>->.a href="+code=nsec" class="sref">nsec./a> =6.a href="+code=start_tstamp" class="sref">start_tstamp./a>; 
L41" class="line" namn>
L41">6 41./a>} 
L42" class="line" namn>
L42">6 42./a>.a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL./a>(.a href="+code=timecounter_init" class="sref">timecounter_init./a>); 
L43" class="line" namn>
L43">6 43./a> 
L44" class="line" namn>
L44">6 44./a>.spa> class="comment">/**./spa>
 
L45" class="line" namn>
L45">6 45./a>.spa> class="comment"> * timecounter_read_delta - get nanoseconds since last call of this func	  >./spa>
 
L46" class="line" namn>
L46">6 46./a>.spa> class="comment"> * @tc:         Pointer to time counter./spa>
 
L47" class="line" namn>
L47">6 47./a>.spa> class="comment"> *./spa>
 
L48" class="line" namn>
L48">6 48./a>.spa> class="comment"> * When the underlying cycle counter runs over, this will be handled./spa>
 
L49" class="line" namn>
L49">6 49./a>.spa> class="comment"> * correctly as long as it does not run over more than once betwee>./spa>
 
L50" class="line" namn>
L50">6 5"
	a>.spa> class="comment"> * calls../spa>
 
L51" class="line" namn>
L51">6 51./a>.spa> class="comment"> *./spa>
 
L52" class="line" namn>
L52">6 52./a>.spa> class="comment"> * The first call to this func	  > for a new time counter initializes./spa>
 
L53" class="line" namn>
L53">6 53./a>.spa> class="comment"> * the time tracking and returns an undefined result../spa>
 
L54" class="line" namn>
L54">6 54./a>.spa> class="comment"> */./spa>
 
L55" class="line" namn>
L55">6 55./a>static .a href="+code=u64" class="sref">u64./a> .a href="+code=timecounter_read_delta" class="sref">timecounter_read_delta./a>(struct6.a href="+code=timecounter" class="sref">timecounter./a> *.a href="+code=tc" class="sref">tc./a>) 
L56" class="line" namn>
L56">6 56./a>{ 
L57" class="line" namn>
L57">6 57./a>        .a href="+code=cycle_t" class="sref">cycle_t./a> .a href="+code=cycle_now" class="sref">cycle_now./a>, .a href="+code=cycle_delta" class="sref">cycle_delta./a>; 
L58" class="line" namn>
L58">6 58./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=ns_offset" class="sref">ns_offset./a>; 
L59" class="line" namn>
L59">6 59./a> 
L60" class="line" namn>
L60">6 60./a>        .spa> class="comment">/* read cycle counter: */./spa>
 
L61" class="line" namn>
L61">6 61./a>        .a href="+code=cycle_now" class="sref">cycle_now./a> =6.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>->.a href="+code=read" class="sref">read./a>(.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>); 
L62" class="line" namn>
L62">6 62./a> 
L63" class="line" namn>
L63">6 63./a>        .spa> class="comment">/* calculate the delta since the last timecounter_read_delta(): */./spa>
 
L64" class="line" namn>
L64">6 64./a>        .a href="+code=cycle_delta" class="sref">cycle_delta./a> =6(.a href="+code=cycle_now" class="sref">cycle_now./a> - .a href="+code=tc" class="sref">tc./a>->.a href="+code=cycle_last" class="sref">cycle_last./a>) &6.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>->.a href="+code=mask" class="sref">mask./a>; 
L65" class="line" namn>
L65">6 65./a> 
L66" class="line" namn>
L66">6 66./a>        .spa> class="comment">/* convert to nanoseconds: */./spa>
 
L67" class="line" namn>
L67">6 67./a>        .a href="+code=ns_offset" class="sref">ns_offset./a> =6.a href="+code=cyclecounter_cyc2ns" class="sref">cyclecounter_cyc2ns./a>(.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>, .a href="+code=cycle_delta" class="sref">cycle_delta./a>); 
L68" class="line" namn>
L68">6 68./a> 
L69" class="line" namn>
L69">6 69./a>        .spa> class="comment">/* update time stamp of timecounter_read_delta() call: */./spa>
 
L70" class="line" namn>
L70">6 70./a>        .a href="+code=tc" class="sref">tc./a>->.a href="+code=cycle_last" class="sref">cycle_last./a> =6.a href="+code=cycle_now" class="sref">cycle_now./a>; 
L71" class="line" namn>
L71">6 71./a> 
L72" class="line" namn>
L72">6 72./a>        return .a href="+code=ns_offset" class="sref">ns_offset./a>; 
L73" class="line" namn>
L73">6 73./a>} 
L74" class="line" namn>
L74">6 74./a> 
L75" class="line" namn>
L75">6 75./a>.a href="+code=u64" class="sref">u64./a> .a href="+code=timecounter_read" class="sref">timecounter_read./a>(struct6.a href="+code=timecounter" class="sref">timecounter./a> *.a href="+code=tc" class="sref">tc./a>) 
L76" class="line" namn>
L76">6 76./a>{ 
L77" class="line" namn>
L77">6 77./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=nsec" class="sref">nsec./a>; 
L78" class="line" namn>
L78">6 78./a> 
L79" class="line" namn>
L79">6 79./a>        .spa> class="comment">/* increment time by nanoseconds since last call */./spa>
 
L80" class="line" namn>
L80">6 80./a>        .a href="+code=nsec" class="sref">nsec./a> =6.a href="+code=timecounter_read_delta" class="sref">timecounter_read_delta./a>(.a href="+code=tc" class="sref">tc./a>); 
L81" class="line" namn>
L81">6 81./a>        .a href="+code=nsec" class="sref">nsec./a> +=6.a href="+code=tc" class="sref">tc./a>->.a href="+code=nsec" class="sref">nsec./a>; 
L82" class="line" namn>
L82">6 82./a>        .a href="+code=tc" class="sref">tc./a>->.a href="+code=nsec" class="sref">nsec./a> =6.a href="+code=nsec" class="sref">nsec./a>; 
L83" class="line" namn>
L83">6 83./a> 
L84" class="line" namn>
L84">6 84./a>        return .a href="+code=nsec" class="sref">nsec./a>; 
L85" class="line" namn>
L85">6 85./a>} 
L86" class="line" namn>
L86">6 86./a>.a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL./a>(.a href="+code=timecounter_read" class="sref">timecounter_read./a>); 
L87" class="line" namn>
L87">6 87./a> 
L88" class="line" namn>
L88">6 88./a>.a href="+code=u64" class="sref">u64./a> .a href="+code=timecounter_cyc2time" class="sref">timecounter_cyc2time./a>(struct6.a href="+code=timecounter" class="sref">timecounter./a> *.a href="+code=tc" class="sref">tc./a>, 
L89" class="line" namn>
L89">6 89./a>                         .a href="+code=cycle_t" class="sref">cycle_t./a> .a href="+code=cycle_tstamp" class="sref">cycle_tstamp./a>) 
L90" class="line" namn>
L90">6 90./a>{ 
L91" class="line" namn>
L91">6 91./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=cycle_delta" class="sref">cycle_delta./a> =6(.a href="+code=cycle_tstamp" class="sref">cycle_tstamp./a> - .a href="+code=tc" class="sref">tc./a>->.a href="+code=cycle_last" class="sref">cycle_last./a>) &6.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>->.a href="+code=mask" class="sref">mask./a>; 
L92" class="line" namn>
L92">6 92./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=nsec" class="sref">nsec./a>; 
L93" class="line" namn>
L93">6 93./a> 
L94" class="line" namn>
L94">6 94./a>        .spa> class="comment">/*./spa>
 
L95" class="line" namn>
L95">6 95./a>.spa> class="comment">         * Instead of always treating cycle_tstamp as more recent./spa>
 
L96" class="line" namn>
L96">6 96./a>.spa> class="comment">         * than tc->cycle_last, detect6when it is too far in the./spa>
 
L97" class="line" namn>
L97">6 97./a>.spa> class="comment">         * future and treat it as old time stamp instead../spa>
 
L98" class="line" namn>
L98">6 98./a>.spa> class="comment">         */./spa>
 
L99" class="line" namn>
L99">6 99./a>        if6(.a href="+code=cycle_delta" class="sref">cycle_delta./a> > .a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>->.a href="+code=mask" class="sref">mask./a> / 2) { 
L100" class="line" namn>
L100">6100./a>                .a href="+code=cycle_delta" class="sref">cycle_delta./a> =6(.a href="+code=tc" class="sref">tc./a>->.a href="+code=cycle_last" class="sref">cycle_last./a> - .a href="+code=cycle_tstamp" class="sref">cycle_tstamp./a>) &6.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>->.a href="+code=mask" class="sref">mask./a>; 
L101" class="line" namn>
L101">6101./a>                .a href="+code=nsec" class="sref">nsec./a> =6.a href="+code=tc" class="sref">tc./a>->.a href="+code=nsec" class="sref">nsec./a> - .a href="+code=cyclecounter_cyc2ns" class="sref">cyclecounter_cyc2ns./a>(.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>, .a href="+code=cycle_delta" class="sref">cycle_delta./a>); 
L102" class="line" namn>
L102">6102./a>        } else { 
L103" class="line" namn>
L103">6103./a>                .a href="+code=nsec" class="sref">nsec./a> =6.a href="+code=cyclecounter_cyc2ns" class="sref">cyclecounter_cyc2ns./a>(.a href="+code=tc" class="sref">tc./a>->.a href="+code=cc" class="sref">cc./a>, .a href="+code=cycle_delta" class="sref">cycle_delta./a>) +6.a href="+code=tc" class="sref">tc./a>->.a href="+code=nsec" class="sref">nsec./a>; 
L104" class="line" namn>
L104">6104./a>        } 
L105" class="line" namn>
L105">6105./a> 
L106" class="line" namn>
L106">6106./a>        return .a href="+code=nsec" class="sref">nsec./a>; 
L107" class="line" namn>
L107">6107./a>} 
L108" class="line" namn>
L108">6108./a>.a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL./a>(.a href="+code=timecounter_cyc2time" class="sref">timecounter_cyc2time./a>); 
L109" class="line" namn>
L109">6109./a> 
L110" class="line" namn>
L110">611"
	a>.spa> class="comment">/**./spa>
 
L111" class="line" namn>
L111">6111./a>.spa> class="comment"> * clocks_calc_mult_shift - calculate mult/shift factors for scaled math of clocks./spa>
 
L112" class="line" namn>
L112">6112./a>.spa> class="comment"> * @mult:       pointer to mult variable./spa>
 
L113" class="line" namn>
L113">6113./a>.spa> class="comment"> * @shift:      pointer to shift variable./spa>
 
L114" class="line" namn>
L114">6114./a>.spa> class="comment"> * @from:       frequency to convert from./spa>
 
L115" class="line" namn>
L115">6115./a>.spa> class="comment"> * @to:         frequency to convert to./spa>
 
L116" class="line" namn>
L116">6116./a>.spa> class="comment"> * @maxsec:     guaranteed runtime convers3
 
L117" class="line" namn>
L117">6117./a>.spa> class="comment"> *./spa>
 
L118" class="line" namn>
L118">6118./a>.spa> class="comment"> * The func	  > eptioates the shift/mult pair for the scaled math./spa>
 
L119" class="line" namn>
L119">6119./a>.spa> class="comment"> * opera	  >s of clocksources and clockevents../spa>
 
L120" class="line" namn>
L120">612"
	a>.spa> class="comment"> *./spa>
 
L121" class="line" namn>
L121">6121./a>.spa> class="comment"> * @to and @from are frequency ptions in HZ. For clock sources @to is./spa>
 
L122" class="line" namn>
L122">6122./a>.spa> class="comment"> * NSEC_PER_SEC == 1GHz and @from is the counter frequency. For clock./spa>
 
L123" class="line" namn>
L123">6123./a>.spa> class="comment"> * event @to is the counter frequency and @from is NSEC_PER_SEC../spa>
 
L124" class="line" namn>
L124">6124./a>.spa> class="comment"> *./spa>
 
L125" class="line" namn>
L125">6125./a>.spa> class="comment"> * The @maxsec convers3
 
L126" class="line" namn>
L126">6126./a>.spa> class="comment"> * seconds which must be covered by the runtime convers3
 
L127" class="line" namn>
L127">6127./a>.spa> class="comment"> * calculated mult and shift factors. This guarantees that no 64bit./spa>
 
L128" class="line" namn>
L128">6128./a>.spa> class="comment"> * overflow happe>s when the input ption of the convers3
 
L129" class="line" namn>
L129">6129./a>.spa> class="comment"> * multiplied with the calculated mult factor. Largeroranges may./spa>
 
L130" class="line" namn>
L130">613"
	a>.spa> class="comment"> * reduce the convers3
 
L131" class="line" namn>
L131">6131./a>.spa> class="comment"> * factors../spa>
 
L132" class="line" namn>
L132">6132./a>.spa> class="comment"> */./spa>
 
L133" class="line" namn>
L133">6133./a>void 
L134" class="line" namn>
L134">6134./a>.a href="+code=clocks_calc_mult_shift" class="sref">clocks_calc_mult_shift./a>(.a href="+code=u32" class="sref">u32./a> *.a href="+code=mult" class="sref">mult./a>, .a href="+code=u32" class="sref">u32./a> *.a href="+code=shift" class="sref">shift./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=from" class="sref">from./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=to" class="sref">to./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=maxsec" class="sref">maxsec./a>) 
L135" class="line" namn>
L135">6135./a>{ 
L136" class="line" namn>
L136">6136./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=tmp" class="sref">tmp./a>; 
L137" class="line" namn>
L137">6137./a>        .a href="+code=u32" class="sref">u32./a> .a href="+code=sft" class="sref">sft./a>, .a href="+code=sftacc" class="sref">sftacc./a>= 32; 
L138" class="line" namn>
L138">6138./a> 
L139" class="line" namn>
L139">6139./a>        .spa> class="comment">/*./spa>
 
L140" class="line" namn>
L140">614"
	a>.spa> class="comment">         * Calculate the shift factor which is limiting the convers3
 
L141" class="line" namn>
L141">6141./a>.spa> class="comment">         * range:./spa>
 
L142" class="line" namn>
L142">6142./a>.spa> class="comment">         */./spa>
 
L143" class="line" namn>
L143">6143./a>        .a href="+code=tmp" class="sref">tmp./a> =6((.a href="+code=u64" class="sref">u64./a>).a href="+code=maxsec" class="sref">maxsec./a> * .a href="+code=from" class="sref">from./a>) >> 32; 
L144" class="line" namn>
L144">6144./a>        while6(.a href="+code=tmp" class="sref">tmp./a>) { 
L145" class="line" namn>
L145">6145./a>                .a href="+code=tmp" class="sref">tmp./a> >>=1; 
L146" class="line" namn>
L146">6146./a>                .a href="+code=sftacc" class="sref">sftacc./a>--; 
L147" class="line" namn>
L147">6147./a>        } 
L148" class="line" namn>
L148">6148./a> 
L149" class="line" namn>
L149">6149./a>        .spa> class="comment">/*./spa>
 
L150" class="line" namn>
L150">615"
	a>.spa> class="comment">         * Find the convers3
 
L151" class="line" namn>
L151">6151./a>.spa> class="comment">         * accuracy and fits the maxsec convers3
 
L152" class="line" namn>
L152">6152./a>.spa> class="comment">         */./spa>
 
L153" class="line" namn>
L153">6153./a>        for (.a href="+code=sft" class="sref">sft./a> = 32; .a href="+code=sft" class="sref">sft./a> > 0; .a href="+code=sft" class="sref">sft./a>--) { 
L154" class="line" namn>
L154">6154./a>                .a href="+code=tmp" class="sref">tmp./a> =6(.a href="+code=u64" class="sref">u64./a>) .a href="+code=to" class="sref">to./a> << .a href="+code=sft" class="sref">sft./a>; 
L155" class="line" namn>
L155">6155./a>                .a href="+code=tmp" class="sref">tmp./a> +=6.a href="+code=from" class="sref">from./a> / 2; 
L156" class="line" namn>
L156">6156./a>                .a href="+code=do_div" class="sref">do_div./a>(.a href="+code=tmp" class="sref">tmp./a>, .a href="+code=from" class="sref">from./a>); 
L157" class="line" namn>
L157">6157./a>                if6((.a href="+code=tmp" class="sref">tmp./a> >> .a href="+code=sftacc" class="sref">sftacc./a>) == 0) 
L158" class="line" namn>
L158">6158./a>                        break; 
L159" class="line" namn>
L159">6159./a>        } 
L160" class="line" namn>
L160">6160./a>        *.a href="+code=mult" class="sref">mult./a> =6.a href="+code=tmp" class="sref">tmp./a>; 
L161" class="line" namn>
L161">6161./a>        *.a href="+code=shift" class="sref">shift./a> =6.a href="+code=sft" class="sref">sft./a>; 
L162" class="line" namn>
L162">6162./a>} 
L163" class="line" namn>
L163">6163./a> 
L164" class="line" namn>
L164">6164./a>.spa> class="comment">/*[Clocksource internal variables]---------./spa>
 
L165" class="line" namn>
L165">6165./a>.spa> class="comment"> * curr_clocksource:./spa>
 
L166" class="line" namn>
L166">6166./a>.spa> class="comment"> *      currently selected clocksource../spa>
 
L167" class="line" namn>
L167">6167./a>.spa> class="comment"> * clocksource_list:./spa>
 
L168" class="line" namn>
L168">6168./a>.spa> class="comment"> *      linked list with the registered clocksources./spa>
 
L169" class="line" namn>
L169">6169./a>.spa> class="comment"> * clocksource_mutex:./spa>
 
L170" class="line" namn>
L170">617"
	a>.spa> class="comment"> *      protects manipulat  >s to curr_clocksource and the clocksource_list./spa>
 
L171" class="line" namn>
L171">6171./a>.spa> class="comment"> * override_namn:./spa>
 
L172" class="line" namn>
L172">6172./a>.spa> class="comment"> *      Namn of the user-specified clocksource../spa>
 
L173" class="line" namn>
L173">6173./a>.spa> class="comment"> */./spa>
 
L174" class="line" namn>
L174">6174./a>static struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=curr_clocksource" class="sref">curr_clocksource./a>; 
L175" class="line" namn>
L175">6175./a>static .a href="+code=LIST_HEAD" class="sref">LIST_HEAD./a>(.a href="+code=clocksource_list" class="sref">clocksource_list./a>); 
L176" class="line" namn>
L176">6176./a>static .a href="+code=DEFINE_MUTEX" class="sref">DEFINE_MUTEX./a>(.a href="+code=clocksource_mutex" class="sref">clocksource_mutex./a>); 
L177" class="line" namn>
L177">6177./a>static char .a href="+code=override_namn" class="sref">override_namn./a>[32]; 
L178" class="line" namn>
L178">6178./a>static int .a href="+code=finished_booting" class="sref">finished_booting./a>; 
L179" class="line" namn>
L179">6179./a> 
L180" class="line" namn>
L180">6180./a>#ifdef .a href="+code=CONFIG_CLOCKSOURCE_WATCHDOG" class="sref">CONFIG_CLOCKSOURCE_WATCHDOG./a> 
L181" class="line" namn>
L181">6181./a>static void6.a href="+code=clocksource_watchdog_work" class="sref">clocksource_watchdog_work./a>(struct6.a href="+code=work_struct" class="sref">work_struct./a> *.a href="+code=work" class="sref">work./a>); 
L182" class="line" namn>
L182">6182./a> 
L183" class="line" namn>
L183">6183./a>static .a href="+code=LIST_HEAD" class="sref">LIST_HEAD./a>(.a href="+code=watchdog_list" class="sref">watchdog_list./a>); 
L184" class="line" namn>
L184">6184./a>static struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=watchdog" class="sref">watchdog./a>; 
L185" class="line" namn>
L185">6185./a>static struct6.a href="+code=timer_list" class="sref">timer_list./a> .a href="+code=watchdog_timer" class="sref">watchdog_timer./a>; 
L186" class="line" namn>
L186">6186./a>static .a href="+code=DECLARE_WORK" class="sref">DECLARE_WORK./a>(.a href="+code=watchdog_work" class="sref">watchdog_work./a>, .a href="+code=clocksource_watchdog_work" class="sref">clocksource_watchdog_work./a>); 
L187" class="line" namn>
L187">6187./a>static .a href="+code=DEFINE_SPINLOCK" class="sref">DEFINE_SPINLOCK./a>(.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>); 
L188" class="line" namn>
L188">6188./a>static int .a href="+code=watchdog_running" class="sref">watchdog_running./a>; 
L189" class="line" namn>
L189">6189./a>static .a href="+code=atomic_t" class="sref">atomic_t./a> .a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>; 
L190" class="line" namn>
L190">6190./a> 
L191" class="line" namn>
L191">6191./a>static int .a href="+code=clocksource_watchdog_kthread" class="sref">clocksource_watchdog_kthread./a>(void6*.a href="+code=data" class="sref">data./a>); 
L192" class="line" namn>
L192">6192./a>static void6.a href="+code=__clocksource_change_rating" class="sref">__clocksource_change_rating./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>, int .a href="+code=rating" class="sref">rating./a>); 
L193" class="line" namn>
L193">6193./a> 
L194" class="line" namn>
L194">6194./a>.spa> class="comment">/*./spa>
 
L195" class="line" namn>
L195">6195./a>.spa> class="comment"> * Interval: 0.5sec Threshold: 0.0625s./spa>
 
L196" class="line" namn>
L196">6196./a>.spa> class="comment"> */./spa>
 
L197" class="line" namn>
L197">6197./a>#define .a href="+code=WATCHDOG_INTERVAL" class="sref">WATCHDOG_INTERVAL./a> (.a href="+code=HZ" class="sref">HZ./a> >> 1) 
L198" class="line" namn>
L198">6198./a>#define .a href="+code=WATCHDOG_THRESHOLD" class="sref">WATCHDOG_THRESHOLD./a> (.a href="+code=NSEC_PER_SEC" class="sref">NSEC_PER_SEC./a> >> 4) 
L199" class="line" namn>
L199">6199./a> 
L200" class="line" namn>
L200">6200./a>static void6.a href="+code=clocksource_watchdog_work" class="sref">clocksource_watchdog_work./a>(struct6.a href="+code=work_struct" class="sref">work_struct./a> *.a href="+code=work" class="sref">work./a>) 
L201" class="line" namn>
L201">6201./a>{ 
L202" class="line" namn>
L202">6202./a>        .spa> class="comment">/*./spa>
 
L203" class="line" namn>
L203">6203./a>.spa> class="comment">         * If kthread_run fails the next watchdog scan over the./spa>
 
L204" class="line" namn>
L204">6204./a>.spa> class="comment">         * watchdog_list will find the unstable clock again../spa>
 
L205" class="line" namn>
L205">6205./a>.spa> class="comment">         */./spa>
 
L206" class="line" namn>
L206">6206./a>        .a href="+code=kthread_run" class="sref">kthread_run./a>(.a href="+code=clocksource_watchdog_kthread" class="sref">clocksource_watchdog_kthread./a>, .a href="+code=NULL" class="sref">NULL./a>, .spa> class="string">"kwatchdog"./spa>
); 
L207" class="line" namn>
L207">6207./a>} 
L208" class="line" namn>
L208">6208./a> 
L209" class="line" namn>
L209">6209./a>static void6.a href="+code=__clocksource_unstable" class="sref">__clocksource_unstable./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L210" class="line" namn>
L210">6210./a>{ 
L211" class="line" namn>
L211">6211./a>        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &= ~(.a href="+code=CLOCK_SOURCE_VALID_FOR_HRES" class="sref">CLOCK_SOURCE_VALID_FOR_HRES./a> | .a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>); 
L212" class="line" namn>
L212">6212./a>        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> |=6.a href="+code=CLOCK_SOURCE_UNSTABLE" class="sref">CLOCK_SOURCE_UNSTABLE./a>; 
L213" class="line" namn>
L213">6213./a>        if6(.a href="+code=finished_booting" class="sref">finished_booting./a>) 
L214" class="line" namn>
L214">6214./a>                .a href="+code=schedule_work" class="sref">schedule_work./a>(&.a href="+code=watchdog_work" class="sref">watchdog_work./a>); 
L215" class="line" namn>
L215">6215./a>} 
L216" class="line" namn>
L216">6216./a> 
L217" class="line" namn>
L217">6217./a>static void6.a href="+code=clocksource_unstable" class="sref">clocksource_unstable./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>, .a href="+code=int64_t" class="sref">int64_t./a> .a href="+code=delta" class="sref">delta./a>) 
L218" class="line" namn>
L218">6218./a>{ 
L219" class="line" namn>
L219">6219./a>        .a href="+code=printk" class="sref">printk./a>(.a href="+code=KERN_WARNING" class="sref">KERN_WARNING./a> .spa> class="string">"Clocksource %s unstable (delta = %Ld ns)\n"./spa>
, 
L220" class="line" namn>
L220">6220./a>               .a href="+code=cs" class="sref">cs./a>->.a href="+code=namn" class="sref">namn./a>, .a href="+code=delta" class="sref">delta./a>); 
L221" class="line" namn>
L221">6221./a>        .a href="+code=__clocksource_unstable" class="sref">__clocksource_unstable./a>(.a href="+code=cs" class="sref">cs./a>); 
L222" class="line" namn>
L222">6222./a>} 
L223" class="line" namn>
L223">6223./a> 
L224" class="line" namn>
L224">6224./a>.spa> class="comment">/**./spa>
 
L225" class="line" namn>
L225">6225./a>.spa> class="comment"> * clocksource_mark_unstable - mark clocksource unstable via watchdog./spa>
 
L226" class="line" namn>
L226">6226./a>.spa> class="comment"> * @cs:         clocksource to be marked unstable./spa>
 
L227" class="line" namn>
L227">6227./a>.spa> class="comment"> *./spa>
 
L228" class="line" namn>
L228">6228./a>.spa> class="comment"> * This func	  > is called instead of clocksource_change_rating from./spa>
 
L229" class="line" namn>
L229">6229./a>.spa> class="comment"> * cpu hotplug code to avoid6a deadlock betwee> the clocksource mutex./spa>
 
L230" class="line" namn>
L230">623"
	a>.spa> class="comment"> * and the cpu hotplug mutex. It defers the update of the clocksource./spa>
 
L231" class="line" namn>
L231">6231./a>.spa> class="comment"> * to the watchdog thread../spa>
 
L232" class="line" namn>
L232">6232./a>.spa> class="comment"> */./spa>
 
L233" class="line" namn>
L233">6233./a>void6.a href="+code=clocksource_mark_unstable" class="sref">clocksource_mark_unstable./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L234" class="line" namn>
L234">6234./a>{ 
L235" class="line" namn>
L235">6235./a>        unsigned long .a href="+code=flags" class="sref">flags./a>; 
L236" class="line" namn>
L236">6236./a> 
L237" class="line" namn>
L237">6237./a>        .a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L238" class="line" namn>
L238">6238./a>        if6(!(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_UNSTABLE" class="sref">CLOCK_SOURCE_UNSTABLE./a>)) { 
L239" class="line" namn>
L239">6239./a>                if6(.a href="+code=list_empty" class="sref">list_empty./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>)) 
L240" class="line" namn>
L240">6240./a>                        .a href="+code=list_add" class="sref">list_add./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>, &.a href="+code=watchdog_list" class="sref">watchdog_list./a>); 
L241" class="line" namn>
L241">6241./a>                .a href="+code=__clocksource_unstable" class="sref">__clocksource_unstable./a>(.a href="+code=cs" class="sref">cs./a>); 
L242" class="line" namn>
L242">6242./a>        } 
L243" class="line" namn>
L243">6243./a>        .a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L244" class="line" namn>
L244">6244./a>} 
L245" class="line" namn>
L245">6245./a> 
L246" class="line" namn>
L246">6246./a>static void6.a href="+code=clocksource_watchdog" class="sref">clocksource_watchdog./a>(unsigned long .a href="+code=data" class="sref">data./a>) 
L247" class="line" namn>
L247">6247./a>{ 
L248" class="line" namn>
L248">6248./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>; 
L249" class="line" namn>
L249">6249./a>        .a href="+code=cycle_t" class="sref">cycle_t./a> .a href="+code=csnow" class="sref">csnow./a>, .a href="+code=wdnow" class="sref">wdnow./a>; 
L250" class="line" namn>
L250">6250./a>        .a href="+code=int64_t" class="sref">int64_t./a> .a href="+code=wd_nsec" class="sref">wd_nsec./a>, .a href="+code=cs_nsec" class="sref">cs_nsec./a>; 
L251" class="line" namn>
L251">6251./a>        int .a href="+code=next_cpu" class="sref">next_cpu./a>, .a href="+code=reset_pending" class="sref">reset_pending./a>; 
L252" class="line" namn>
L252">6252./a> 
L253" class="line" namn>
L253">6253./a>        .a href="+code=spin_lock" class="sref">spin_lock./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>); 
L254" class="line" namn>
L254">6254./a>        if6(!.a href="+code=watchdog_running" class="sref">watchdog_running./a>) 
L255" class="line" namn>
L255">6255./a>                goto .a href="+code=out" class="sref">out./a>; 
L256" class="line" namn>
L256">6256./a> 
L257" class="line" namn>
L257">6257./a>        .a href="+code=reset_pending" class="sref">reset_pending./a> =6.a href="+code=atomic_read" class="sref">atomic_read./a>(&.a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>); 
L258" class="line" namn>
L258">6258./a> 
L259" class="line" namn>
L259">6259./a>        .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=watchdog_list" class="sref">watchdog_list./a>, .a href="+code=wd_list" class="sref">wd_list./a>) { 
L260" class="line" namn>
L260">6260./a> 
L261" class="line" namn>
L261">6261./a>                .spa> class="comment">/* Clocksource already marked unstable? */./spa>
 
L262" class="line" namn>
L262">6262./a>                if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_UNSTABLE" class="sref">CLOCK_SOURCE_UNSTABLE./a>) { 
L263" class="line" namn>
L263">6263./a>                        if6(.a href="+code=finished_booting" class="sref">finished_booting./a>) 
L264" class="line" namn>
L264">6264./a>                                .a href="+code=schedule_work" class="sref">schedule_work./a>(&.a href="+code=watchdog_work" class="sref">watchdog_work./a>); 
L265" class="line" namn>
L265">6265./a>                        continue; 
L266" class="line" namn>
L266">6266./a>                } 
L267" class="line" namn>
L267">6267./a> 
L268" class="line" namn>
L268">6268./a>                .a href="+code=local_irq_disable" class="sref">local_irq_disable./a>(); 
L269" class="line" namn>
L269">6269./a>                .a href="+code=csnow" class="sref">csnow./a> =6.a href="+code=cs" class="sref">cs./a>->.a href="+code=read" class="sref">read./a>(.a href="+code=cs" class="sref">cs./a>); 
L270" class="line" namn>
L270">6270./a>                .a href="+code=wdnow" class="sref">wdnow./a> =6.a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=read" class="sref">read./a>(.a href="+code=watchdog" class="sref">watchdog./a>); 
L271" class="line" namn>
L271">6271./a>                .a href="+code=local_irq_enable" class="sref">local_irq_enable./a>(); 
L272" class="line" namn>
L272">6272./a> 
L273" class="line" namn>
L273">6273./a>                .spa> class="comment">/* Clocksource initialized ? */./spa>
 
L274" class="line" namn>
L274">6274./a>                if6(!(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>) || 
L275" class="line" namn>
L275">6275./a>                    .a href="+code=atomic_read" class="sref">atomic_read./a>(&.a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>)) { 
L276" class="line" namn>
L276">6276./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> |=6.a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>; 
L277" class="line" namn>
L277">6277./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_last" class="sref">wd_last./a> =6.a href="+code=wdnow" class="sref">wdnow./a>; 
L278" class="line" namn>
L278">6278./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=cs_last" class="sref">cs_last./a> =6.a href="+code=csnow" class="sref">csnow./a>; 
L279" class="line" namn>
L279">6279./a>                        continue; 
L280" class="line" namn>
L280">6280./a>                } 
L281" class="line" namn>
L281">6281./a> 
L282" class="line" namn>
L282">6282./a>                .a href="+code=wd_nsec" class="sref">wd_nsec./a> =6.a href="+code=clocksource_cyc2ns" class="sref">clocksource_cyc2ns./a>((.a href="+code=wdnow" class="sref">wdnow./a> - .a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_last" class="sref">wd_last./a>) &6.a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=mask" class="sref">mask./a>, 
L283" class="line" namn>
L283">6283./a>                                             .a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=mult" class="sref">mult./a>, .a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=shift" class="sref">shift./a>); 
L284" class="line" namn>
L284">6284./a> 
L285" class="line" namn>
L285">6285./a>                .a href="+code=cs_nsec" class="sref">cs_nsec./a> =6.a href="+code=clocksource_cyc2ns" class="sref">clocksource_cyc2ns./a>((.a href="+code=csnow" class="sref">csnow./a> - .a href="+code=cs" class="sref">cs./a>->.a href="+code=cs_last" class="sref">cs_last./a>) & 
L286" class="line" namn>
L286">6286./a>                                             .a href="+code=cs" class="sref">cs./a>->.a href="+code=mask" class="sref">mask./a>, .a href="+code=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a>, .a href="+code=cs" class="sref">cs./a>->.a href="+code=shift" class="sref">shift./a>); 
L287" class="line" namn>
L287">6287./a>                .a href="+code=cs" class="sref">cs./a>->.a href="+code=cs_last" class="sref">cs_last./a> =6.a href="+code=csnow" class="sref">csnow./a>; 
L288" class="line" namn>
L288">6288./a>                .a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_last" class="sref">wd_last./a> =6.a href="+code=wdnow" class="sref">wdnow./a>; 
L289" class="line" namn>
L289">6289./a> 
L290" class="line" namn>
L290">6290./a>                if6(.a href="+code=atomic_read" class="sref">atomic_read./a>(&.a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>)) 
L291" class="line" namn>
L291">6291./a>                        continue; 
L292" class="line" namn>
L292">6292./a> 
L293" class="line" namn>
L293">6293./a>                .spa> class="comment">/* Check the deviat  > from the watchdog clocksource. */./spa>
 
L294" class="line" namn>
L294">6294./a>                if6((.a href="+code=abs" class="sref">abs./a>(.a href="+code=cs_nsec" class="sref">cs_nsec./a> - .a href="+code=wd_nsec" class="sref">wd_nsec./a>) > .a href="+code=WATCHDOG_THRESHOLD" class="sref">WATCHDOG_THRESHOLD./a>)) { 
L295" class="line" namn>
L295">6295./a>                        .a href="+code=clocksource_unstable" class="sref">clocksource_unstable./a>(.a href="+code=cs" class="sref">cs./a>, .a href="+code=cs_nsec" class="sref">cs_nsec./a> - .a href="+code=wd_nsec" class="sref">wd_nsec./a>); 
L296" class="line" namn>
L296">6296./a>                        continue; 
L297" class="line" namn>
L297">6297./a>                } 
L298" class="line" namn>
L298">6298./a> 
L299" class="line" namn>
L299">6299./a>                if6(!(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_VALID_FOR_HRES" class="sref">CLOCK_SOURCE_VALID_FOR_HRES./a>) && 
L300" class="line" namn>
L300">6300./a>                    (.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_IS_CONTINUOUS" class="sref">CLOCK_SOURCE_IS_CONTINUOUS./a>) && 
L301" class="line" namn>
L301">6301./a>                    (.a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_IS_CONTINUOUS" class="sref">CLOCK_SOURCE_IS_CONTINUOUS./a>)) { 
L302" class="line" namn>
L302">6302./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> |=6.a href="+code=CLOCK_SOURCE_VALID_FOR_HRES" class="sref">CLOCK_SOURCE_VALID_FOR_HRES./a>; 
L303" class="line" namn>
L303">6303./a>                        .spa> class="comment">/*./spa>
 
L304" class="line" namn>
L304">6304./a>.spa> class="comment">                         * We just marked the clocksource as highres-capable,./spa>
 
L305" class="line" namn>
L305">6305./a>.spa> class="comment">                         * notify the rest of the system as well so that we./spa>
 
L306" class="line" namn>
L306">6306./a>.spa> class="comment">                         * transi	  > into high-res mode:./spa>
 
L307" class="line" namn>
L307">6307./a>.spa> class="comment">                         */./spa>
 
L308" class="line" namn>
L308">6308./a>                        .a href="+code=tick_clock_notify" class="sref">tick_clock_notify./a>(); 
L309" class="line" namn>
L309">6309./a>                } 
L310" class="line" namn>
L310">6310./a>        } 
L311" class="line" namn>
L311">6311./a> 
L312" class="line" namn>
L312">6312./a>        .spa> class="comment">/*./spa>
 
L313" class="line" namn>
L313">6313./a>.spa> class="comment">         * We only clear the watchdog_reset_pending, when we did6a./spa>
 
L314" class="line" namn>
L314">6314./a>.spa> class="comment">         * full cycle through all clocksources../spa>
 
L315" class="line" namn>
L315">6315./a>.spa> class="comment">         */./spa>
 
L316" class="line" namn>
L316">6316./a>        if6(.a href="+code=reset_pending" class="sref">reset_pending./a>) 
L317" class="line" namn>
L317">6317./a>                .a href="+code=atomic_dec" class="sref">atomic_dec./a>(&.a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>); 
L318" class="line" namn>
L318">6318./a> 
L319" class="line" namn>
L319">6319./a>        .spa> class="comment">/*./spa>
 
L320" class="line" namn>
L320">632"
	a>.spa> class="comment">         * Cycle through CPUs to check if the CPUs stay synchronized./spa>
 
L321" class="line" namn>
L321">6321./a>.spa> class="comment">         * to each other../spa>
 
L322" class="line" namn>
L322">6322./a>.spa> class="comment">         */./spa>
 
L323" class="line" namn>
L323">6323./a>        .a href="+code=next_cpu" class="sref">next_cpu./a> =6.a href="+code=cpumask_next" class="sref">cpumask_next./a>(.a href="+code=raw_smp_processor_id" class="sref">raw_smp_processor_id./a>(), .a href="+code=cpu_online_mask" class="sref">cpu_online_mask./a>); 
L324" class="line" namn>
L324">6324./a>        if6(.a href="+code=next_cpu" class="sref">next_cpu./a> >= .a href="+code=nr_cpu_ids" class="sref">nr_cpu_ids./a>) 
L325" class="line" namn>
L325">6325./a>                .a href="+code=next_cpu" class="sref">next_cpu./a> =6.a href="+code=cpumask_first" class="sref">cpumask_first./a>(.a href="+code=cpu_online_mask" class="sref">cpu_online_mask./a>); 
L326" class="line" namn>
L326">6326./a>        .a href="+code=watchdog_timer" class="sref">watchdog_timer./a>..a href="+code=expires" class="sref">expires./a> +=6.a href="+code=WATCHDOG_INTERVAL" class="sref">WATCHDOG_INTERVAL./a>; 
L327" class="line" namn>
L327">6327./a>        .a href="+code=add_timer_on" class="sref">add_timer_on./a>(&.a href="+code=watchdog_timer" class="sref">watchdog_timer./a>, .a href="+code=next_cpu" class="sref">next_cpu./a>); 
L328" class="line" namn>
L328">6328./a>.a href="+code=out" class="sref">out./a>: 
L329" class="line" namn>
L329">6329./a>        .a href="+code=spin_unlock" class="sref">spin_unlock./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>); 
L330" class="line" namn>
L330">633"
	a>} 
L331" class="line" namn>
L331">6331./a> 
L332" class="line" namn>
L332">6332./a>static .a href="+code=inline" class="sref">inline./a> void6.a href="+code=clocksource_start_watchdog" class="sref">clocksource_start_watchdog./a>(void) 
L333" class="line" namn>
L333">6333./a>{ 
L334" class="line" namn>
L334">6334./a>        if6(.a href="+code=watchdog_running" class="sref">watchdog_running./a> || !.a href="+code=watchdog" class="sref">watchdog./a> || .a href="+code=list_empty" class="sref">list_empty./a>(&.a href="+code=watchdog_list" class="sref">watchdog_list./a>)) 
L335" class="line" namn>
L335">6335./a>                return; 
L336" class="line" namn>
L336">6336./a>        .a href="+code=init_timer" class="sref">init_timer./a>(&.a href="+code=watchdog_timer" class="sref">watchdog_timer./a>); 
L337" class="line" namn>
L337">6337./a>        .a href="+code=watchdog_timer" class="sref">watchdog_timer./a>..a href="+code=func	  >" class="sref">func	  >./a> =6.a href="+code=clocksource_watchdog" class="sref">clocksource_watchdog./a>; 
L338" class="line" namn>
L338">6338./a>        .a href="+code=watchdog_timer" class="sref">watchdog_timer./a>..a href="+code=expires" class="sref">expires./a> =6.a href="+code=jiffies" class="sref">jiffies./a> +6.a href="+code=WATCHDOG_INTERVAL" class="sref">WATCHDOG_INTERVAL./a>; 
L339" class="line" namn>
L339">6339./a>        .a href="+code=add_timer_on" class="sref">add_timer_on./a>(&.a href="+code=watchdog_timer" class="sref">watchdog_timer./a>, .a href="+code=cpumask_first" class="sref">cpumask_first./a>(.a href="+code=cpu_online_mask" class="sref">cpu_online_mask./a>)); 
L340" class="line" namn>
L340">6340./a>        .a href="+code=watchdog_running" class="sref">watchdog_running./a> = 1; 
L341" class="line" namn>
L341">6341./a>} 
L342" class="line" namn>
L342">6342./a> 
L343" class="line" namn>
L343">6343./a>static .a href="+code=inline" class="sref">inline./a> void6.a href="+code=clocksource_stop_watchdog" class="sref">clocksource_stop_watchdog./a>(void) 
L344" class="line" namn>
L344">6344./a>{ 
L345" class="line" namn>
L345">6345./a>        if6(!.a href="+code=watchdog_running" class="sref">watchdog_running./a> || (.a href="+code=watchdog" class="sref">watchdog./a> && !.a href="+code=list_empty" class="sref">list_empty./a>(&.a href="+code=watchdog_list" class="sref">watchdog_list./a>))) 
L346" class="line" namn>
L346">6346./a>                return; 
L347" class="line" namn>
L347">6347./a>        .a href="+code=del_timer" class="sref">del_timer./a>(&.a href="+code=watchdog_timer" class="sref">watchdog_timer./a>); 
L348" class="line" namn>
L348">6348./a>        .a href="+code=watchdog_running" class="sref">watchdog_running./a> = 0; 
L349" class="line" namn>
L349">6349./a>} 
L350" class="line" namn>
L350">6350./a> 
L351" class="line" namn>
L351">6351./a>static .a href="+code=inline" class="sref">inline./a> void6.a href="+code=clocksource_reset_watchdog" class="sref">clocksource_reset_watchdog./a>(void) 
L352" class="line" namn>
L352">6352./a>{ 
L353" class="line" namn>
L353">6353./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>; 
L354" class="line" namn>
L354">6354./a> 
L355" class="line" namn>
L355">6355./a>        .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=watchdog_list" class="sref">watchdog_list./a>, .a href="+code=wd_list" class="sref">wd_list./a>) 
L356" class="line" namn>
L356">6356./a>                .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &= ~.a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>; 
L357" class="line" namn>
L357">6357./a>} 
L358" class="line" namn>
L358">6358./a> 
L359" class="line" namn>
L359">6359./a>static void6.a href="+code=clocksource_resume_watchdog" class="sref">clocksource_resume_watchdog./a>(void) 
L360" class="line" namn>
L360">6360./a>{ 
L361" class="line" namn>
L361">6361./a>        .a href="+code=atomic_inc" class="sref">atomic_inc./a>(&.a href="+code=watchdog_reset_pending" class="sref">watchdog_reset_pending./a>); 
L362" class="line" namn>
L362">6362./a>} 
L363" class="line" namn>
L363">6363./a> 
L364" class="line" namn>
L364">6364./a>static void6.a href="+code=clocksource_enqueue_watchdog" class="sref">clocksource_enqueue_watchdog./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L365" class="line" namn>
L365">6365./a>{ 
L366" class="line" namn>
L366">6366./a>        unsigned long .a href="+code=flags" class="sref">flags./a>; 
L367" class="line" namn>
L367">6367./a> 
L368" class="line" namn>
L368">6368./a>        .a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L369" class="line" namn>
L369">6369./a>        if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_MUST_VERIFY" class="sref">CLOCK_SOURCE_MUST_VERIFY./a>) { 
L370" class="line" namn>
L370">6370./a>                .spa> class="comment">/* cs is a clocksource to be watched. */./spa>
 
L371" class="line" namn>
L371">6371./a>                .a href="+code=list_add" class="sref">list_add./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>, &.a href="+code=watchdog_list" class="sref">watchdog_list./a>); 
L372" class="line" namn>
L372">6372./a>                .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &= ~.a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>; 
L373" class="line" namn>
L373">6373./a>        } else { 
L374" class="line" namn>
L374">6374./a>                .spa> class="comment">/* cs is a watchdog. */./spa>
 
L375" class="line" namn>
L375">6375./a>                if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_IS_CONTINUOUS" class="sref">CLOCK_SOURCE_IS_CONTINUOUS./a>) 
L376" class="line" namn>
L376">6376./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> |=6.a href="+code=CLOCK_SOURCE_VALID_FOR_HRES" class="sref">CLOCK_SOURCE_VALID_FOR_HRES./a>; 
L377" class="line" namn>
L377">6377./a>                .spa> class="comment">/* Pick the best watchdog. */./spa>
 
L378" class="line" namn>
L378">6378./a>                if6(!.a href="+code=watchdog" class="sref">watchdog./a> || .a href="+code=cs" class="sref">cs./a>->.a href="+code=rating" class="sref">rating./a> > .a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=rating" class="sref">rating./a>) { 
L379" class="line" namn>
L379">6379./a>                        .a href="+code=watchdog" class="sref">watchdog./a> =6.a href="+code=cs" class="sref">cs./a>; 
L380" class="line" namn>
L380">6380./a>                        .spa> class="comment">/* Reset watchdog cycles */./spa>
 
L381" class="line" namn>
L381">6381./a>                        .a href="+code=clocksource_reset_watchdog" class="sref">clocksource_reset_watchdog./a>(); 
L382" class="line" namn>
L382">6382./a>                } 
L383" class="line" namn>
L383">6383./a>        } 
L384" class="line" namn>
L384">6384./a>        .spa> class="comment">/* Check if the watchdog timer needs to be started. */./spa>
 
L385" class="line" namn>
L385">6385./a>        .a href="+code=clocksource_start_watchdog" class="sref">clocksource_start_watchdog./a>(); 
L386" class="line" namn>
L386">6386./a>        .a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L387" class="line" namn>
L387">6387./a>} 
L388" class="line" namn>
L388">6388./a> 
L389" class="line" namn>
L389">6389./a>static void6.a href="+code=clocksource_dequeue_watchdog" class="sref">clocksource_dequeue_watchdog./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L390" class="line" namn>
L390">6390./a>{ 
L391" class="line" namn>
L391">6391./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=tmp" class="sref">tmp./a>; 
L392" class="line" namn>
L392">6392./a>        unsigned long .a href="+code=flags" class="sref">flags./a>; 
L393" class="line" namn>
L393">6393./a> 
L394" class="line" namn>
L394">6394./a>        .a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L395" class="line" namn>
L395">6395./a>        if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_MUST_VERIFY" class="sref">CLOCK_SOURCE_MUST_VERIFY./a>) { 
L396" class="line" namn>
L396">6396./a>                .spa> class="comment">/* cs is a watched clocksource. */./spa>
 
L397" class="line" namn>
L397">6397./a>                .a href="+code=list_del_init" class="sref">list_del_init./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>); 
L398" class="line" namn>
L398">6398./a>        } else if6(.a href="+code=cs" class="sref">cs./a> ==6.a href="+code=watchdog" class="sref">watchdog./a>) { 
L399" class="line" namn>
L399">6399./a>                .spa> class="comment">/* Reset watchdog cycles */./spa>
 
L400" class="line" namn>
L400">6400./a>                .a href="+code=clocksource_reset_watchdog" class="sref">clocksource_reset_watchdog./a>(); 
L401" class="line" namn>
L401">6401./a>                .spa> class="comment">/* Current watchdog is removed. Find a> alternative. */./spa>
 
L402" class="line" namn>
L402">6402./a>                .a href="+code=watchdog" class="sref">watchdog./a> =6.a href="+code=NULL" class="sref">NULL./a>; 
L403" class="line" namn>
L403">6403./a>                .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=tmp" class="sref">tmp./a>, &.a href="+code=clocksource_list" class="sref">clocksource_list./a>, .a href="+code=list" class="sref">list./a>) { 
L404" class="line" namn>
L404">6404./a>                        if6(.a href="+code=tmp" class="sref">tmp./a> ==6.a href="+code=cs" class="sref">cs./a> || .a href="+code=tmp" class="sref">tmp./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_MUST_VERIFY" class="sref">CLOCK_SOURCE_MUST_VERIFY./a>) 
L405" class="line" namn>
L405">6405./a>                                continue; 
L406" class="line" namn>
L406">6406./a>                        if6(!.a href="+code=watchdog" class="sref">watchdog./a> || .a href="+code=tmp" class="sref">tmp./a>->.a href="+code=rating" class="sref">rating./a> > .a href="+code=watchdog" class="sref">watchdog./a>->.a href="+code=rating" class="sref">rating./a>) 
L407" class="line" namn>
L407">6407./a>                                .a href="+code=watchdog" class="sref">watchdog./a> =6.a href="+code=tmp" class="sref">tmp./a>; 
L408" class="line" namn>
L408">6408./a>                } 
L409" class="line" namn>
L409">6409./a>        } 
L410" class="line" namn>
L410">6410./a>        .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &= ~.a href="+code=CLOCK_SOURCE_WATCHDOG" class="sref">CLOCK_SOURCE_WATCHDOG./a>; 
L411" class="line" namn>
L411">6411./a>        .spa> class="comment">/* Check if the watchdog timer needs to be stopped. */./spa>
 
L412" class="line" namn>
L412">6412./a>        .a href="+code=clocksource_stop_watchdog" class="sref">clocksource_stop_watchdog./a>(); 
L413" class="line" namn>
L413">6413./a>        .a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L414" class="line" namn>
L414">6414./a>} 
L415" class="line" namn>
L415">6415./a> 
L416" class="line" namn>
L416">6416./a>static int .a href="+code=clocksource_watchdog_kthread" class="sref">clocksource_watchdog_kthread./a>(void6*.a href="+code=data" class="sref">data./a>) 
L417" class="line" namn>
L417">6417./a>{ 
L418" class="line" namn>
L418">6418./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>, *.a href="+code=tmp" class="sref">tmp./a>; 
L419" class="line" namn>
L419">6419./a>        unsigned long .a href="+code=flags" class="sref">flags./a>; 
L420" class="line" namn>
L420">6420./a>        .a href="+code=LIST_HEAD" class="sref">LIST_HEAD./a>(.a href="+code=unstable" class="sref">unstable./a>); 
L421" class="line" namn>
L421">6421./a> 
L422" class="line" namn>
L422">6422./a>        .a href="+code=mutex_lock" class="sref">mutex_lock./a>(&.a href="+code=clocksource_mutex" class="sref">clocksource_mutex./a>); 
L423" class="line" namn>
L423">6423./a>        .a href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsave./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L424" class="line" namn>
L424">6424./a>        .a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe./a>(.a href="+code=cs" class="sref">cs./a>, .a href="+code=tmp" class="sref">tmp./a>, &.a href="+code=watchdog_list" class="sref">watchdog_list./a>, .a href="+code=wd_list" class="sref">wd_list./a>) 
L425" class="line" namn>
L425">6425./a>                if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_UNSTABLE" class="sref">CLOCK_SOURCE_UNSTABLE./a>) { 
L426" class="line" namn>
L426">6426./a>                        .a href="+code=list_del_init" class="sref">list_del_init./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>); 
L427" class="line" namn>
L427">6427./a>                        .a href="+code=list_add" class="sref">list_add./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>, &.a href="+code=unstable" class="sref">unstable./a>); 
L428" class="line" namn>
L428">6428./a>                } 
L429" class="line" namn>
L429">6429./a>        .spa> class="comment">/* Check if the watchdog timer needs to be stopped. */./spa>
 
L430" class="line" namn>
L430">6430./a>        .a href="+code=clocksource_stop_watchdog" class="sref">clocksource_stop_watchdog./a>(); 
L431" class="line" namn>
L431">6431./a>        .a href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore./a>(&.a href="+code=watchdog_lock" class="sref">watchdog_lock./a>, .a href="+code=flags" class="sref">flags./a>); 
L432" class="line" namn>
L432">6432./a> 
L433" class="line" namn>
L433">6433./a>        .spa> class="comment">/* Needs to be done outside of watchdog lock */./spa>
 
L434" class="line" namn>
L434">6434./a>        .a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe./a>(.a href="+code=cs" class="sref">cs./a>, .a href="+code=tmp" class="sref">tmp./a>, &.a href="+code=unstable" class="sref">unstable./a>, .a href="+code=wd_list" class="sref">wd_list./a>) { 
L435" class="line" namn>
L435">6435./a>                .a href="+code=list_del_init" class="sref">list_del_init./a>(&.a href="+code=cs" class="sref">cs./a>->.a href="+code=wd_list" class="sref">wd_list./a>); 
L436" class="line" namn>
L436">6436./a>                .a href="+code=__clocksource_change_rating" class="sref">__clocksource_change_rating./a>(.a href="+code=cs" class="sref">cs./a>, 0); 
L437" class="line" namn>
L437">6437./a>        } 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex" class="sref">clocksource_mutex./a>); 
L439" class="line" namn>
L439">6439./a>        return 0; 
L440" class="line" namn>
L440">644"
	a>} 
L441" class="line" namn>
L441">6441./a> 
L442" class="line" namn>
L442">6442./a>#else .spa> class="comment">/* CONFIG_CLOCKSOURCE_WATCHDOG */./spa>
 
L443" class="line" namn>
L443">6443./a> 
L444" class="line" namn>
L444">6444./a>static void6.a href="+code=clocksource_enqueue_watchdog" class="sref">clocksource_enqueue_watchdog./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L445" class="line" namn>
L445">6445./a>{ 
L446" class="line" namn>
L446">6446./a>        if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> &6.a href="+code=CLOCK_SOURCE_IS_CONTINUOUS" class="sref">CLOCK_SOURCE_IS_CONTINUOUS./a>) 
L447" class="line" namn>
L447">6447./a>                .a href="+code=cs" class="sref">cs./a>->.a href="+code=flags" class="sref">flags./a> |=6.a href="+code=CLOCK_SOURCE_VALID_FOR_HRES" class="sref">CLOCK_SOURCE_VALID_FOR_HRES./a>; 
L448" class="line" namn>
L448">6448./a>} 
L449" class="line" namn>
L449">6449./a> 
L450" class="line" namn>
L450">6450./a>static .a href="+code=inline" class="sref">inline./a> void6.a href="+code=clocksource_dequeue_watchdog" class="sref">clocksource_dequeue_watchdog./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) { } 
L451" class="line" namn>
L451">6451./a>static .a href="+code=inline" class="sref">inline./a> void6.a href="+code=clocksource_resume_watchdog" class="sref">clocksource_resume_watchdog./a>(void) { } 
L452" class="line" namn>
L452">6452./a>static .a href="+code=inline" class="sref">inline./a> int .a href="+code=clocksource_watchdog_kthread" class="sref">clocksource_watchdog_kthread./a>(void6*.a href="+code=data" class="sref">data./a>) { return 0; } 
L453" class="line" namn>
L453">6453./a> 
L454" class="line" namn>
L454">6454./a>#endif .spa> class="comment">/* CONFIG_CLOCKSOURCE_WATCHDOG */./spa>
 
L455" class="line" namn>
L455">6455./a> 
L456" class="line" namn>
L456">6456./a>.spa> class="comment">/**./spa>
 
L457" class="line" namn>
L457">6457./a>.spa> class="comment"> * clocksource_suspend - suspend the clocksource(s)./spa>
 
L458" class="line" namn>
L458">6458./a>.spa> class="comment"> */./spa>
 
L459" class="line" namn>
L459">6459./a>void6.a href="+code=clocksource_suspend" class="sref">clocksource_suspend./a>(void) 
L460" class="line" namn>
L460">6460./a>{ 
L461" class="line" namn>
L461">6461./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>; 
L462" class="line" namn>
L462">6462./a> 
L463" class="line" namn>
L463">6463./a>        .a href="+code=list_for_each_entry_reverse" class="sref">list_for_each_entry_reverse./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=clocksource_list" class="sref">clocksource_list./a>, .a href="+code=list" class="sref">list./a>) 
L464" class="line" namn>
L464">6464./a>                if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=suspend" class="sref">suspend./a>) 
L465" class="line" namn>
L465">6465./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=suspend" class="sref">suspend./a>(.a href="+code=cs" class="sref">cs./a>); 
L466" class="line" namn>
L466">6466./a>} 
L467" class="line" namn>
L467">6467./a> 
L468" class="line" namn>
L468">6468./a>.spa> class="comment">/**./spa>
 
L469" class="line" namn>
L469">6469./a>.spa> class="comment"> * clocksource_resume - resume the clocksource(s)./spa>
 
L470" class="line" namn>
L470">647"
	a>.spa> class="comment"> */./spa>
 
L471" class="line" namn>
L471">6471./a>void6.a href="+code=clocksource_resume" class="sref">clocksource_resume./a>(void) 
L472" class="line" namn>
L472">6472./a>{ 
L473" class="line" namn>
L473">6473./a>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>; 
L474" class="line" namn>
L474">6474./a> 
L475" class="line" namn>
L475">6475./a>        .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=clocksource_list" class="sref">clocksource_list./a>, .a href="+code=list" class="sref">list./a>) 
L476" class="line" namn>
L476">6476./a>                if6(.a href="+code=cs" class="sref">cs./a>->.a href="+code=resume" class="sref">resume./a>) 
L477" class="line" namn>
L477">6477./a>                        .a href="+code=cs" class="sref">cs./a>->.a href="+code=resume" class="sref">resume./a>(.a href="+code=cs" class="sref">cs./a>); 
L478" class="line" namn>
L478">6478./a> 
L479" class="line" namn>
L479">6479./a>        .a href="+code=clocksource_resume_watchdog" class="sref">clocksource_resume_watchdog./a>(); 
L480" class="line" namn>
L480">648"
	a>} 
L481" class="line" namn>
L481">6481./a> 
L482" class="line" namn>
L482">6482./a>.spa> class="comment">/**./spa>
 
L483" class="line" namn>
L483">6483./a>.spa> class="comment"> * clocksource_touch_watchdog - Update watchdog./spa>
 
L484" class="line" namn>
L484">6484./a>.spa> class="comment"> *./spa>
 
L485" class="line" namn>
L485">6485./a>.spa> class="comment"> * Update the watchdog after excep	  > contexts such as kgdb so as not./spa>
 
L486" class="line" namn>
L486">6486./a>.spa> class="comment"> * to incorrectly trip the watchdog. This might fail when the kernel./spa>
 
L487" class="line" namn>
L487">6487./a>.spa> class="comment"> * was stopped in code which holds watchdog_lock../spa>
 
L488" class="line" namn>
L488">6488./a>.spa> class="comment"> */./spa>
 
L489" class="line" namn>
L489">6489./a>void6.a href="+code=clocksource_touch_watchdog" class="sref">clocksource_touch_watchdog./a>(void) 
L490" class="line" namn>
L490">6490./a>{ 
L491" class="line" namn>
L491">6491./a>        .a href="+code=clocksource_resume_watchdog" class="sref">clocksource_resume_watchdog./a>(); 
L492" class="line" namn>
L492">6492./a>} 
L493" class="line" namn>
L493">6493./a> 
L494" class="line" namn>
L494">6494./a>.spa> class="comment">/**./spa>
 
L495" class="line" namn>
L495">6495./a>.spa> class="comment"> * clocksource_max_adjustment- Returns max adjustment amount./spa>
 
L496" class="line" namn>
L496">6496./a>.spa> class="comment"> * @cs:         Pointer to clocksource./spa>
 
L497" class="line" namn>
L497">6497./a>.spa> class="comment"> *./spa>
 
L498" class="line" namn>
L498">6498./a>.spa> class="comment"> */./spa>
 
L499" class="line" namn>
L499">6499./a>static .a href="+code=u32" class="sref">u32./a> .a href="+code=clocksource_max_adjustment" class="sref">clocksource_max_adjustment./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L500" class="line" namn>
L500">6500./a>{ 
L501" class="line" namn>
L501">6501./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=ret" class="sref">ret./a>; 
L502" class="line" namn>
L502">6502./a>        .spa> class="comment">/*./spa>
 
L503" class="line" namn>
L503">6503./a>.spa> class="comment">         * We won't try to correct for more tha> 11% adjustments (110,000 ppm),./spa>
 
L504" class="line" namn>
L504">6504./a>.spa> class="comment">         */./spa>
 
L505" class="line" namn>
L505">6505./a>        .a href="+code=ret" class="sref">ret./a> =6(.a href="+code=u64" class="sref">u64./a>).a href="+code=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> * 11; 
L506" class="line" namn>
L506">6506./a>        .a href="+code=do_div" class="sref">do_div./a>(.a href="+code=ret" class="sref">ret./a>,100); 
L507" class="line" namn>
L507">6507./a>        return (.a href="+code=u32" class="sref">u32./a>).a href="+code=ret" class="sref">ret./a>; 
L508" class="line" namn>
L508">6508./a>} 
L509" class="line" namn>
L509">6509./a> 
L510" class="line" namn>
L510">651"
	a>.spa> class="comment">/**./spa>
 
L511" class="line" namn>
L511">6511./a>.spa> class="comment"> * clocksource_max_deferment - Returns max time the clocksource ca> be deferred./spa>
 
L512" class="line" namn>
L512">6512./a>.spa> class="comment"> * @cs:         Pointer to clocksource./spa>
 
L513" class="line" namn>
L513">6513./a>.spa> class="comment"> *./spa>
 
L514" class="line" namn>
L514">6514./a>.spa> class="comment"> */./spa>
 
L515" class="line" namn>
L515">6515./a>static .a href="+code=u64" class="sref">u64./a> .a href="+code=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a href="+code=cs" class="sref">cs./a>) 
L516" class="line" namn>
L516">6516./a>{ 
L517" class="line" namn>
L517">6517./a>        .a href="+code=u64" class="sref">u64./a> .a href="+code=max_nsecs" class="sref">max_nsecs./a>, .a href="+code=max_cycles" class="sref">max_cycles./a>; 
L518" class="line" namn>
L518">6518./a> 
L519" class="line" namn>
L519">6519./a>        .spa> class="comment">/*./spa>
 
L520" class="line" namn>
L520">652"
	a>.spa> class="comment">         * Calculate the maximum number of cycles that we ca> pass to the./spa>
 
L521" class="line" namn>
L521">6521./a>.spa> class="comment">         * cyc2ns func	  > without overflowing a 64-bit signed result. The./spa>
 
L522" class="line" namn>
L522">6522./a>.spa> class="comment">         * maximum number of cycles is equal to ULLONG_MAX/(cs->mult+cs->maxadj)./spa>
 
L523" class="line" namn>
L523">6523./a>.spa> class="comment">         * which is equivalent to the below../spa>
 
L524" class="line" namn>
L524">6524./a>.spa> class="comment">         * max_cycles < (2^63)/(cs->mult + cs->maxadj)./spa>
 
L525" class="line" namn>
L525">6525./a>.spa> class="comment">         * max_cycles < 2^(log2((2^63)/(cs->mult + cs->maxadj)))./spa>
 
L526" class="line" namn>
L526">6526./a>.spa> class="comment">         * max_cycles < 2^(log2(2^63) - log2(cs->mult + cs->maxadj))./spa>
 
L527" class="line" namn>
L527">6527./a>.spa> class="comment">         * max_cycles < 2^(63 - log2(cs->mult + cs->maxadj))./spa>
 
L528" class="line" namn>
L528">6528./a>.spa> class="comment">         * max_cycles < 1 << (63 - log2(cs->mult + cs->maxadj))./spa>
 
L529" class="line" namn>
L529">6529./a>.spa> class="comment">         * Please note that we add 1 to the result of the log2 to account for./spa>
 
L530" class="line" namn>
L530">653"
	a>.spa> class="comment">         * any rounding errors, ensure the above inequality is satisfied a>d./spa>
 
L531" class="line" namn>
L531">6531./a>.spa> class="comment">         * no overflow will occur../spa>
 
L532" class="line" namn>
L532">6532./a>.spa> class="comment">         */./spa>
 
L533" class="line" namn>
L533">6533./a>        .a href="+code=max_cycles" class="sref">max_cycles./a> = 1ULL << (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+code=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=cs" class="sref">cs./a>->.a href="+code=maxadj" class="sref">maxadj./a>) + 1)); 
L534" class="line" namn>
L534">6534./a> 
L535" class="line" namn>
L535">6535./a>        .spa> class="comment">/*./spa>
 
L536" class="line" namn>
L536">6536./a>.spa> class="comment">         * The actual maximum number of cycles we ca> defer the clocksource is./spa>
 
L537" class="line" namn>
L537">6537./a>.spa> class="comment">         * determined by the minimum of max_cycles a>d cs->mask../spa>
 
L538" class="line" namn>
L538">6538./a>.spa> class="comment">         * Note: Here we subtract the maxadj to make sure we don't sleep for./spa>
 
L539" class="line" namn>
L539">6539./a>.spa> class="comment">         * too long if there's a large negative adjustment../spa>
 
L5       return 0; 65s="snE_WAT" class="5ine" namn>
L440">644"
	a5} 
L533" class="line" namn>
L533"me/clocksource.cin_f">ilog2./a>(.a hin_fcycles./a> = 1ULL &lc#L517" id>
L517" class=" class="sref">u64./a> .a href="+code=max_nsecs" class="s,ne" namn>
L505">6505./a>        .a href="+ce=cs" class="sref">cs./a>->.a href="+code=mult" class="sres
L438" class="lines
="+code=resume" class="sref">resume./a>(.a 51" class=5line" namn>
L441">6441./5> u>
L521="+code=u64" class="sref">u>
L521cycles./a> = 1ULL &l./a> .a href="+code=max_nsecs" class="s,ns./a> = 1ULL << (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+co-e=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=,e=resume" class="sref">resume./a>(.a 51 class="cKSOURCE_WATCHDOG */./spa5
 cs./a>->.a href="+code=mult" class="sshiff">ilog2./a>(.a shiff="+code=resume" class="sref">resume./a>(.a 51dj" classline" namn>
L443">6443./5> 
L53href="+co5e=cs" class="sref">cs./a5) 
L535" class="line" namn>
L535">6535./a>   " class="5ine" namn>
L445">6445./a5{ o namn>
L53atlass="comment">  doecomme wrapd>
Llsline" >
Lidlee won't try to correct for more tha> 11ref">CLOC5_SOURCE_IS_CONTINUOUS./a5) 6511./a>.spa> class="comment"> * class=12.5a> cl.d>
L529 won't try to correct for more tha> 11r max_cyclSOURCE_VALID_FOR_HRES./a5; 
L512.5a> cllassusclasecausc1./ass"commenockputclaine" won't try to correct for more tha> 11r sure we ine" namn>
L448">6448./a5}  cll>
L523woulss="qui>
Ldivisions="comment">         * too long if there's9" class=5line" namn>
L449">6449./5> 
L5       return 0; 65s="snE_WAT="+code=c5" class="sref">cs./a>) {5} resume./a>(.a 5source_re5ume_watchdog./a>(void) {5} 
L495class="sr5f">data./a>) { return 0;5} 
L453" class=5line" namn>
L453">6453./5> s" class="sref">c>
L454ARCH_USES_GETTIMEOFFSET>        .a hrec>
L454ARCH_USES_GETTIMEOFFSETf="kernel/time/clocksource.c#L453" id>
L453ref="+co5KSOURCE_WATCHDOG */./spa5
 
L455" class=5line" namn>
L455">6455./5> 
L456" class="line" namn>
L456">6455./a>.spa>5class="comment">/**./spa5
 
L45eln>
L- Seln>
L="line" n.spa> class=availtmp" c56" id>
L456" class="line" namn>
L456">6455. max_cycl the clocksource(s)./spa5
 
L456" class="line" namn>
L456">6455. sure we class="comment"> */./spa5
 
L51lock.spa> calleds="comment">         * too long if there's"sref">cl5cksource_suspend./a>(voi5)          * too long if there's""+code=c5ine" namn>
L460">6460./a5{  class=ine"L="line" nref="+, oclass="comment"> e won't try to correct for more tha> 11href="+co5e=cs" class="sref">cs./a5; 
class=uscrrness=531"rides="comment">         * too long if there's"lass="sr5line" namn>
L462">6462./5> 65s="snE_WAT="+code=l5st" class="sref">list./a5) 
L4445eln>
="+code=u64" class="sref">u5eln>
"+code=clocksource_touch_watchdog" class="sref"5e=suspend5 class="sref">suspend./a5) 
L445ref="+cod5=cs" class="sref">cs./a>5; clocksource_max_deferment./a>(structne" ass="sref">clocne" s="s,na>        struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a5" class="5ine" namn>
L466">6466./a5} 
L457" class=5line" namn>
L467">6467./5> 
L406" clafinished_boonamn>
L436">6436./afinished_boonamnf="ke                  n>
L4emptclass="line" namn>
L4emptc"+codss="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a)ocksource_touch_watchdog" class="sref"5e sure we class="comment">/**./spa5
 clocksource./a> *.a5e - resum5 the clocksource(s)./spa5
  class=o> clasf">c hasL="line" nref="+  .spa> class="comment">/* Check if the watchdog5
	a>.spa>5class="comment"> */./spa5
 clocne" s="s                  n>
L47ir" 475" class="line" namn>
L47ir" 475" c"+codss="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a,iode=clocksource_max_deferment" class="sref">clocksource_max_def>, &.a href="+code=clocksource_list" clasurce" class="sref">clocksource./a> *.a5eref="+co5ocksource_resume./a>(voi5) 
L429foclass=531"riden.spa> class  .spa> class="comment">/* Check if the watchdog5
lass="sr5ine" namn>
L472">6472./a5{ 
L475" class="line" namn>
L475">6475./a>        .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=clocksource_list" clasass="sref">unstable./a>, .a href="+code5href="+co5e=cs" class="sref">cs./a5; 
odecch_entry_safe./a>odecchcycles./a> = 1ULL << (63 - (.a href="+code=ilog2" class="">cs< (63 - (.a ">css./a>, &.a href="531"ride_">cs< (63 - (.a 531"ride_">cs clasa!= 0ocksource_touch_watchdog" class="sref"54" class=5line" namn>
L474">6474./5> 
L405">6405./a>    5="+code=l5st" class="sref">list./a5) 
L535" class="line" namn>
L535">6535./a>   ode=resum5" class="sref">resume./a5) 
L429538./a>.spa> class="commentine523="co non-higass      * The actual maximum number of cycles weref="+cod5=cs" class="sref">cs./a>5;    flass=>6429 clas" cin>
neshment"> * Update the watchdog after excep	  > c58" class=5line" namn>
L478">6478./5> clockso5rce_resume_watchdog./a>(5;  class="comment">/* Check if the watchdog5" class="5ine" namn>
L480">648"
	a5} 
L446" class="line" namn>
L446">6446./a>        if6(.a href="+code=cs" class="sref">cs./a>->.a hr href="+code=flags" class="sref">flags./a> |=6.a href="+code)e=cs" =cs" ss="comment">/* Check if the watchdog5"ref="+co5line" namn>
L481">6481./5> cs.>642_
neshme_mcla_ac9./alags" class="sr>642_
neshme_mcla_ac9./acycle)sass="sref">unstable./a>, .a href="+code5./a>.spa>5class="comment">/**./spa5
  classs"comme besuscl  .spa> class="comment">/* Check if the watchdog5ch_watchd5g - Update watchdog./spa5
 cs.print
L438" class="liprint
cycles./a> = 1ULL &lKERN_WARNIN=flags" class="sKERN_WARNIN=ss="lie/clocksourcodeamn>>"O31"riden.spa> classsa> clmn>
Lmme "pa> class="comment">/* Check if the watchdog5c" class=5 class="comment"> *./spa5
 >"HRTnockpef=mp". Ccomme tine523>
Ll"
	a "pa> class="comment">/* Check if the watchdog5c"+code=l5h as kgdb so as not./spa5
 >"HRT/NOHZdmcla\n"pa> cla,ns./a> = 1ULL << (63 - (.a href="+code=ilog2" class="">cs< (63 - (.a ">css./asurce" class="sref">clocksource./a> *.a5is might 5ail when the kernel./spa5
 
L477531"ride_">cs< (63 - (.a 531"ride_">cs cla[0]   ksource.c#L439" id>
L439" class="line" 5de which 5olds watchdog_lock../spa5
 
L439" class="line" 5d" class=5class="comment"> */./spa5
  classs"co besuscl  .spa> class="comment">/* Check if the watchdog5clocksour5e_touch_watchdog./a>(voi5) 
L477ne" ass="sref">clocne" s="s                  6.a href="+code=clocksource" class="sref">clocksource./a> *.a5" class="5ine" namn>
L490">6490./a5{ clocksource./a> *.a5"ref="+co5rce_resume_watchdog./a>(5; 
L495" class="5ine" namn>
L492">6492./a5} 
Lurr_ferment" class="sref">clockurr_ferment" clf="ke!                 ne" ass="sref">clocne" s="ssass="sref">unstable./a>, .a href="+code53" class=5line" namn>
L493">6493./5> cs.print
L438" class="liprint
cycles./a> = 1ULL &lKERN_INFOflags" class="sKERN_INFOss="lie/clocksourcodeamn>>"Sine52lass="line" namn>
sa> clm\n"pa> cla,ns./a> = 1ULL &lne" ass="sref">clocne" s="s+code=ilog2" class="">cs< (63 - (.a ">css./asurce" class="sref">clocksource./a> *.a5./a>.spa>5class="comment">/**./spa5
 clockurr_ferment" clf="ke                 ne" ass="sref">clocne" s="surce" class="sref">clocksource./a> *.a5."+code=l5x adjustment amount./spa5
 clokeeplas_mmeifclass="line" nam>clokeeplas_mmeifccycles./a> = 1ULL <urr_ferment" class="sref">clockurr_ferment" clf="ksurce" class="sref">clocksource./a> *.a5.s might 5nter to clocksource./spa5
 
L437" class57./a>.spa5 class="comment"> *./spa5
 
L508./a>.spa>5class="comment"> */./spa5
 
L56href="+co6e=cs" class="sref">cs./a6) 
L454ARCH_USES_GETTIMEOFFSET .spa> class="comment">/* Check if the watchdog6" class="6ine" namn>
L500">6500./a6{ 
L46ef="+code6ret" class="sref">ret./a6; 
L452" class="line" ime/clocksource.c#L444" id>
L4445eln>
="+code=u64" class="sref">u5eln>
"+code=closource_resume_watchdog" class="sref">cloc6     .spa6 class="comment">/*./spa6
 
L467; adjust6ents (110,000 ppm),./spa6
 
L4675 adjust6elass="comment">/**./spa6
 
L46de=mult" 6lass="sref">mult./a> * 16; /* Check if the watchdog6"7=mult" 6lter to clocksource./spa6; 
L4s="l_boonamn -d>
Lled neaclass=e" n
L536503boonuppa> class="comment">/* Check if the watchdog6"8=mult" 6lclass="comment"> *./spa6; 
L456" class="line" namn>
L456">6456" class="6ine" namn>
L508">6508./a6} 651s="comment">         * too long if there'69" class=6line" namn>
L509">6509./6>          * too long if there'69 class="6class="comment">/**./spa6
          * too long if there'69f="+code6rce ca> be deferred./spa6
 /* Check if the watchdog6       Po6nter to clocksource./spa6
 6452./a_" class="line" namn>_435./a>  >
L450">6450./a>static .a hre="l_boonamn="+code=u64" class="sref">ue="l_boonamn"+code=clocksource_touch_watchdog" class="sref"63./a>.spa6 class="comment"> *./spa6
 unstable./a>, .a href="+code6./a>.spa>6class="comment"> */./spa6
 ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"6href="+co6e=cs" class="sref">cs./a6) clockurr_ferment" clf="ke                 ass="sref">ueefault_ferme="+code=u64" class="sref">ueefault_fermecycle)&.a href="+code=clocksource_mutex"6h7=mult" 6ine" namn>
L516">6516./a6{ 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"6cycles" c6ass="sref">max_cycles./a6; 
L568" class=6line" namn>
L518">6518./6> 6436./afinished_boonamnf="ke= cs" class="sref">cs./a>->.a href="+c6     .spa6 class="comment">/*./spa6
 cs./a>->.a href="+c6  class="6 we ca> pass to the./spa6
 /* Check if the watchdog6g a 64-bi6 signed result. The./spa6
 
L485" clas7ir" s538elimin" clode=tmp"53spa> e watc      * The actual maximum number of cycles w6X/(cs->6mult+cs->maxadj)./spa6
  class="comment">/* Check if the watchdog6h is equi6alent to the below../spa6
 mutex_uref="+code=inline" class="sref">inline./a> int .a href="+code=clme/clocksource.NULLe" class="sref"NULL./a>(&.a href="+code=clocksource_mutex"6(cs->m6lt + cs->maxadj)./spa6
 
L46s->mul6 + cs->maxadj)))./spa6
 ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"6cs->mu6t + cs->maxadj))./spa6
 
L4445eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"6cycles" c6t + cs->maxadj))./spa6
 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"6cs->mu6t + cs->maxadj))./spa6
 
L439" class="line" 6lt of the6log2 to account for./spa6
 
L486e inequal6ty is satisfied a>d./spa6
 6436./afs435./callcycles./a> = 1ULL <tatic .a hre="l_boonamn="+code=u64" class="sref">ue="l_boonamn"+co(&.a href="+code=clocksource_mutex"6    * no 6verflow will occur../spa6
 
L46> class="6omment">         */./spa6
 /* Check if the watchdog6adj" clas6="sref">maxadj./a>) + 1)6;  class=sor
class=ref="+pa> class="comment">/* Check if the watchdog6acs->m6line" namn>
L534">6534./6> /* Check if the watchdog6     .spa6 class="comment">/*./spa6
 
L444" class="+code=u64" class="sref">u" classcycleode=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clocksource" class="sref">clocksource./a> *.a6 ca> defe6 the clocksource is./spa6
 unstable./a>, .a href="+code6f max_cyc6es a>d cs->mask../spa6
 
L4hlin_deferment./a>(struct75" class="line" nam/a>      e= ss="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a&.a href="+code=clocksource_mutex"6 s->mu6don't sleep for./spa6
 clocksource_max_deferment./a>(structtch_entry_safe./a>tchcycl&.a href="+code=clocksource_mutex"6 a large 6egative adjustment../spa6
 cs./a>->.a href="+c6" class="6ine" namn>
L440">644"
	a6} 
L475" class="line" namn>
L475">6475./a>        .a href="+codetch_entry_safe./a>tchcycllass="sref">list_for_each_entry./a>(.a href="+code=cs" class="sref">cs./a>, &.a href="+code=clocksource_list" class="sref">clocksource_list./a>, .a hre61" class=6line" namn>
L441">6441./6>    ne" ka>.spa> place,.spa>
L5486"sert.cspa> class="comment">/* Check if the watchdog61 class="6KSOURCE_WATCHDOG */./spa6
 
tch_entry_safe./a>tchcycl77">6477./a>         anamn="+code=u64" clref="+pa4" code                 6.a href="+code=clockso77">6477./a>         anamn="+code=u64" clref="+pa4"ss="sref">clocksource_list./a>, .a hre61dj" clas6line" namn>
L443">6443./6> cs.75" class="line" nam/a>      e= ss="sref">list_for_etch_entry_safe./a>tchcycl77">6477./a>        +code=clocksource_list" cla&.a href="+code=clocksource_mutex"6 cs->m6e=cs" class="sref">cs./a6) 
L4adn38">6438./a>        .a hre.a href="+code=clockso77">6477./a>        +code=clocksource_list" cla>, &.a href="75" class="line" nam/a>      (&.a href="+code=clocksource_mutex"6" class="6ine" namn>
L445">6445./a6{ 
L466ref">CLOC6_SOURCE_IS_CONTINUOUS./a6) 
L46r max_cyc6SOURCE_VALID_FOR_HRES./a6; 
L456" class="line" namn>
L456">6456r sure we6ine" namn>
L448">6448./a6}  class=ine"Lnew freqL456" id>
L456" class="line" namn>
L456">64569" class=6line" namn>
L449">6449./6> 
L51.spa> class=548b">65gst"e clocksource_max_deferment - Returns max time t6="+code=c6" class="sref">cs./a>) {6} 
Scallafact03">ultiplent">ga6"st freq=548ge n.spa> class=hzocksource_max_deferment - Returns max time t6=" class=6ume_watchdog./a>(void) {6} data./a>) { return 0;6} 
L513" class="line" namn>
L513">6563" class=6line" namn>
L453">6453./6>  class77">6entmp"() methods="comment">         * too long if there'63ref="+co6KSOURCE_WATCHDOG */./spa6
          * too long if there'63 class="6line" namn>
L455">6455./6> CLOC6class="comment">/**./spa6
 
L4u485" freq_hz() 03"L457" id>
L4u485" freq_khz helplin class="ss="comment">         * too long if there'63 max_cyc6 the clocksource(s)./spa6
 /* Check if the watchdog6. sure we6class="comment"> */./spa6
 _4ferment" cl_u485" freq_scallcycleode=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clockso>, &.a href=".c#L499" id>
L499" class="line" namn>
L49scallss="line" namn>scallcycl>, &.a href=".c#L499" id>
L499" class="line" namn>
L49freq>
L436">6436./afreqL44"ss="sref">clocksource_list./a>, .a hre6"sref">cl6cksource_suspend./a>(voi6) 
L506""+code=c6ine" namn>
L460">6460./a6{ 
L501" class="line" namn>
L501secss="line" namn>sec cla&.a href="+code=clocksource_mutex"6href="+co6e=cs" class="sref">cs./a6; 
L502" class="line" namn>
L502">6502./a>  6"lass="sr6line" namn>
L462">6462./6> 
L520"secondsl>
L523wss"co run bef   .acomment">         * too long if there'6="+code=l6st" class="sref">list./a6) 652130" c. F03"L457" id>
Lsl>
L523havasa8./sk " cla32bient"> * Update the watchdog after excep	  > c6e=suspend6 class="sref">suspend./a6) 6ed 548limitlass=511"t">   >6511.o3havasa8goolocksource_max_deferment - Returns max time t6ref="+cod6=cs" class="sref">cs./a>6; 
Lisions 10ne" utamn>
Lst="lia>65asontmp" c56" id>
L456" class="line" namn>
L456">6456" class="6ine" namn>
L466">6466./a6}  clent"at>6529./ cin>a shiff value520"249focla c56" id>
L456" class="line" namn>
L456">6456" max_cyc6line" namn>
L467">6467./6>  class=ine"L./sk " cl= 40.spa>.spf " cl= 4GHzent"at>mapss53 c56" id>
L456" class="line" namn>
L456">6456" sure we6class="comment">/**./spa6
  clfoclNTP.d>
Lappls="lins*./512.5a> cl c56" id>
L456" class="line" namn>
L456">6456e - resum6 the clocksource(s)./spa6
 as class487" ef">mutex_un4./a> .a hre(      * max_cycles < 1 << (63 - log26
	a>.spa>6class="comment"> */./spa6
  class="comment">/* Check if the watchdog6eref="+co6ocksource_resume./a>(voi6) sec claline" namn>
L505">6f">cs./a>->.a href="+code=mult" class="sres
L438" class="lines
="+c a href="+code=max_f">cs./a>->.a href="+code=mult" class="sres
L438" class="lines
="+c code" cla3o(&.a href="+code=clocksource_mutex"6
lass="sr6ine" namn>
L472">6472./a6{ 
L506" class="line" namn>
L506">6506secss="line" namn>sec cla>, &.a href="freq>
L436">6436./afreqL44"s&.a href="+code=clocksource_mutex"6
"+code=l6e=cs" class="sref">cs./a6; 
L506" class="line" namn>
L506">6506secss="line" namn>sec cla>, &.a href="scallss="line" namn>scallcycls&.a href="+code=clocksource_mutex"6
=suspend6line" namn>
L474">6474./6> 
L406" clasecss="line" namn>sec class="sref">clocksource_list./a>, .a hre6="+code=l6st" class="sref">list./a6) sec clalincs" class="sref">cs./a>->.a href="+c6ode=resum6" class="sref">resume./a6) 
oecss="line" namn>sec clal" cla600e=cs" =cs" e=cs" class="sref">cs./a>->.a href="+code=mult" class="sres
L438" class="lines
="+cl" cla=mult" class="sUINTpa> L438" class="liUINTpa>  class="sref">clocksource_list./a>, .a hre6= max_cyc6=cs" class="sref">cs./a>6; sec clalin600s" class="sref">cs./a>->.a href="+c6o sure we6line" namn>
L478">6478./6> 
L56">clockso6rce_resume_watchdog./a>(6; ilog2./a>(.a .c#L50_calc_>ult_shiff38">6438./a>        .a hre.a href="+code=clockso77">6477./a>        sref">ilog2./a>(.a href="+class="sref">list_for_ea">cs./a>->.a href="+code=mult" class="sshiff">ilog2./a>(.a shiff="+c>, &.a href="freq>
L436">6436./afreqL44",e=resume" class="sref">resume./a>(.a 6" class="6ine" namn>
L480">648"
	a6} 
L49scallss="line" namn>scallcycl>, &.a href="secss="line" namn>sec clal*, &.a href="scallss="line" namn>scallcycls&.a href="+code=clocksource_mutex"6"ref="+co6line" namn>
L481">6481./6> 
L46./a>.spa>6class="comment">/**./spa6
 
L502" class="line" namn>
L502">6502./a>  6ch_watchd6g - Update watchdog./spa6
 
Lsl53atlhavas
L539"hrefs,9538aime/c531" clas="comment">         * too long if there'6c" class=6 class="comment"> *./spa6
  class=ntp," namel/safe clextra8./rgin="comment">         * too long if there'6c"+code=l6h as kgdb so as not./spa6
          * too long if there'6cde=resum6ail when the kernel./spa6
  class="comment">/* Check if the watchdog6de which 6olds watchdog_lock../spa6
 cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=e                 ass="sref">un4./.spa> clasnlock" class="sref">mutex_un4./.spa> clascycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_mutex"6" sure we6class="comment"> */./spa6
  = 1ULL << (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+code=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=ass="ls./a> = 1ULL << (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+css="sref">clocksource_list./a>, .a hre6clocksour6e_touch_watchdog./a>(voi6) cs./a>->.a href="+code=mult" class="srref">ilog2./a>(.a href="+co-e=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=l" cla=mult" class="st;< (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+cssass="sref">unstable./a>, .a href="+code6" class="6ine" namn>
L490">6490./a6{ cs./a>->.a href="+code=mult" class="srref">ilog2./a>(.a href="+cocode" clincs" class="sref">cs./a>->.a href="+c6"ref="+co6rce_resume_watchdog./a>(6; list_for_ea">cs./a>->.a href="+code=mult" class="sshiff">ilog2./a>(.a shiff="+c--s" class="sref">cs./a>->.a href="+c6"/a>.spa>6ine" namn>
L492">6492./a6} cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=e                 ass="sref">un4./.spa> clasnlock" class="sref">mutex_un4./.spa> clascycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c6"h_watchd6line" namn>
L493">6493./6> 
L466./a>.spa>6class="comment">/**./spa6
 
L46."+code=l6x adjustment amount./spa6
 cs./a>->.a href="+code=mult" class="sref_idle_21="+code=u64" clref_idle_21ode=e                 ass="sref">un4./a> .a hrenlock" class="sref">mutex_un4./a> .a hrecycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c6"de=resum6nter to clocksource./spa6
 
L466.e which 6 class="comment"> *./spa6
  = 1ULL &l__ferment" cl_u485" freq_scallss="line" namn>_4ferment" cl_u485" freq_scallcyclu&.a href="+code=clocksource_ef="+c6" sure we6class="comment"> */./spa6
 
L57href="+co7e=cs" class="sref">cs./a7) 
L456" class="line" namn>
L456">6457" class="7ine" namn>
L500">6500./a7{ 
LsL456" id>
L456" class="line" namn>
L456">6457"2class="7ice_resume_watchdog./a>(7; 
L51.spa> class=548b">65gst"e clocksource_max_deferment - Returns max time t7     .spa7 class="comment">/*./spa7
 
Scallafact03">ultiplent">ga6"st freq=548ge n.spa> class=hzocksource_max_deferment - Returns max time t77; adjust7ents (110,000 ppm),./spa7
 /**./spa7
          * too long if there'7de=mult" 7lass="sref">mult./a> * 17;          * too long if there'7"7=mult" 7lter to clocksource./spa7;          * too long if there'7"8=mult" 7lclass="comment"> *./spa7; 
L508">6508./a7} 
L465gst"e _khz helplin class="ss="comment">         * too long if there'79" class=7line" namn>
L509">6509./7> /* Check if the watchdog79 class="7class="comment">/**./spa7
 6452./a_"ferment" cl_65gst"e _scallss="line" namn>_4ferment" cl_65gst"e _scallcycleode=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clockso>, &.a href=".c#L499" id>
L499" class="line" namn>
L49scallss="line" namn>scallcycl>, &.a href=".c#L499" id>
L499" class="line" namn>
L49freq>
L436">6436./afreqL44"sss="comment">/* Check if the watchdog792class="7rce ca> be deferred./spa7
 unstable./a>, .a href="+code7       Po7nter to clocksource./spa7
 
L473./a>.spa7 class="comment"> *./spa7
 .spref_idle_21 ispa> class="comment">/* Check if the watchdog795 adjust7class="comment"> */./spa7
 _4ferment" cl_u485" freq_scallcyclement./a>(struct6.a href="+code=clockso>, &.a href="scallss="line" namn>scallcycl>, &.a href="freq>
L436">6436./afreqL44"s&.a href="+code=clocksource_mutex"7href="+co7e=cs" class="sref">cs./a7) 
L516">6516./a7{ 
L=548="li.sco" id>
L=f">c ispa> class="comment">/* Check if the watchdog798=mult" 7ass="sref">max_cycles./a7; ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"78" class=7line" namn>
L518">6518./7> mutex_u" class="+code=u64" class="sref">u" classcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7     .spa7 class="comment">/*./spa7
 u" class int .a h="+code=u64" class="sref">u" class int .a hcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7  class="7 we ca> pass to the./spa7
 u5eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"7g a 64-bi7 signed result. The./spa7
 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7X/(cs->7mult+cs->maxadj)./spa7
 
L439" class="line" 7h is equi7alent to the below../spa7
 
L467(cs->m7lt + cs->maxadj)./spa7
  = 1ULL &l__ferment" cl_65gst"e _scallss="line" namn>_4ferment" cl_65gst"e _scallcycl(&.a href="+code=clocksource_mutex"7Xref="+co7 + cs->maxadj)))./spa7
 
L47cycles" c7t + cs->maxadj))./spa7
 
L456" class="line" namn>
L456">6457cs->mu7t + cs->maxadj))./spa7
 
LsL456" id>
L456" class="line" namn>
L456">6457lt of the7log2 to account for./spa7
 
L51.spa> class=548b">65gst"e clocksource_max_deferment - Returns max time t7e inequal7ty is satisfied a>d./spa7
          * too long if there'7> class="7omment">         */./spa7
 /* Check if the watchdog7adj" clas7="sref">maxadj./a>) + 1)7; 6452./aferment" cl_65gst"e nlock" class="sref">mutex_u65gst"e cycleode=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clocksosss="comment">/* Check if the watchdog7acs->m7line" namn>
L534">6534./7> 
L447     .spa7 class="comment">/*./spa7
  clasdf03"given"href/shiff ispa> class="comment">/* Check if the watchdog7as->mu7 the clocksource is./spa7
 cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=e                 ass="sref">un4./.spa> clasnlock" class="sref">mutex_un4./.spa> clascycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7f max_cyc7es a>d cs->mask../spa7
  = 1ULL <.a href="+code=clockso+code=ilog2" class="sref">ilog2./a>(.a href="+code=cs" class="sref">cs./a>->.a href="+code=mult" class="sref">mult./a> + .a href="+code=ass="ls./a> = 1ULL << (63 - (.a href="+code=ilog2" class="sref">ilog2./a>(.a href="+c,e=resume" class="sref">resume./a>(.a 7 s->mu7don't sleep for./spa7
  11a> cla> cl".spa> clas\n"pa> cla,e=resume" class="sref">resume./a>(.a 7 a large 7egative adjustment../spa7
 
L440">644"
	a7} 
L471" class=7line" namn>
L441">6441./7> 6511permit clafoclasis1.spa> class=ispa> class="comment">/* Check if the watchdog71 class="7KSOURCE_WATCHDOG */./spa7
 cs./a>->.a href="+code=mult" class="sref_idle_21="+code=u64" clref_idle_21ode=e                 ass="sref">un4./a> .a hrenlock" class="sref">mutex_un4./a> .a hrecycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_tchdog71dj" clas7line" namn>
L443">6443./7> cs./a7) ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7" class="7ine" namn>
L445">6445./a7{ mutex_u" class="+code=u64" class="sref">u" classcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7ref">CLOC7_SOURCE_IS_CONTINUOUS./a7) 
L444" class int .a h="+code=u64" class="sref">u" class int .a hcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7r max_cyc7SOURCE_VALID_FOR_HRES./a7; u5eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"7r sure we7ine" namn>
L448">6448./a7} 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"79" class=7line" namn>
L449">6449./7> 
L439" class="line" 7="+code=c7" class="sref">cs./a>) {7} 
L467=" class=7ume_watchdog./a>(void) {7}  = 1ULL <erment" cl_65gst"e nlock" class="sref">mutex_u65gst"e cycl(&.a href="+code=clocksource_mutex"79 class="7f">data./a>) { return 0;7} 
L473" class=7line" namn>
L453">6453./7> clocksource_max_deferment./a>(struct6.a href="+code=clockso>,namn>
L452">6452./a anamn="+code=u64" clref="+pa4"ss="sref">clocksource_list./a>, .a hre73ref="+co7KSOURCE_WATCHDOG */./spa7
 
L4473 class="7line" namn>
L455">6455./7> 6436./an>
L4del38">6438./a>        .a hre.a href="+code=clockso77">6477./a>        +code=clocksource_list" cla(&.a href="+code=clocksource_mutex"79ef">CLOC7class="comment">/**./spa7
 cs./a>->.a href="+code=mult" class="s anamn="+code=u64" clref="+pa4"                   anamn="+code=u64" clref="+pa4"&.a href="+code=clocksource_mutex"79 max_cyc7 the clocksource(s)./spa7
 u" class="+code=u64" class="sref">u" classcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7. sure we7class="comment"> */./spa7
 mutex_u5eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"7"sref">cl7cksource_suspend./a>(voi7) 
L487""+code=c7ine" namn>
L460">6460./a7{ 
L47href="+co7e=cs" class="sref">cs./a7; 
L456" class="line" namn>
L456">6457"lass="sr7line" namn>
L462">6462./7> hang_8="li6anamn ofia>65gst"e cl ksource_max_d56" id>
L456" class="line" namn>
L456">6457"" class=7st" class="sref">list./a7) 
L51.spa> class=548b">chang_locksource_max_deferment - Returns max time t7e=suspend7 class="sref">suspend./a7) new ref="+pa> class="comment">/* Check if the watchdog7ref="+cod7=cs" class="sref">cs./a>7; /* Check if the watchdog7" class="7ine" namn>
L466">6466./a7} 
L444chang_u6anamn="+code=u64" clferment" cl_chang_u6anamncycleode=clocksource_max_deferment" class="sref">clocksource_max_deferment./a>(struct6.a href="+code=clockso>,namn>
L452">6452./a anamn="+code=u64" clref="+pa4"ss="sref">clocksource_list./a>, .a hre7" max_cyc7line" namn>
L467">6467./7> 
L447" sure we7class="comment">/**./spa7
 ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7e - resum7 the clocksource(s)./spa7
 (struct6.a href="+code=clockso>, &.a href=" anamn="+code=u64" clref="+pa4"s&.a href="+code=clocksource_mutex"7e"+code=c7class="comment"> */./spa7
 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7eref="+co7ocksource_resume./a>(voi7) 
L487
lass="sr7ine" namn>
L472">6472./a7{  = 1ULL <erment" cl_chang_u6anamn="+code=u64" clferment" cl_chang_u6anamncycl(&.a href="+code=clocksource_mutex"7e" class=7e=cs" class="sref">cs./a7; 
L474">6474./7> 
L456" class="line" namn>
L456">6457="+code=l7st" class="sref">list./a7) 
L456" class="line" namn>
L456">6457ode=resum7" class="sref">resume./a7)  class=548b">un65gst"e _locksource_max_deferment - Returns max time t7= max_cyc7=cs" class="sref">cs./a>7; /* Check if the watchdog7o sure we7line" namn>
L478">6478./7> clocksource_max_deferment./a>(struct6.a href="+code=clocksosss="comment">/* Check if the watchdog7">clockso7rce_resume_watchdog./a>(7; 
L507" class="7ine" namn>
L480">648"
	a7} ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7"ref="+co7line" namn>
L481">6481./7> mutex_udeclass int .a h="+code=u64" class="sref">udeclass int .a hcycles./a> = 1ULL <.a href="+code=clocksou&.a href="+code=clocksource_ef="+c7./a>.spa>7class="comment">/**./spa7
 6436./an>
L4del38">6438./a>        .a hre.a href="+code=clockso77">6477./a>        +code=clocksource_list" cla(&.a href="+code=clocksource_mutex"7ch_watchd7g - Update watchdog./spa7
 mutex_u5eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"7c" class=7 class="comment"> *./spa7
 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"7c"+code=l7h as kgdb so as not./spa7
 
L467cde=resum7ail when the kernel./spa7
  = 1ULL <erment" cl_un65gst"e ="+code=u64" clferment" cl_un65gst"e cycl(&.a href="+code=clocksource_mutex"7c max_cyc7olds watchdog_lock../spa7
 
L57" sure we7class="comment"> */./spa7
 
L57clocksour7e_touch_watchdog./a>(voi7) 
L456" class="line" namn>
L456">6457" class="7ine" namn>
L490">6490./a7{ 
L456" class="line" namn>
L456">6457"ref="+co7rce_resume_watchdog./a>(7; 
L5unus_locksource_max_deferment - Returns max time t7"/a>.spa>7ine" namn>
L492">6492./a7} 
L493">6493./7> 
L5char buffe a548b">fiLled ine"L.spa> class=ist" cksource_max_deferment - Returns max time t7"" class=7class="comment">/**./spa7
          * too long if there'7."+code=l7x adjustment amount./spa7
          * too long if there'7"de=resum7nter to clocksource./spa7
 /* Check if the watchdog7.e which 7 class="comment"> *./spa7
 ilog2./a>(.a ssize_ff="kernel/time/clocksource.c#L518" id>
L57c sure we7class="comment"> */./spa7
 ilog2./a>(.a sysfs_show_kurrour4ferment" clscycleode=clocksource_max_dedeviclass="sref">clocdevicl_deferment./a>(structdevass="sref">clocdev="+c,e=resume" class="sref">resume./a>(.a 8href="+co8e=cs" class="sref">cs./a8) clocdevicl_attribloc_deferment./a>(structattrass="sref">clocattrckso>,char rment./a>(structbufass="sref">clocbufcksosss="comment">/* Check if the watchdog8" class="8ine" namn>
L500">6500./a8{ 
L508"2class="8ice_resume_watchdog./a>(8; ilog2./a>(.a ssize_ff="kime/clocksource.r> cl="+code=u64" clf> clpa4"   ksource.c#L439" id>
L439" class="line" 8     .spa8 class="comment">/*./spa8
 
L487; adjust8ents (110,000 ppm),./spa8
 ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"875 adjust8elass="comment">/**./spa8
  clpa4"   me/clocksource.snprnamfass="sref">clocsnprnamfcycles./a> = 1ULL &lbufass="sref">clocbufckso>, &.a href="PAGE_SIZEa href="+code=cPAGE_SIZEckso>, e/clocksourcodeamn>>"a> clm\n"pa> cla,ime/clocksource.rurr4ferment" cl="+code=u64" clfurr4ferment" clckso77">6477./a>        t../< (63 - (.a t../cksou&.a href="+code=clocksource_ef="+c8de=mult" 8lass="sref">mult./a> * 18; 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"8"7=mult" 8lter to clocksource./spa8; 
L48"8=mult" 8lclass="comment"> *./spa8;  clpa4"&.a href="+code=clocksource_mutex"8"9=mult" 8llass="comment"> */./spa8} 
L4689" class=8line" namn>
L509">6509./8> cs./a>->.a href="+c89 class="8class="comment">/**./spa8
 
L456" class="line" namn>
L456">645892class="8rce ca> be deferred./spa8
 
L456" class="line" namn>
L456">6458       Po8nter to clocksource./spa8
 
L5unus_locksource_max_deferment - Returns max time t83./a>.spa8 class="comment"> *./spa8
  */./spa8
 
L5*/./ ofi531"ridc Lsource_max_d56" id>
L456" class="line" namn>
L456">6458 e=mult" 8e=cs" class="sref">cs./a8) 
lenge"Lofibuffe _d56" id>
L456" class="line" namn>
L456">6458 7=mult" 8ine" namn>
L516">6516./a8{          * too long if there'898=mult" 8ass="sref">max_cycles./a8;          * too long if there'899=mult" 8line" namn>
L518">6518./8> 
ions="comment">         * too long if there'8     .spa8 class="comment">/*./spa8
 /* Check if the watchdog8  class="8 we ca> pass to the./spa8
 ilog2./a>(.a ssize_ff="ktme/clocksource.sysfs_531"ridc4ferment" cl">ilog2./a>(.a sysfs_531"ridc4ferment" clcycleode=clocksource_max_dedeviclass="sref">clocdevicl_deferment./a>(structdevass="sref">clocdev="+c,e=resume" class="sref">resume./a>(.a 8g a 64-bi8 signed result. The./spa8
 clocdevicl_attribloc_deferment./a>(structattrass="sref">clocattrckso>e=resume" class="sref">resume./a>(.a 8g      Po8mult+cs->maxadj)./spa8
 (structbufass="sref">clocbufckso>, &.a href="size_f">ilog2./a>(.a size_ff="kime/clocksource.r> cl="+code=u64" clf> clpa4"sss="comment">/* Check if the watchdog8h is equi8alent to the below../spa8
 
L508(cs->m8lt + cs->maxadj)./spa8
 ilog2./a>(.a size_ff="kime/clocksource.me/="+code=u64" clrelpa4"   me/clocksource.r> cl="+code=u64" clf> clpa4"&.a href="+code=clocksource_mutex"8Xref="+co8 + cs->maxadj)))./spa8
  class="comment">/* Check if the watchdog8 8=mult" 8t + cs->maxadj))./spa8
 
r> cl="+code=u64" clf> clpa4" " clinsizeofrce.c#L464" id>
531"ridc4t../< (63 - (.a 531"ridc4t../pa4"ssss="comment">/* Check if the watchdog8h9=mult" 8t + cs->maxadj))./spa8
 cs./a>->.a href="+c8e inequal8ty is satisfied a>d./spa8
  class="comment">/* Check if the watchdog8e a 64-bi8verflow will occur../spa8
 
bufass="sref">clocbufckso[ce.c#L464" id>
r> cl="+code=u64" clf> clpa4"-1] ==, e/clocksourcodeamn>>'\n'pa> classs="comment">/* Check if the watchdog8> class="8omment">         */./spa8
  clpa4"--s" class="sref">cs./a>->.a href="+c8adj" clas8="sref">maxadj./a>) + 1)8; 
L534">6534./8> ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"8     .spa8 class="comment">/*./spa8
 
r> cl="+code=u64" clf> clpa4" " cl 0sss="comment">/* Check if the watchdog8>8=mult" 8es a>d cs->mask../spa8
 ilog2./a>(.a hemcpycycles./a> = 1ULL &l531"ridc4t../< (63 - (.a 531"ridc4t../pa4">, &.a href="bufass="sref">clocbufckso>, &.a href="r> cl="+code=u64" clf> clpa4"s&.a href="+code=clocksource_mutex"8 9=mult" 8don't sleep for./spa8
 
r> cl="+code=u64" clf> clpa4"]   ksource.c#L439" id>
L439" class="line" 8 a large 8egative adjustment../spa8
 u5eln>
="+code=u64" class="sref">u5eln>
"+cod(&.a href="+code=clocksource_mutex"8" class="8ine" namn>
L440">644"
	a8} 
L481" class=8line" namn>
L441">6441./8> 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"81 class="8KSOURCE_WATCHDOG */./spa8
 
L481dj" clas8line" namn>
L443">6443./8> cs./a8) 
L468" class="8ine" namn>
L445">6445./a8{ CLOC8_SOURCE_IS_CONTINUOUS./a8) 
L456" class="line" namn>
L456">6458r max_cyc8SOURCE_VALID_FOR_HRES./a8; 
L456" class="line" namn>
L456">6458r sure we8ine" namn>
L448">6448./a8} 
L5unus_locksource_max_deferment - Returns max time t89" class=8line" namn>
L449">6449./8> cs./a>) {8} 
L5char buffe a548b">fiLled ine"L.spa> class=ist" cksource_max_deferment - Returns max time t8=" class=8ume_watchdog./a>(void) {8} data./a>) { return 0;8} 
L456" class="line" namn>
L456">64583" class=8line" namn>
L453">6453./8> /* Check if the watchdog83ref="+co8KSOURCE_WATCHDOG */./spa8
 ilog2./a>(.a ssize_ff="kernel/time/clocksource.c#L518" id>
L583 class="8line" namn>
L455">6455./8> ilog2./a>(.a sysfs_show_availtmp"4ferment" clscycleode=clocksource_max_dedeviclass="sref">clocdevicl_deferment./a>(structdevass="sref">clocdev="+c,e=resume" class="sref">resume./a>(.a 89ef">CLOC8class="comment">/**./spa8
 clocdevicl_attribloc_deferment./a>(structattrass="sref">clocattrckso>e=resume" class="sref">resume./a>(.a 89 max_cyc8 the clocksource(s)./spa8
 clocbufcksosss="comment">/* Check if the watchdog8. sure we8class="comment"> */./spa8
 
L508"sref">cl8cksource_suspend./a>(voi8) clocksource_max_deferment./a>(structsrcss="line" namn>srcpa4"&.a href="+code=clocksource_mutex"8""+code=c8ine" namn>
L460">6460./a8{ ilog2./a>(.a ssize_ff="kime/clocksource.r> cl="+code=u64" clf> clpa4"   ksource.c#L439" id>
L439" class="line" 8href="+co8e=cs" class="sref">cs./a8; 
L48"lass="sr8line" namn>
L462">6462./8> ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"8"" class=8st" class="sref">list./a8) ilog2./a>(.a n>
L4f03_each_ourrycycles./a> = 1ULL &lsrcss="line" namn>srcpa4"lass="sref">list_for_eaef">mutex_u+code=clocksource_laef">mutex_u+codckso>, &.a href="+code=clocksource_list" cla(ass="sref">unstable./a>, .a href="+code8e=suspend8 class="sref">suspend./a8) 
L502" class="line" namn>
L502">6502./a>  8ref="+cod8=cs" class="sref">cs./a>8; 
L456" class="line" namn>
L456">6458" class="8ine" namn>
L466">6466./a8} 
L456" class="line" namn>
L456">6458" max_cyc8line" namn>
L467">6467./8>  class="comment">/* Check if the watchdog8" sure we8class="comment">/**./spa8
 clocel/k_oneshot_mef=_activl"+cod( ||ss="comment">/* Check if the watchdog8e - resum8 the clocksource(s)./spa8
 srcpa4"77">6477./a>        flags">ilog2./a>(.a flagspa4" "s="sime/clocksource.CLOCK_SOURCE_VALID_FOR_HRES">ilog2./a>(.a CLOCK_SOURCE_VALID_FOR_HRESpa4"ssss="comment">/* Check if the watchdog8e"+code=c8class="comment"> */./spa8
  clpa4" +  me/clocksource.snprnamfass="sref">clocsnprnamfcycles./a> = 1ULL &lbufass="sref">clocbufcksoode=cs" class="sref> cl="+code=u64" clf> clpa4">e=resume" class="sref">resume./a>(.a 8eref="+co8ocksource_resume./a>(voi8) ilog2./a>(.a ssize_ff="k)s./a> = 1ULL &lPAGE_SIZEa href="+code=cPAGE_SIZEcksoo-e=cs" class="sref> cl="+code=u64" clf> clpa4">kes./a> = 1ULL &lssize_f">ilog2./a>(.a ssize_ff="k)0)>e=resume" class="sref">resume./a>(.a 8elass="sr8ine" namn>
L472">6472./a8{ srcpa4"77">6477./a>        t../< (63 - (.a t../cksou&.a href="+code=clocksource_ef="+c8e" class=8e=cs" class="sref">cs./a8; 
L468
=suspend8line" namn>
L474">6474./8> 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"8="+code=l8st" class="sref">list./a8) resume./a8)  clpa4" +  me/clocksource.snprnamfass="sref">clocsnprnamfcycles./a> = 1ULL &lbufass="sref">clocbufcksoode=cs" class="sref> cl="+code=u64" clf> clpa4">e=resume" class="sref">resume./a>(.a 8e max_cyc8=cs" class="sref">cs./a>8; ilog2./a>(.a ssize_ff="k)s./a> = 1ULL &lPAGE_SIZEa href="+code=cPAGE_SIZEcksoo-e=cs" class="sref> cl="+code=u64" clf> clpa4">kes./a> = 1ULL &lssize_f">ilog2./a>(.a ssize_ff="k)0)>i e/clocksourcodeamn>>"\n"pa> cla(&.a href="+code=clocksource_mutex"8= sure we8line" namn>
L478">6478./8> 
L58">clockso8rce_resume_watchdog./a>(8;  clpa4"&.a href="+code=clocksource_mutex"8" class="8ine" namn>
L480">648"
	a8} 
L468"ref="+co8line" namn>
L481">6481./8> 
L48./a>.spa>8class="comment">/**./spa8
 
L502">6502./a>  8ch_watchd8g - Update watchdog./spa8
 
L502">6502./a>  8c=suspend8 class="comment"> *./spa8
 /* Check if the watchdog8c"+code=l8h as kgdb so as not./spa8
  = 1ULL &lkurrour4ferment" cl="+code=u64" clfurrour4ferment" clpa4">k0644,ime/clocksource.sysfs_show_kurrour4ferment" cls">ilog2./a>(.a sysfs_show_kurrour4ferment" clscycl>e=resume" class="sref">resume./a>(.a 8cde=resum8ail when the kernel./spa8
 ilog2./a>(.a sysfs_531"ridc4ferment" clcycl(&.a href="+code=clocksource_mutex"8c max_cyc8olds watchdog_lock../spa8
 
L58" sure we8class="comment"> */./spa8
  = 1ULL &lavailtmp"4ferment" class="sref">clocavailtmp"4ferment" clpa4">k0444,ernel/time/clocksource.c#L518" id>
L58clocksour8e_touch_watchdog./a>(voi8) ilog2./a>(.a sysfs_show_availtmp"4ferment" clscycl,ime/clocksource.NULLe" class="sref"NULLcycl(&.a href="+code=clocksource_mutex"8" class="8ine" namn>
L490">6490./a8{ 
L48"ref="+co8rce_resume_watchdog./a>(8; clocbus_typlf="kime/clocksource.rss="sref">u5ubsys="+code=u64" class="sref">u5ubsyspa4"   ss="sref">unstable./a>, .a href="+code8"/a>.spa>8ine" namn>
L492">6492./a8}  cla,e=resume" class="sref">resume./a>(.a 8"h_watchd8line" namn>
L493">6493./8>  cla,e=resume" class="sref">resume./a>(.a 8"=suspend8class="comment">/**./spa8
 clocdevicl_defecksource_max_dedevicl_ferment" class="sref">clocdevicl_ferment" clpa4"   ss="sref">unstable./a>, .a href="+code8" max_cyc8 class="comment"> *./spa8
 clocidf="kernel= 0,e=resume" class="sref">resume./a>(.a 8" sure we8class="comment"> */./spa8
 clocbusf="kerne=ass="sref">list_for_eaef">mutex_u5ubsys="+code=u64" class="sref">u5ubsyspa4",e=resume" class="sref">resume./a>(.a 9href="+co9e=cs" class="sref">cs./a9) 
L500">6500./a9{ 
L49"2class="9ice_resume_watchdog./a>(9; 6452./a__inil="+code=u64" cl__inil_defecksource_max_deinil_ass="sref">u5ysfsass="sref">clocinil_ass="sref">u5ysfscycleernesss="comment">/* Check if the watchdog9     .spa9 class="comment">/*./spa9
 unstable./a>, .a href="+code97; adjust9ents (110,000 ppm),./spa9
 6452./a1"rorass="sref">cloc1"rorckso =, e/clocksource.subsysu5ystem_65gst"e nlock" class="ssubsysu5ystem_65gst"e 38">6438./a>        .a href="+code=mu5ubsys="+code=u64" class="sref">u5ubsyspa4",ime/clocksource.NULLe" class="sref"NULLcycl(&.a href="+code=clocksource_mutex"975 adjust9elass="comment">/**./spa9
 cloc1"rorcksosss="comment">/* Check if the watchdog9 7 adjust9eter to clocksource./spa9; 6452./a1"rorass="sref">cloc1"rorckso =, e/clocksource.devicl_65gst"e nlock" class="sdevicl_65gst"e 38">6438./a>        .a hrdevicl_ferment" class="sref">clocdevicl_ferment" clpa4"(&.a href="+code=clocksource_mutex"978 adjust9eclass="comment"> *./spa9; cloc1"rorcksosss="comment">/* Check if the watchdog9 9 adjust9elass="comment"> */./spa9} 6452./a1"rorass="sref">cloc1"rorckso =, e/clocksource.devicl_create_fillss="line" namn>devicl_create_fill38">6ss="comment">/* Check if the watchdog99" class=9line" namn>
L509">6509./9> clocdevicl_ferment" clpa4",e=resume" class="sref">resume./a>(.a 99 class="9class="comment">/**./spa9
 cloc1"rorcksosss="comment">/* Check if the watchdog9       Po9nter to clocksource./spa9
 cloc1"rorckso =, e/clocksource.devicl_create_fillss="line" namn>devicl_create_fill38">6ss="comment">/* Check if the watchdog99; adjust9 class="comment"> *./spa9
 clocdevicl_ferment" clpa4",e=resume" class="sref">resume./a>(.a 995 adjust9class="comment"> */./spa9
 clocdev_attr_availtmp"4ferment" clpa4"(&.a href="+code=clocksource_mutex"996 adjust9e=cs" class="sref">cs./a9) cloc1"rorckso&.a href="+code=clocksource_mutex"997 adjust9ine" namn>
L516">6516./a9{ 
L46998=mult" 9ass="sref">max_cycles./a9; 
L5999=mult" 9line" namn>
L518">6518./9> 6436./adevicl_inilcallcycles./a> = 1ULL &linil_ass="sref">u5ysfsass="sref">clocinil_ass="sref">u5ysfscycl(&.a href="+code=clocksource_mutex"9     .spa9 class="comment">/*./spa9
  class="comment">/* Check if the watchdog9  class="9 we ca> pass to the./spa9
 
L49g a 64-bi9 signed result. The./spa9
 
L456" class="line" namn>
L456">6459g      Po9mult+cs->maxadj)./spa9
 
L456" class="line" namn>
L456">6459g; adjust9alent to the below../spa9
 
L456" class="line" namn>
L456">6459g5 adjust9lt + cs->maxadj)./spa9
          * too long if there'9Xref="+co9 + cs->maxadj)))./spa9
          * too long if there'9 8=mult" 9t + cs->maxadj))./spa9
 /* Check if the watchdog9h9=mult" 9t + cs->maxadj))./spa9
 6452./a__inil="+code=u64" cl__inil_defecksource_max_deboot_531"ridc4ferment" class="sref">clocboot_531"ridc4ferment" clcyclechar*, e/clocksource.strass="sref">clocstrcksosss="comment">/* Check if the watchdog9lt of the9log2 to account for./spa9
 
L509e inequal9ty is satisfied a>d./spa9
 ilog2./a>(.a hr" na.a h"+codss="sref">list_for_each_entry./atex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"9e a 64-bi9verflow will occur../spa9
 
strass="sref">clocstrcksosss="comment">/* Check if the watchdog9l      Po9omment">         */./spa9
 ilog2./a>(.a strlcpycycles./a> = 1ULL &l531"ridc4t../< (63 - (.a 531"ridc4t../pa4">, &.a href="strass="sref">clocstrckso,nsizeofrce.c#L464" id>
531"ridc4t../< (63 - (.a 531"ridc4t../pa4"ss&.a href="+code=clocksource_mutex"9e; adjust9="sref">maxadj./a>) + 1)9; 
L438" class="line" namn>
L438">6438./a>        .a href="+code=mutex_unlock" class="sref">mutex_unlock./a>(&.a href="+code=clocksource_mutex"9acs->m9line" namn>
L534">6534./9> /*./spa9
 
L469as->mu9 the clocksource is./spa9
 
L49>8=mult" 9es a>d cs->mask../spa9
 6452./a__se/cp="+code=u64" cl__se/cpcyclese/clocksourcodeamn>>" .a href="+="pa> cla,ime/clocksource.boot_531"ridc4ferment" class="sref">clocboot_531"ridc4ferment" clcycl(&.a href="+code=clocksource_mutex"9a9=mult" 9don't sleep for./spa9
 
L59 a large 9egative adjustment../spa9
 
L456" class="line" namn>
L456">6459" class="9ine" namn>
L440">644"
	a9} ompnelbility layer=f03"deprecatedsboot op
ionL456" id>
L456" class="line" namn>
L456">6459" a 64-bi9line" namn>
L441">6441./9> 
L456" class="line" namn>
L456">64591 class="9KSOURCE_WATCHDOG */./spa9
 
L456" class="line" namn>
L456">64591; adjust9line" namn>
L443">6443./9> cs./a9) 
L445">6445./a9{ /* Check if the watchdog9ref">CLOC9_SOURCE_IS_CONTINUOUS./a9) 6452./a__inil="+code=u64" cl__inil_defecksource_max_deboot_531"ridc4fermeass="sref">clocboot_531"ridc4fermecyclechar*, e/clocksource.strass="sref">clocstrcksosss="comment">/* Check if the watchdog9r max_cyc9SOURCE_VALID_FOR_HRES./a9; 
L449r sure we9ine" namn>
L448">6448./a9}  = 1ULL &lstrass="sref">clocstrckso,nse/clocksourcodeamn>>"pmtmr"pa> cla((ass="sref">unstable./a>, .a href="+code99" class=9line" namn>
L449">6449./9> clocprnamecyclese/clocksourcodeamn>>"Warnamn2"g if =pmtmr is"deprecated. "pa> clas="sref">unstable./a>, .a href="+code99 class="9" class="sref">cs./a>) {9}  cla(&.a href="+code=clocksource_mutex"9=" class=9ume_watchdog./a>(void) {9} clocboot_531"ridc4ferment" clcycleme/clocksourcodeamn>>"acpi_pm"pa> cla(&.a href="+code=clocksource_mutex"9= class="9f">data./a>) { return 0;9} 
L4693" class=9line" namn>
L453">6453./9> clocprnamecyclese/clocksourcodeamn>>"Warnamn! g if =sboot op
ion is"deprecated. "pa> clas="sref">unstable./a>, .a href="+code99cs->m9KSOURCE_WATCHDOG */./spa9
  cla(&.a href="+code=clocksource_mutex"9=ref="+co9line" namn>
L455">6455./9> clocboot_531"ridc4ferment" clcycleme/clocksource.strass="sref">clocstrcksos&.a href="+code=clocksource_mutex"9=ef">CLOC9class="comment">/**./spa9
 
L4699 max_cyc9 the clocksource(s)./spa9
 
L59. sure we9class="comment"> */./spa9
 >" .a h="pa> cla,ime/clocksource.boot_531"ridc4fermeass="sref">clocboot_531"ridc4fermecycls&.a href="+code=clocksource_mutex"9"sref">cl9cksource_suspend./a>(voi9) 
T"lioriginal LXR software by ="limp;.a hrehttp://rce_muf03ge.net/projects/lxr">LXR ocksunilyckso,nthis"experisoural 31"sion by mp;.a hremailto:lxr@speux.no">lxr@speux.nockso.
lxr.speux.no kindly hostedsbyimp;.a hrehttp://www.redpill-spepro.no">Redpill Lpepro ASckso,nprovidcrLofiLpeuxico"sul"amn and opera ions,servicls,sincla1995.