linux/drivers/cpuidle/coupled.c
<<
>>
v2.6.31 > v2.v2.6.31 > v2.v2.6.31 > b 7mreturn doalue="v(this); class="lxnput typ hidden" nam navtarge6.3 Sv2.6. x/g1 s2.> /*12 x/g2 s2.> * > s to en er the sam /spa x/g3 s2.> *12 x/g4 s2.> * Copyion=" (c) 2011 Google, Inc.12 x/g5 s2.> *12 x/g6 s2.> * Au r: Conin Cross <ccross@androipanom="6>12 x/g7 s2.> *12 x/g8 s2.> * This program is frea oftware; you c redistribut /t and/or modify12 x/g9 s2.> * /t under the erms of the GNU General Public License as published by12 x/n va2.> * the Frea Software Founda > ; either > 2 of the License, or12 x/11 s2.> * (at your /drive) any later > .12 x/12 s2.> *12 x/13 s2.> * This program is distribut d in the hope hat /t will be useful, but WITHOUT12 x/14 s2.> * ANY WARRANTY; wi ut even the impli d warranty of MERCHANTABILITY or12 x/15 s2.> * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for12 x/16 s2.> * more details.12 x/17 s2.> */12 x/18 s2.i x/19 s2.#include <" alt/kernel.h s2.="6>i x/20 s2.#include <" alt/ <.h s2.="6>i x/21 s2.#include <" alt/ x/22 s2.#include <" alt/mut x.h s2.="6>i x/23 s2.#include <" alt/sched.h s2.="6>i x/24 s2.#include <" alt/slab.h s2.="6>i x/25 s2.#include <" alt/spinlock.h s2.="6>i x/26 s2.i x/27 s2.#include " x/28 s2.i x/29 s2.> /**12 x/3 va2.> * DOC: Co x/31 s2.> *12 x/32 s2.> * On ome ARM SMP SoCs (OMAP4460, Tegra 2, and probably more), the12 x/33 s2.> * x/34 s2.> * sequencing restri1 > s ( Tegra 2, < 0 must be the x/35 s2.> * power down), or due to HW bugs ( OMAP4460, a < powering up12 x/36 s2.> * will corrupt the gic x/37 s2.> * around). Each < has a power x/38 s2.> * coordinating wi the other < (usually Wa/t For In errupt, or12 x/39 s2.> * WFI), and one or more "> x/4 va2.> * shared between the x/41 s2.> * ometimes the whola SoC). En ering a > x/42 s2.> * be ton="ly controlled on both x/43 s2.> *12 x/44 s2.> * This file implemen s a solu > , where each < will wa/t in the12 x/45 s2.> * WFI x/46 s2.> * which poin the will be called on all12 x/47 s2.> * c x/48 s2.> *12 x/49 s2.> * Once all c x/5 va2.> * cross call. A this poin , there is a chance hat one of the12 x/51 s2.> * c x/52 s2.> * final popt is needed to guarantee hat all c x/53 s2.> * power at the sam time. During this popt,12 x/54 s2.> * each < will incremen the ready > n er, and continue31 ce he12 x/55 s2.> * ready > n er m x/56 s2.> * < exi s /spa, the other n er and12 x/57 s2.> * retry.12 x/58 s2.> *12 x/59 s2.> * requested_ x/6 va2.> * is ready for. It is assumed that the s x/61 s2.> * hallowest (hon=est power, lowest exi latency) to deepest12 x/62 s2.> * (lowest power, hon=est exi latency). The requested_ x/63 s2.> * variable is not lockspa It is onny written from the < that12 x/64 s2.> * i stores (or by the on/offnining < if that < is offnine),12 x/65 s2.> * and onny read af er all the c x/66 s2.> * x/67 s2.> *12 x/68 s2.> * Threa atomic > n ers are usspa al"><_> n tracks the number12 x/69 s2.> * of c x/7 va2.> * onninea wa/ting_> n tracks the number of c x/71 s2.> * the wa/ting loop, in the ready loop, or in the x/72 s2.> * ready_> n tracks the number of c x/73 s2.> * or in the x/74 s2.> *12 x/75 s2.> * To uss x/76 s2.> *12 x/77 s2.> * Se struct x/78 s2.> * x/79 s2.> * aig part of the sam cluster. The > x/8 va2.> * et in the struct x/81 s2.> *12 x/82 s2.> * Se struct x/83 s2.> * x/84 s2.> *12 x/85 s2.> * Se CPUIDLE_FLAG_COUPLED in struct x/86 s2.> * x/87 s2.> *12 x/88 s2.> * Provide a ruct for each x/89 s2.> * hat affects multi is guaranteed to be12 x/9 va2.> * called on all c x/91 s2.> * hould ensure that the c x/92 s2.> * o abort 1 ce he fun1 > is called. The fun1 > hould return12 x/93 s2.> * wi in errupts ill disabled.12 x/94 s2.> */12 x/95 s2.i x/96 s2.> /**12 x/97 s2.> * ruct x/98 s2.> * @> x/99 s2.> * @requested_ x100 s2.> * @ready_wa/ting_> n s: combined > n of c x101 s2.> * @onnine_> n : > n of c x102 s2.> * @refcn : refere ce > n of c x103 s2.> * @preven : flag o preven > x104 s2.> */12 x105 s2. ruct tatright.+code= x106 s2. tatright.+code= x107 s2. in tatright.+code=requested_ requested_ [tatright.+code=NR_CPUS" NR_CPUS12a>];i x108 s2. tatright.+code=atomic_t" atomic_t s2. tatright.+code=ready_wa/ting_> n s" ready_wa/ting_> n s s2.;i x109 s2. in tatright.+code=onnine_> n " onnine_> n s2.;i x1n va2. in tatright.+code=refcn " refcn s2.;i x111 s2. in tatright.+code=preven " preven s2.;i x112 s2.};i x113 s2.i x114 s2.#define tatright.+code=WAITING_BITS" WAITING_BITS s2. 16i x115 s2.#define tatright.+code=MAX_WAITING_CPUS" MAX_WAITING_CPUS s2. (1 << tatright.+code=WAITING_BITS" WAITING_BITS s2.)i x116 s2.#define tatright.+code=WAITING_MASK" WAITING_MASK s2. (tatright.+code=MAX_WAITING_CPUS" MAX_WAITING_CPUS s2. - 1)i x117 s2.#define tatright.+code=READY_MASK" READY_MASK s2. (~tatright.+code=WAITING_MASK" WAITING_MASK s2.)i x118 s2.i x119 s2.#define tatright.+code=CPUIDLE_COUPLED_NOT_IDLE" CPUIDLE_COUPLED_NOT_IDLE s2. (-1)i x120 s2.i x121 s2. DEFINE_MUTEX s2.(tatright.+code= x122 s2. DEFINE_PER_CPU s2.( ruct tatright.+code= all_singpa_data" all_singpa_data s2., tatright.+code= x123 s2.i x124 s2.> /*12 x125 s2.> * The c x126 s2.> * __smp_ all_fun1 > _singpa wi the per < all_singpa_data ruct already12 x127 s2.> * in uss. This preven s a deadlock where two c x128 s2.> * call_singpa_data ruct to be available12 x129 s2.> */12 x13 va2. x131 s2.i x132 s2.> /**12 x133 s2.> * x134 s2.> * @dev: x135 s2.> * @a: atomic variable to hold the barrier12 x136 s2.> *12 x137 s2.> * No caller o this fun1 > will return from this fun1 > until all onnine12 x138 s2.> * c . Once any aller12 x139 s2.> * has returned from this fun1 > , the barrier is immedi x14 va2.> * reuss.12 x141 s2.> *12 x142 s2.> * The atomic variable a must be in/tializep o 0 before any < alls12 x143 s2.> * this fun1 > , will be re et o 0 before any < returns from this fun1 > .12 x144 s2.> *12 x145 s2.> * Must onny be called from wi in a > x146 s2.> * ( x147 s2.> *12 x148 s2.> * Provides full smp barrier semantics before and af er alling.12 x149 s2.> */12 x15 va2.void tatright.+code= dev s2., tatright.+code=atomic_t" atomic_t s2. *tatright.+code=a" a s2.)i x151 s2.{i x152 s2. in tatright.+code=n" n s2. = tatright.+code=dev" dev s2.-="6>1atright.+code= onnine_> n s2.;i x153 s2.i x154 s2. tatright.+code=smp_mb__before_atomic_inc" smp_mb__before_atomic_inc s2.();i x155 s2. tatright.+code=atomic_inc" atomic_inc s2.(tatright.+code=a" a s2.);i x156 s2.i x157 s2. while (tatright.+code=atomic_read" atomic_read s2.(tatright.+code=a" a s2.) < tatright.+code=n" n s2.)i x158 s2. tatright.+code= <_relax" <_relax s2.();i x159 s2.i x16 va2. if (tatright.+code=atomic_inc_return" atomic_inc_return122.(tatright.+code=a" a s2.) == tatright.+code=n" n s2. * 2) {i x161 s2. tatright.+code=atomic_set" atomic_ et122.(tatright.+code=a" a s2., 0);i x162 s2. return;i x163 s2. }i x164 s2.i x165 s2. while (tatright.+code=atomic_read" atomic_read s2.(tatright.+code=a" a s2.) > tatright.+code=n" n s2.)i x166 s2. tatright.+code= <_relax" <_relax s2.();i x167 s2.}i x168 s2.i x169 s2.> /**12 x17 va2.> * x171 s2.> * @dev: struct x172 s2.> * @drv: struct x173 s2.> * @ x174 s2.> *12 x175 s2.> * Returns true if the targe6 x176 s2.> */12 x177 s2.>atright.+code=bool" bool s2. tatright.+code= dev s2.,i x178 s2. ruct tatright.+code= drv s2., in tatright.+code= )i x179 s2.{i x18 va2. return tatright.+code=drv" drv s2.-="6>1atright.+code= [tatright.+code= ].tatright.+code=flags" flagsva2. & tatright.+code=CPUIDLE_FLAG_COUPLED" CPUIDLE_FLAG_COUPLED s2.;i x181 s2.}i x182 s2.i x183 s2.> /**12 x184 s2.> * x185 s2.> * @> x186 s2.> */12 x1span#3>x1span#3>x1span#WFI x1sUIDLE_FLAG_COitright.ht.code= =drv" atomic_read s2.(tatrigad>code=a" MAX_WAITING_CPUS s2. - 1)i ready_wa/ting_> n s s2.;i> x/9 va2.> 1 <1ptioco x/91 s2.> 1 <19t;"> x/92 s2.> 1 <1ptiocommen "> * o abort ight.t;"> x/93 s2.> 1 <1ptiocommen "> * wi in erru_parallel_barriek a noa < as ready12 x/94 s2.> 1 <1ptiocommen "> */12 x/95 s2.i *12 x/96 s2.> 1 <1ptiocommen ">/**12 n er s er, and continue31 r < ru s and co(ng.1thusop, in the r)ontinue3t.t;"> x/97 s2.> 1 <1ptiocommen "> * ruct iPock where race are wao. I >t.t;"> x/98 s2.> 1 <1ptiocommen "> * @> n er s er, h otherscpti nsby tjzep o allingatrigt.t;"> x/19 s2.#incl <1ptiocommen "> * @requested_ n er andlts and continue31 lvdivti all12 x100 s2.> 2 <2ptiocommen "> * @ready_wa/ting_o HWhat12 he impli goigh x101 s2.> 2 <2ptiocommen "> * @onnine_> n : atright.t;"> x102 s2.> 2 <2ptiocommen "> * @refcn : refert.t;"> x103 s2.> 2 <2ptiocommen "> * @preven : flag the tar0 n er andsucc < r sey, -EINVAL x104 s2.> 2 <2ptiocommen "> */12 t.t;"> x/95 s2.i *12 x106 s2. 2 2atrighn#WFI /a> x107 s2. 2 20code=bool" x1sUIDLE_FLAG_COitright.ht.ode= =drv" bool s2. tatrigight."> x1n va2. 2 2n tatright.+code=refcn " refcn s2.;i x111 s2. 2 21t;"> x112 s2.};2 n " al>bool s2. tatrigight.">de=dev" onnine_> n s2.;i |e=atomic_read" onnine_> n s2.;i ht.+code=WAITING_BITS" WAITING_BITS s2.)i< x113 s2.i<2trigh213 return;onnine_> n " .r>refcn s2.;ide=dev" _r < atomic_read s2.(tatrigad>_r < right+code ready_wa/ting_> n s s2.;i x114 s2.#d2fine 21tright.+code=========-a" MAX_WAITING_CPUS s2. - 1)i n " al>bool s2. tatrigight.">< x115 s2.#d2fine 21t;"> x116 s2.#d2fine 21 tatrigh.+code=drv" refcn s2.;id?r0 :=-a" x117 s2.#d2fine 21.t;"> x118 s2.i<2trigh2.t;"> x119 s2.#d2fine 21tiocommen ">/**12 x/20 s2.#inctrigh22tiocommen "> * x/21 s2.#incfor t22tiocommen "> * @dev: struct x122 s2. 2for t22tiocommen "> * @refcn : refert.t;"> x/23 s2.#inctrigh22tiocommen "> * @preven : flag the targe6 x/24 s2.#inc <2ptiocommen ">/*12 x/25 s2.#inc <2251span#WFI x1sUIDLE_FLAG_COitright.ht.ode= =drv" de=dev" atomic_read s2.(tatright.+code=+code ready_wa/ting_> n s s2.;i.+codecode=n" WAITING_BITS s2.)i x128 s2.> 2 <228 tatrigh.+code=drv" de= 0 x129 s2.> 2 <2ptioco x13 va2. 2for t23t;"> x131 s2.i<2trigh23tiocommen "> * @dev: structight.t;"> x132 s2.> 2 <2ptiocommen ">/**12 x133 s2.> 2 <2ptiocommen "> * x134 s2.> 2 <2ptiocommen "> * @dev: x135 s2.> 2 <2ptiocommen "> * @a: atomic va the targe6 x136 s2.> 2 <2ptiocommen "> *12 x137 s2.> 2 <23x1span#WFI x1sUIDLE_FLAG_COitright.ht.bool" bool s2. tatright.+code= =drv" de=dev" atomic_read s2.(tatright.+code=+code ready_wa/ting_> n s s2.;i.+codecode=n" WAITING_BITS s2.)i x14 va2.> 2 <24turn tatright.+code=drv" de= atomic_read" onnine_> n s2.;i x141 s2.> 2 <24.t;"> x142 s2.> 2 <24t;"> x143 s2.> 2 <2ptiocommen "> * this fun1 > ight.t;"> x144 s2.> 2 <2ptiocommen "> *12 x145 s2.> 2 <2ptiocommen "> * Must onny be ca x146 s2.> 2 <2ptiocommen "> * ( x147 s2.> 2 <2ptiocommen "> *12 x148 s2.> 2 <2ptiocommen "> * Provides full ht.t;"> x149 s2.> 2 <2ptiocon#WFI x1sUIDLE_FLAG_COitright.ht.bool" bool s2. tatright.+code= =drv" de=dev" atomic_read s2.(tatright.+code=+code ready_wa/ting_> n s s2.;i.+ccode=CPUIDLE_FLAG_COWAITING_MASK s2.)i x152 s2. 2 2n tatright.+crv" de= atomic_read" onnine_> n s2.;i x/95 s2.ix137 s2nine31f L182312x142 s2. 2tatright.+code=smp_mb__b2fore_2531id L16531 x165 22. 2tatright.+code=atomic_in2" x144 s2.i n er s er, and continue31 ight.+code= x145 s2. 2while (tatright.+code=at2mic_r25 the targe6 x146 s2. 2 tatright.+code= 2<_rel25t.t;"> x146 s2.> 2 n er andlts and coet n> x/24 s22. 2if (tatright.+code=atomi2_inc_26s_ x149 s2. 2 tatright.+code=a2omic_26tio.ref">DEFINE_MUTEX s2.(tt.ode= =drv" <2a> x151 s2. 2}i 2de=dev" atomic_read s2.(tatright.+code=+code ready_wa/ting_> n s s2.;i.+ccode=CPUIDLE_FLAG_COWAITING_MASK s2.)i x152 s2.i de= atomic_read" x129 s2. 2while (tatright.+code=at2mic_r2ad" < L182312x142 s2. 2 tatright.+code= 2<_rel2631id L15731 x157 22.}i <2pan#L26 the targe6 x144 s2.i - determ deepest 7031id L170312x144 s2.> 2 /**12 x146 s2.> 2optiocommen "> * x146 s2.> 2optiocommen "> * @dev: s2ruct 2 x146 s2. 2optiocommen "> * @drv: s2ruct 2 deepest ;">sp watrightwi y ">x/97 s22.> 2optiocommen "> * @ *12ef">DEFINE_MUTEX s2.(tt.ode= dev s2.,i x178 22.> 2optiocommen "> * Returns2true 27d" =drv" */12x127 s2.>atrigh2.+code=bool" bool27fe"refcn s2.;ide=dev" i x152 s2. 2 ruct tatright.+code= 2/spa_2;">)i x152 s2.> 2 <2pan#L2731id L16031 x16 v22. 2return tatright.+code=dr2" drv s x125 22.}i <2pan#L28 2531id L12531 x125 22. 2t.t;"> x174 22.> 2optiocommen ">/**12 x/24 s22.> 2optiocommen "> * x149 s2.> 2optiocommen "> * @> atomic_inc s2.(tatri>x115 s2.> 2optiocommen "> */12x157 2#3>x1span23>x1span#WFI atomic_inc s2.(tatri de=dev" i n " n s" ready_wa/te= n " n s"pa_de31id L179312x15 va.> 1 21ptioco <2pan#L28" <_re.ref">atomic_inc_relleko.ode= de=dev" i WAf">WAITING_MASK s2.)it.+code=onnine_> n " n s" ready_wa/tina>[tatright.+code=NR_CPUS" NR_CPUS12a>];i x179 2.> 1 218 tatright.+catomic_re2d" <2ptio.rad>atomiiiiiiiiiiiiiiiiii n " n s" ready_wa/tina>[tatright.+code=NR_CPUS" NR_CPUS12a>];ix115 s.> 1 21ptioco <2pan#L2931id L121312x131 s.> 1 219t;"> de= atomi/a> x115 s.. 21ptiocommen "> * o a2ort i2ht.t;" L182312x142 s.> 1 21ptiocommen "> * wi 2in er2931id L15431 x154 2.> 1 21ptiocommen "> */12ef">DEFbarrier" x179 2.i *12 L180312x127 s.> 1 21ptiocommen ">/**12refcnarrienoight. < a x115 s.3>x1span21ptiocommen "> * ruct 2 atomic_inc s2.(tatricokad_maclear_ de=dev" x115 s.> 1 21ptiocommen "> * @> n L182312x142 s.> 1 21ptiocommen "> * @reques2ed_ 2931id L16031 x16 v32.> 2 32ptiocommen "> * @ready_3a/tin3_o HWhat12x144 32.> 2 32ptiocommen "> * @onnine3> n 3 atright.t;"> x145 32.> 2 32ptiocommen "> * @refcn 3 refe3t.t;"> x146 32.> 2 32ptiocommen "> * @preven3: fla3 the tar0 x146 324> 2 32ptiocommen "> */12's>n> ;(.reit.t;">neit)8631id L186312x146 325> 2 329tiocommen "> *12 's>n> x146 326> 2 32ptiocommen ">/**12 n er s er, and continue31 pan#L7431id L7431 <2x102 32. 2 320code=bool" x1s30.t;"> x148 32. 2 320tioco <3pan#L30 c s one12spa,t.t;">x146 329 2 32ptiocommen "> * @reques3_> n30t.t;"> m thiwapa i/aa> x146 32. 2 32n tatright.+code=refcn3" neim 7431id L7431 <2x102 32. 2 321t;"> <18731id L187312x149 32.};2 3n " 312t;">ef">DEFbarrier" x179 32.i<2trig3213 return;onnine_> 3n " 3r>refc L180312x127 32.#d2fine321tright.+code=========-3" all_singpa_data s2., tatright.+code= 1atrighper_ de=dev" x115 32.#d2fine321t;"> x116 32.#d2fine321 tatrigh.+code=dr3" refcn.ref!c_inc s2.(tatricokad_made=dev" x179 32. 2 321.t;"> <3pan#L317o.ref">atomif">atomic_inc s2.(tatriall_singpa_data ruct alr;iall_singpa_data ruct alroptiotrt;">de=dev" n L182312x142 32.#d2fine321tiocommen ">/**12x16 v3.#inctrig322tiocommen "> * x144 3.#incfor 322tiocommen "> * @dev: s3ruct 3 x145 32. 2for 322tiocommen "> * @refcn 3 refe3t.t;"> x146 3.#inctrig322tiocommen "> * @preven3: fla3 the targe6 x146 3.#inc 32ptiocommen ">/*12 x146 3..#d2fine32251span#WFI x/95 s32.> 2 32ptioco <3pan#L32t.t;"> x137 32.> 2 322 tatright.+code=reque3ted_ 327t;">ef">DEFbarrier" x178 32.> 2 3228 tatrigh.+code=dr3" <_re.ref"> =drv" refcn s2.;i x162 32.i<2trig323tiocommen "> * @dev: s3ructi3331id L132312x112 32.> 2 32ptiocommen ">/**12bool s2. tatrigight.">de=de de=dev" ready_wa/te= n " n s"pa_de31id L179312x15 v32.> 2 32ptiocommen "> * <_re.ref">atomic_inc_relleeght. h othert.ght31idt!omic_read s2.(tatpaish WAf">WAITING_MASK s2.)itleko.ode= de=dev" _ eght. h othert.ght31id L179312x15 v32#inc 32ptiocommen "> * @dev: 3atomic_inc s2.(tatricok x115 32.> 2 32ptiocommen "> * @a: a3omic 33d" < L182312x142 32.> 2 32ptiocommen "> *12x157 32.> 2 323x1span#WFI x144 32.> 2 323tioco <3pan#L33 c paisn#L1n> span> x148 32.> 2 323 tatright.+code=onnin3_> n33t.t;"> x146 32.> 2 324turn tatright.+code=dr3" x146 32.> 2 324.t;"> <3pan#L34 ptio.rean> ; x146 32.> 2 324t;"> x/23 s32.> 2 32ptiocommen "> * this fu31 > i3ht.t;"> ptio.rea ;span> specifightwi ,8631id L186312x146 32.> 2 32ptiocommen "> *12sp watrightwi ya> x146 32.> 2 32ptiocommen "> * Must on3y be 3ax102 32.> 2 32ptiocommen "> * ( x137 32.> 2 32ptiocommen "> *12ef">DEFbarrier" s.thsx178 32.> 2 32ptiocommen "> * Provide3 full34" <_re.ref"> =drv" x15 v32.> 2 32ptiocon#WFI x18 v32.vo2d ta32ight.+ <3pan#L35io.r>refcn s2.;i c_read" L153312<5ptionin231nam L1153>x115 32.{i2atri325 tatright.+code=preve3 " <3531id L132312x112 32. 2 32n tatright.+crv" bool s2. tatrigight.">de=det.+code=onnine_> n " n s" ready_wa/tina>[tatright.+code=NR_CPUS" NR_CPUS12a>];i x115 32.> 2 3llel_nine31nam L1373>x337 s23531id L15431 x154 32. 3tatright.+code=smp_mb__b3fore_35io.ref"S" x125 32. 3tatright.+code=atomic_in3" <_rethIfvpaisniep t12span/ohen#L6span>n> x125 32.> 2 3t.t;"> n er s er, and continue3"> <_reth>sp pan>en#L6nwi ya> n> op31id L12531 x125 32.> 2 3while (tatright.+code=at3mic_r35 the targe6 <_rethen#L6sa>deeperhpan#L7 Taisn#ge6x125 32.> 2 3 tatright.+code= 3<_rel35t.t;"> <_rethex n> in#L6ruptt oop31id L12531 x125 32.> 2 3t.t;"> n er andlts and "> <_rethVAL x102 32. 3if (tatright.+code=atomi3_inc_36s_ <_ret431id L7431 <2x102 32.{i2atri3 tatright.+code=a3omic_36 aadritix102 32. 2 3 return;i<36p rigt.t;">x102 32.> 2 3}i 36t.t;"> x137 32.i c_read" tomic_read s2.(tatright.+inio.r2.-=_read" ready_wa/ting_> n s s2.;i.+ccode=CPUIDLE_FLAG_COWAITING_MASK s2.)i x152 32. 3while (tatright.+code=at3mic_r36io.ref">atomi.ref">atomic_inc_rec_read" onnine_> n s2.;i x15 v32. 3 tatright.+code= 3<_rel36io.re.r>refcnf">atomic_inc s2.(tatricok de=dev" x115 32.}i <3pan#L36831id L168312x118 32.i x119 32.> 2 3optiocommen ">/**12 x144 32.> 3optiocommen "> * s.thevics paisn#L1n> leav n> an#L7331id L7331 <2x148 32.> 3optiocommen "> * @dev: s3ruct 3 x146 32. 3optiocommen "> * @drv: s3ruct 3 x146 32.> 3optiocommen "> * @ *12 ptio.rea ;span> specifightwi .431id L7431 <2x102 32.> 3optiocommen "> * Returns3true 37t.t;"> x106 32.> 3optiocommen "> */12 s.thevicsx178 32.>atrigh3.+code=bool" bool377o.ref">atomif">atomi.ref"> =drv" <3pan#L37tio.rad>atomic/a> x125 32. 3return tatright.+code=dr3" <_ret r < ru ri2531id L12531 x125 32.> 3ht.t;"> <3pan#L38 s.thsOK. Wort12sase,isomi431id L7431 <2x102 32. 3t.t;"> /2x133 32.> 3optiocommen ">/**12 ">2x102 32.> 3optiocommen "> * x149 32.> 3optiocommen "> * @> atomic_inc s2.(tatriright.+dec_read" ready_wa/ting_> n s s2.;i.+ccode=CPUIDLE_FLAG_COx115 32.> 3optiocommen "> */12x157 3#3>x1span33>x1span#WFI atomic_inc s2.(tatrit.+code=onnine_> n " n s" ready_wa/tina>[tatright.+code=NR_CPUS" NR_CPUS12a>];ix152 3.> 1 31ptioco <3pan#L38d> n L182312x142 3.> 1 318 tatright.+catomic_re3d" <3831id L16031 x16 v3.> 1 31ptioco <3pan#L39s_ x144 3.> 1 319t;"> paisn#L1n> leav x136 3.. 31ptiocommen "> * o a3ort i39.t;"> x146 3.> 1 31ptiocommen "> * wi 3in er39 the targe6 x146 3.> 1 31ptiocommen "> */12 x146 3.i *12 s paisn#L1n> nollonger x125 3.> 1 31ptiocommen ">/**12 n er s er, and continue31 pan>n> x145 3.3>x1span31ptiocommen "> * ruct 3 n> x102 3.> 1 31ptiocommen "> * @> x149 3.> 1 31ptiocommen "> * @reques3ed_ 393>x1sUIDLE_Fbarrier" s.thdspaoptioarrienoight. < a =drv" * @ready_4a/tin40031id L180312x151 42.> 2 42ptiocommen "> * @onnine4> n 401o.ref">atomic_inc s2.(tatrit> s.thevicsde=dev" x115 42.> 2 42ptiocommen "> * @refcn 4 refe40>bool s2. tatrigight.">de=deright.+suide=dev" US s2. - 1)i n " al>bool s2. tat ready_wa/ting_> n s s2.;i.+ccode=CPUIDLE_FLAG_COx115 42.> 2 42ptiocommen "> * @preven4: fla40ne31f L182312x142 424> 2 42ptiocommen "> */12x165 425> 2 429tiocommen "> *12 x144 426> 2 42ptiocommen ">/**12 n er s er, and continue31 clear_pan#s - spin Ox125 42. 2 420code=bool" x1s40.t;"> x146 42. 2 420tioco <4pan#L40 c x146 429 2 42ptiocommen "> * @reques4_> n40t.t;"> in#L6ruptsa o sp UIDnht.t;x146 42. 2 42n tatright.+code=refcn4" x102 42. 2 421t;"> <431id L7431 <2x102 42.> 2 421 return;onnine_> 4n " 41.t;"> x,iso431id L7431 <2x102 42.> 2 4213 return;onnine_> 4n " 41 the targe6 2.-= x102 424> 2 421tright.+code=========-4" pa;">shoulo aapa pli o x102 425> 2 421t;"> x102 426> 2 421 tatrigh.+code=dr4" n er s er, and continue31 et s false, -EINTRhe e resched n>s pti<7431id L7431 <2x102 42. 2 421.t;"> <4pan#L41.t;"> x149 42.i<2trig42.t;"> nUIDLE_Farrienoight. < a clear_pan#soptioarrienoight. < a x15 v42.#d2fine421tiocommen ">/**12x18 v4.#inctrig422tiocommen "> * de=delocal_irq_enab3>eght. h othert.local_irq_enab3>optior L153312<5ptionin231nam L1153>x115 4.#incfor 422tiocommen "> * @dev: s4ruct 421o.ref">atomiwhila otrt;">de=dev" de=dev" x179 42. 2for 422tiocommen "> * @refcn 4 refe42>bool s2. tatf">atomic_inc s2.(tatrit> relax;ix115 4..> 2 422tiocommen "> * @preven4: fla423bool s2. tatrigight.">de=delocal_irq_disab3>eght. h othert.local_irq_disab3>optior L153312<5ptionin231nam L1153>x115 4.4> 2 42ptiocommen ">/*12x165 4..#d2fine42251span#WFI atomi s2.-="6wt;">de= atomi e resched de= atomiEINTR x129 42.> 2 42ptioco <4pan#L42t.t;" L182312x142 42.> 2 422 tatright.+code=reque4ted_ 427t;"> L182312x142 42.i<2trig4228 tatrigh.+code=dr4" x144 42.> 2 42ptioco <4pan#L42t.t;"> x125 42. 2for 423t;"> x146 42.i<2trig423tiocommen "> * @dev: s4ructi43plat x146 42. 2for 42ptiocommen ">/**12 ptio.rean> ;/span> x146 42.> 2 42ptiocommen "> * * @dev: 4ight.t;">x102 42.> 2 42ptiocommen "> * @a: a4omic 43 firt12pangd, pli o x146 42.> 2 42ptiocommen "> *12 n er s er, and continue31 o mahangpaFarro x/95 s42.> 2 423x1span#WFI ,pan> firt12csp pat;"data rtix/95 s42.i<2trig423tioco <4pan#L43 c in#L6medit;" s> ;(pli o's>saf" s> ),a o m> x/95 s42.> 2 423 tatright.+code=onnin4_> n43t.t;"> sp pan>en#L6nwi y/ohc>sp pat;"data r7 Ona> >sp watrightwi y x146 42.> 2 424turn tatright.+code=dr4" sp wi yx146 42.> 2 424.t;"> <4pan#L44">sp pan>ight.t_x102 42.> 2 424t;"> x/23 s42.> 2 42ptiocommen "> * this fu41 > i4ht.t;"> sped n>d7 I/amahaenab3>op1id L7431 <2optionine331nam L233>x/23 s42#inc 42ptiocommen "> *12m thialwaysi s2.-="n>x/23 s42.> 2 42ptiocommen "> * Must on4y be 4ax.431id L7431 <2x102 42.> 2 42ptiocommen "> * ( x137 42.> 2 42ptiocommen "> *12arrienoight. < a dev s2.,i x178 42.> 2 42ptiocommen "> * Provide4 full44" <_re.ref"> dtioni.,i r/span> )i x15 v42.> 2 42ptiocon#WFI x18 v42.vo2d ta42ight.+ <4pan#L45io.r>refcn s2.;i en#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r= -1 L153312x129 42.{i2atri425 tatright.+code=preve4 " <451o.ref">atomi.ref"> =drv" ready_wa/te= x129 42.> 2 42n tatright.+crv" bool L153312x129 42.> 2 4llel_nine31nam L1373>x437 s245span#L16431id.ref!c_inc s2.(tatric.+ x15 v42. 4tatright.+code=smp_mb__b4fore_45io.ref"S" atomi s2.-="-6wt;">de= atomiEINVAL x129 42.> 2 4tatright.+code=atomic_in4" x116 42.> 2 4t.t;"> refcnwhila otrt;">de=dev" .+code=onnine_> n " n s" ready_wa/tpreve n " prevex18 v42.> 2 4while (tatright.+code=at4mic_r457o.ref">atomif">atomi.ref">atomic_inc_rellespa_ clear_pan#soptioic_read s2.(tat ready_wa/te eght. h othert.ght31id L18031 x18 v42.> 2 4 tatright.+code= 4<_rel45" <_rebool s2. tatrigight.">de=delocal_irq_enab3>eght. h othert.local_irq_enab3>optior L153312<5ptionin231nam L1153>x12.> 2 4t.t;"> atomiiiiiiiiiiiiiiiiii<2.-="6wt;">de= atomi e#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r=or L153312<5ptionin231nam L1153>x12. 3i4 (tatright.+code=atomi3_4nc_36460.rad>atomiiiiiiiiiiiL182312x142 42.{i2atri3 4 tatright.+code=a3o4ic_36461.rad>atomiiiiiiiiiiitri.t;"> en#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r= -1oight. < a 1atright./span> x142 42.{ 2 42n return;i<3646ool s2. tatf">atomic_iiiiiiiitri.t;"> en/span> ready_wa/te f" s.t;"I x115 42.> 2 3}4 3646an#L16431id.rL182312x142 42.{ 4tat;"> x165 4.. 3w4ile (tatright.+code=at3m4c_r364o.ref">atomi.rsp gr have called#L17tad2 2.evex137 42. 3 4 tatright.+code= 3<4rel364o.re.r>refcnf"f">ready_wa/te farmix115 s24}i <3p4n#L3646;"> L182312x142 42.i refcnf"f">ready_wa/te a> s.thev/opti;i s.ths ready_wa/te eght. h othert.ght31id s2.-="6>1atright.+code=onnine_> n " n s" x115 s24} 2 4t.tiocommen ">/**12x16 v3.4> 3o4tiocommen "> * ready_wa/ting_tryht.t;">.+ccode=CPtry <:16031 x16 v3.4>i2atri3 4tiocommen "> * @dev: s3r4ct 3 471ref">atomi.rsp gr have called#L1731id L187312x137 42. 3o4tiocommen "> * @drv: s3r4ct 3 4/spa_d;">x137 42. 2 3}4tiocommen "> * @ *12x137 42.> 3o4tiocommen "> * Returns3t4ue 3747.ref">atomi.rila otr_inc s2.(tatricokad cle y v/opti;i s.e y v/opti;itiotrt;">de=dev" x18 v42.> 3o4tiocommen "> */12refcnf">atomic_ef">atomic_inc_rellespa_ clear_pan#soptioic_read s2.(tat ready_wa/te eght. h othert.ght31id L18031 x18 v42.>atrigh3.4code=bool" 4ool374o.ref">atomif">atomi.r>refcnf"f">ready_wa/te a> s.thevics s.thevicsde=dev" ready_wa/te eght. h othert.ght31id s2.-="6>1atright.+code=onnine_> n " n s" x115 s24 3 4ruct tatright.+code= 3/4pa_3747 <_rebool s2. tgotnd.-="6>1atright.ou r=or L153312<5ptionin231nam L1153>x12.> 2 3h4.t;"> <3p4n#L3747o.rad>atomiiiiiiiiiiiL182312x142 42. 3r4turn tatright.+code=dr3"4 x131 s.4> 3h4.t;"> <3p4n#L38481.rad>atomiiiiiiiiiiief">atomic_inc_rellecode=onnine_> n " n s" ready_wa/tpreve n " prevex18 v42. 3t4t;"> atomic_iiiiiiiitri.t;"> ena> s.thevics s.thevicsde=dev" ready_wa/te eght. h othert.ght31id s2.-="6>1atright.+code=onnine_> n " n s" x115 s24> 3o4tiocommen ">/**12 <_re.rol s2. tgotnd.-="6>1atright.ou r=or L153312<5ptionin231nam L1153>x12.> 3o4tiocommen "> * atomi sL182312x142 42. 3o4tiocommen "> * @> x116 42.> 3o4tiocommen "> */12refcnf">atomic_inc s2.(tatrico#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r= -1oight. < a 1atright./span> x142 42.>x1span334x1span#WFI atomif">atomi.r>refcnf"f">ready_wa/te /span> ready_wa/te f" s.t;"I x115 42. 1 314tioco <3p4n#L3848 L182312x142 42. 2 3h4 tatright.+catomic_re3d4 <3841id L16031 x16 v3.4 1 314tioco <3p4n#L3949.r>refcn s2.;f">atomic_inc_rellespa_ clear_pan#soptioic_read s2.(tat ready_wa/te eght. h othert.ght31id L18031 x18 v42. 1 314t;"> atomiiiiiiiiiiitri.t;"> ena> s.thevics s.thevicsde=dev" ready_wa/te eght. h othert.ght31id s2.-="6>1atright.+code=onnine_> n " n s" x115 s24 314tiocommen "> * o a3o4t i3949ool s2. tatf">atomic_gotnd.-="6>1atright.ou r=or L153312<5ptionin231nam L1153>x12. 1 314tiocommen "> * wi 3i4 er3949an#L16431id.rL182312x142 42. 1 314tiocommen "> */12x165 4.. *12atomi.rsp gr have called#L1731id L187312x137 42. 1 314tiocommen ">/**12 n er s er, and continue31 * A watrightwi y x137 42. x1span334tiocommen "> * ruct 3 4/sp394the targe6 cuct actnin Ispa.t;">/2<> x146 42. 1 314tiocommen "> * @> sp wi rightwi y opta gt.t;">/2eall; >sp31id L186312x146 42. 2 3h4tiocommen "> * @reques3e4_ 3949 n er andlts and "> <_rethVAcnue31clgt.t;">/2eall;m cansp>nabortm 74 o mahopa31id L186312x146 425> 2 425tiocommen "> * @ready_4a5tin4050 <_ret r seiL6nwip wi y/2eall;x/95 s425> 2 425tiocommen "> * @onnine4>5 n 4050spa_device for the urrenttttttttt"1n> x/95 s425>22 425tiocommen "> * o a3o5efe4050spa_d;">x137 425> 2 425tiocommen "> * @preven4:5fla4050id L15431 x154 325> 2 425tiocommen "> */12 c_a> s.thev s.thevde=dev" x125> 2 425tiocommen "> *12atomi.rila otr_inc s2.(tatricokad cle y v s.e y vde=dev" x18 v425> 2 425tiocommen ">/**12refcnf">atomic_ip gr have called#L17tChehenafnyya> L6nwi y/obaihtwi x137 425>72 425tiocommen "> * ruct 3 5x1s4050.ref">atomif">atomi.ref">_inc s2.(tatricokad cle y v/opti;i s.e y v/opti;itiotrt;">de=dev" x137 425>82 425tiocommen "> * @> <_rebool s2. tef">_inc s2.(tatricokad clthevics< s.thevics<de=dev" x137 425>92 425tiocommen "> * @reques3e5 n4050o.rad>atomiiiiiiiiiiiiiiiiii<<<<<<<<1atright.g_tryht.t;">.+ccode=CPtry x125 2 425 tatright.+code=refcn4"5 x131 s.5 2 425t;"> atomiiiiiiiiiiitri.t;"> ena> elax;ix115 4.5> 2 425 return;onnine_> 4n5" 41512n#L16431id.rL182312x142 425> 2 4253 return;onnine_> 4n5" 4151id L15431 x154 325> 2 425tright.+code=========-4"5 x137 425> 2 425t;"> atomic_inc s2.(tatririxtht.t;" s.t_ s.t_ 1atright./ x125> 2 425 tatrigh.+code=dr4"5 x157 3#5 2 425.t;"> <4p5n#L4151.ref">atomic_inc s2.(tatrit.#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r= -1oight. < a 1atright./span> x115 s25i<2trig425t;"> x119 325#d2fine425tiocommen ">/**12atomic_inc s2.(tatrit.a> s.thevpa;i s.thdspaoptioart;">de=dev" ready_wa/te eght. h othert.ght31id s2.-="6>1atright.+code=onnine_> n " n s" x115 s25inctrig425tiocommen "> * x131 s.5incfor 425tiocommen "> * @dev: s4r5ct 425o.ref".-="6>1atright.ou r=:16031 x16 v3.5 2for 425tiocommen "> * @refcn 4 5efe425bool s2. tatf"sp gr have called#L1731id L187312x137 425> 2 425tiocommen "> * @preven4:5fla4252the targe6 n#L1 x.431id L7431 <2x102 425> 2 425tiocommen ">/*12">#eadsoha> in#Lefficiencyrile/sdai panreceix102 425> 2 42551span#WFI <_rethIf;">">bm rigt6rupttdib x102 425> 2 425tioco <4p5n#L4252 n er s er, and continue31 * n> he #L6spata rtmuo maL x102 425> 2 425 tatright.+code=reque4t5d_ 4252he targe6 n/oh">rigproht.teo17031id L170312x145 3.5i<2trig4258 tatrigh.+code=dr4"5 <_rethIf;"d7 631id L186312x146 425> 2 425tioco <4p5n#L425.t;"> spa">n#L1 na stP etof31id L186312x146 425 2for 425t;"> x102 425i<2trig425tiocommen "> * @dev: s4r5cti435/spa_device for the urrent <_rethI1id L7431 <2x102 425i 2for 425tiocommen ">/**12 * * @dev: 4<5spa435_ x.431id L7431 <2x102 425> 2 425tiocommen "> * @a: a4o5ic 435ruct x137 425> 2 425tiocommen "> *12refcnf"f">ready_wa/te delocal_irq_enab3>eght. h othert.local_irq_enab3>optior L153312<5ptionin231nam L1153>x125> 2 425x1span#WFI L182312x142 425i<2trig425tioco <4p5n#L43538ol s2. tatf"sp gr have called#L1731id L187312x137 425> 2 425 tatright.+code=onnin4_5 n435.t;"> sp wi rightwi y opta x137 425> 2 425turn tatright.+code=dr4"5 cuussdisn#L1nue31c31id L187312x137 425><2trig425.t;"> <4p5n#L445ruct x102 425> 2 425t;"> x137 425> 2 425tiocommen "> * this fu415> i4h54an#L16431id.rila otr_inc s2.(tatricokad clnole y v s.nole y vde=dev" x137 425inc 425tiocommen "> *12atomi stri.t;"> ena> elax;ix115 4.5> 2 425tiocommen "> * Must on4y5be 4a54d L9631 <2x116 425> 2 425tiocommen "> * ( refcnf"2.-="6wt;">de= atomi e#L6tright.+code=NR_CPUS" en#L6tright.+o.r>r=or L153312<5ptionin231nam L1153>x125> 2 425tiocommen "> *12x118 325> 2 425tiocommen "> * Provide4 5ull4454id L119312x119 325> 2 425tiocon#WFI s.upd"I =drv" atomic_inc s2.(tatrit> <_ma=drv" inc s2.(tatrit> < sr>r=or L153312<5ptionin231nam L1153>x125> 2 425 tatright.+crv" de=derio.r_ma=drv" sr>r=s2.-="6>1atright.+ re er=s2sp s2.-="6>1atright.+code=onnine_> n " n s" ready_wa/tinan> s.e y nnine_> n " n s" LL y tior L153312<5ptionin231nam L1153>x115 4.5> 2 4l5el_nine31nam L1373>x435 s24555ool s2. tatrigight.">de=delo+code=onnine_> n " n s" ready_wa/tintright.t;"> =drv" sr>r= L153312<5ptionin231nam L1153>x115 4.5>nc 425tright.+code=smp_mb__b4f5re_455o.ref"L168312x118 325> 2 4t5tright.+code=atomic_in4"5 x116 425> 2 4t5t;"> x144 425> 2 4w5ile (tatright.+code=at4m5c_r4555he targe6 s.regis6ht. <- regis6htfp rightwi yspa">v s2.,ix144 425> 2 425 tatright.+code= 4<5rel4555c x146 425> 2 4t5t;"> 31id L186312x146 425 3i5 (tatright.+code=atomi3_5nc_3656 fromight.t;">regis6ht. rightwispa">inid IsFindsll;<31id L186312x146 425 i2atri425 tatright.+code=a3o5ic_3656uct x146 425 2 425 return;i<3656;"> x102 425> 2 3}5 3656t;"> x137 425{ 4t5t;"> s.regis6ht. tior ef"> dev s2.,i x15 v425 3w5ile (tatright.+code=at3m5c_r365o.ref"L180312x151 425 3 5 tatright.+code= 3<5rel365o.re.r>refcnf"rienoight. < a x115 4.5}i <3p5n#L3656.ref">atomic_ef"> dev s2.,i x115 4.5} 2 425t;"> refcnf"ef"> 1atright.+sonnine_> n " s1id L153312x129 425} 2 4t5tiocommen ">/**12atomic_ef"> =drv" * x131 s.5>i2atri3 5tiocommen "> * @dev: s3r5ct 3 571ref">atomi.r;f">atomic_inc_rellesp_ma _maready_wa/te= n " n s" LL y tior L179312x15 v425 3o5tiocommen "> * @drv: s3r5ct 3 57ool s2. tatf">atomic_2.-="6w L153312x129 425 2 3}5tiocommen "> * @ x154 325i *12 c_/sp_eachLL yL2.;ide=dev" ready_wa/te= n " n s" LL y tior L18031 x18 v425> 3o5tiocommen "> * Returns3t5ue 3757.ref">atomi.r c_aL6nw_/span> de=dev" dev s2., r=s2.-="6>1atright.+ rht. h othert.ght31id L153312<5ptionin231nam L1153>x115 4.5> 3o5tiocommen "> */12refcnf">atomic_ef">atomic_inc_rellaL6nw_/span> c_aL6nw_/span> ready_wa/te= x18 v425>i5ool375o.ref">atomif">atomi.r>refcnf"f">ready_wa/te a ready_wa/te= x115 4.5> 2 425ruct tatright.+code= 3/5pa_3757 <_rebool s2. tgotnd.-="6>1atright.optatright.t;">=drv" x115 4.5> 2 4t5.t;"> <3p5n#L3757o.rad>atomiiiiiiiiiiiL182312x142 425 3r5turn tatright.+code=dr3"5 refcn s2.L182312x142 425 i2atri3 5.t;"> <3p5n#L38581.rad182312x142 425 3o5t;"> x137 425> 3o5tiocommen ">/**12de=delo+code=onnine_> n " n s" n " kza woctior eizeof ef"> =drv" * x15 v425 3o5tiocommen "> * @> atomi.r de= atomiEINNOMEM x115 4.5> 3o5tiocommen "> */12x157 3#5>x1span335x1span#WFI atomic_inc s2.(tatrit.+code=onnine_> n " n s" ready_wa/tinan> s.e y nnine_> n " n s" LL y tiormic_read s2.(tat ready_wa/te= n " n s" LL y tiorL153312<5ptionin231nam L1153>x115 4.5> 2 425tioco <3p5n#L3858id L119312x119 325 2 3h5 tatright.+catomic_re3d5 <3851id L.-="6>1atright.optatright.t;">=drv" x16 v3.5 1 315tioco <3p5n#L3959ool s2. tatrigight.">de=delo/span> ready_wa/te= x115 4.5 1 315t;"> atomi.r;f">atomic_inc_rellWARN_ON _maready_wa/te= n " n s" LL y tiors2sp s2.-="6>1atright.+code=onnine_> n " n s" ready_wa/tinan> s.e y nnine_> n " n s" LL y tior L179312x15 v425 315tiocommen "> * o a3o5t i3959ool s2. tatf">atomic_.-="6>1atright.+code=onnine_> n " n s" ready_wa/tineve n " prevex115 4.5 3o5tiocommen "> * wi 3i5 er3959id L15431 x154 325 1 315tiocommen "> */12 c_a> s.upd"I s.upd"I x115 4.5 3o5tiocommen "> *12x116 425 1 315tiocommen ">/**12refcnf"f">ready_wa/te +code=onnine_> n " n s" ready_wa/tineadc=onnine_> n " preadc=oid ++L153312<5ptionin231nam L1153>x115 4.5 x1span335tiocommen "> * ruct 3 5/sp3959;"> L182312x142 425 1 315tiocommen "> * @> refcnf"f">ready_wa/te asonnine_> n " s1id -1sp s2.-="6>1atright.pnw_/eght. h othert.ghpnw_/egtiotrt;">de=dev" dean> s.n#so_catright.t;">dean> s.n#so_caid s2.-="6>1atright./span> ready_wa/te= rht. h othert.ght31id L153312<5ptionin231nam L1153>x115 4.5 2 3h5tiocommen "> * @reques3e5_ 39599ref">atomic_inc s2.(tatrit.asonnine_> n " s1id io.ref">ready_wa/te=ta dean> s.n#sot;">=drv" .n#sotid L153312<5ptionin231nam L1153>x115 4.6> 2 426tiocommen "> * @ready_4a6tin4060ool s2. tatrigight.">de=deloasonnine_> n " s1id io.ref">ready_wa/te=snfonnine_> n " snfo12 -1(rrier*)(unsigntwilong).-="6>1atright./span> ready_wa/te= rht. h othert.ght31id L153312<5ptionin231nam L1153>x115 4.6>12 426t;"> x142 426>22 426tiocommen "> * o a3o6efe4060ool s2. tatf"2.-="6w L153312x129 426> 2 426tiocommen "> * @preven4:6fla4060id LL182312x142 426> 2 426tiocommen "> */12x165 4.6> 2 426tiocommen "> *12x144 426> 2 426tiocommen ">/**12 s.unregis6ht. <- unregis6htfp rightwi yspa">v s2.,ix144 426>72 426tiocommen "> * ruct 3 6x1s4060he targe6 x146 426>82 426tiocommen "> * @> x146 426>92 426tiocommen "> * @reques3e6 n4060t;"> sCped n>fromight.t;">unregis6ht. rightwispa". Remoex146 426 2 426 tatright.+code=refcn4"6 fromil;net o i"fre s.snfoitix146 426 2 426t;"> isn#Lwa/al;< tha#L186span<12ecoi31id L7431 <2x102 426> 2 426 return;onnine_> 4n6" 4161;"> x137 426> 2 4263 return;onnine_> 4n6" 4161id Lrrier" s.unregis6ht. tior ef"> dev s2.,i x15 v426> 2 426tright.+code=========-4"6 x18 v426> 2 426t;"> atomic_ef"> =drv" ready_wa/te= x129 426> 2 426 tatrigh.+code=dr4"6 x157 3#6 2 426.t;"> <4p6n#L4161.ref">atomic_;f">atomic_inc_rellesp_ma _maready_wa/te= n " n s" LL y tior L179312x15 v426i<2trig426t;"> <_rebo2.-="6L153312x129 426>92 426tiocommen ">/**12x16 v3.6inctrig426tiocommen "> * refcn s2.;f">-wt;">de= atomiEI+code=onnine_> n " n s" ready_wa/tineadc=onnine_> n " preadc=oid L179312x15 v426incfor 426tiocommen "> * @dev: s4r6ct 42621.rad>atomiiiiiiiiiiitri.t;"> enkfre n " kfre x115 4.6 2for 426tiocommen "> * @refcn 4 6efe4262ool s2. tatrigight.">de=deri/span> ready_wa/te= x129 426> 2 426tiocommen "> * @preven4:6fla4262id LL182312x142 426> 2 426tiocommen ">/*12x165 4.6> 2 42651span#WFI x144 426> 2 426tioco <4p6n#L4262 n er s er, and continue31 a> s.eve-.evefromi#L6trsppa sL18ghtwi ;(31id L170312x144 426> 2 426 tatright.+code=reque4t6d_ 4262he targe6 x14:n<12eciricontainsan> n/oh">rigprthangsppa ;(31id L170312x144 426><2trig4268 tatrigh.+code=dr4"6 031id L170312x144 426>92 426tioco <4p6n#L426.t;"> d7s rightwi yspa">tmuosL18ghtwi ex137 426 2for 426t;"> ex137 426 ncfor 426tiocommen "> * @dev: s4r6cti436/spa_device for the urrent @731id L187312x137 426i 2for 426tiocommen ">/**12 =drv" .nve =drv" * x18 v426inc 426tiocommen "> * @dev: 4<6spa4363.ref"S" x115 4.6> 2 426tiocommen "> * @a: a4o6ic 4363d L9631 <2x116 426> 2 426tiocommen "> *12refcnf"fp gr have called#L17 Forceip wi yn> x137 426> 2 426x1span#WFI atomic_inc s2.(tatrit.+code=onnine_> n " n s" ready_wa/tineve n " prevex115 4.6i<2trig426tioco <4p6n#L43638re.r>refcnf"f">ready_wa/te a> s.n#so_aL6nw s.n#so_aL6nw tiotrt;">de=dev" x115 s26> 2 426 tatright.+code=onnin4_6 n43639ref">atomic_inc s2.(tatrit.pux115 4.6> 2 426turn tatright.+code=dr4"6 refcn s2.ila otr_inc s2.(tatricokad clnole y v/opti;i s.nole y v/opti;itior inc s2.(tatric.+ x15 v426><2trig426.t;"> <4p6n#L44641.rad>atomiiiiiiiiiiitri.t;"> ena> elax;ix115 4.6> 2 426t;"> x142 426> 2 426tiocommen "> * this fu416> i4h64id L15431 x154 326inc 426tiocommen "> *12x144 426> 2 426tiocommen "> * Must on4y6be 4a64uct s.a wow_spa">-.a wowssL y tnd#L6spa sL18ghtwi ;(31id L170312x144 426> 2 426tiocommen "> * ( x14:n<12eciricontainsan> n/oh">rigprthangsppa ;(31id L170312x144 426> 2 426tiocommen "> *12x144 426><2trig426tiocommen "> * Provide4 6ull4464c d7s rightwi yspa">tmuosL18ghtwi ex137 426> 2 426tiocon#WFI ex137 426vo2d ta426ght.+ <4p6n#L4565 x137 426{i2atri426 tatright.+code=preve4 6 <4565.ref"DLE_Fbarrier" s.a wow_spa"tior ef"> =drv" x18 v426> 2 4l6el_nine31nam L1373>x436 s24565ool s2. tatrieienoight. < a x115 4.6>nc 426tright.+code=smp_mb__b4f6re_4565id L16531 x165 4.6> 2 4t6tright.+code=atomic_in4"6 atomi.rsp gr have called#L1731id L187312x137 426> 2 4t6t;"> arrispa < t;ss newlanpan#LL1853rilean<12y31id L187312x137 426> 2 426ile (tatright.+code=at4m6c_r4565he targe6 x137 426v<2trig426 tatright.+code= 4<6rel4565c x137 426{ 2 426t;"> atomic_inc s2.(tatrit.smp_wmatright.t;">x115 4.6 3i6 (tatright.+code=atomi3_6nc_3666ool s2. tatrigight.">de=deloacode=onnine_> n " n s" ready_wa/tineve n " prevex115 4.6 i2atri426 tatright.+code=a3o6ic_36661ref">atomi.rsp gr have called#L17 Forcei yn>evex137 426 2 426 return;i<3666ool s2. tatrigight.">de=derio.r s.n#so_aL6nw s.n#so_aL6nw tiotrt;">de=dev" x115 s26> 2 3}6 3666ool s2. tatrigight.">de=delopux115 4.6{ 4t6t;"> x118 326 3w6ile (tatright.+code=at3m6c_r3666d L9631 <2x116 426 3 6 tatright.+code= 3<6rel3666 n er s er, and continue3117031id L170312x144 426}i <3p6n#L3666he targe6 s.a> enotify>-.notifispacped n>dursppahotplug transi rtmc31id L187312x137 426} 2 426t;"> x137 426} 2 426tiocommen ">/**12 x137 426> 3o6tiocommen "> * x/95 s426>i2atri3 6tiocommen "> * @dev: s3r6ct 3 67spa_device for the urrent @31id L185312<5ptionin231nam L953>x/95 s426> 2 426tiocommen "> * @drv: s3r6ct 3 67;"> ileanp n/ogprbrought>tmuor/saf> * ussppahotplug. Upd"Ix146 426 2 3}6tiocommen "> * @ x137 426i *12x137 426> 3o6tiocommen "> * Returns3t6ue 3767.ref"DLE_Fbarienoight. < a enotify s.a> enotifytior ef"> x137 426> 3 6tiocommen "> */12refcnf">atomic_unsigntwilongx15 v426>i6ool376o.ref"L18031 x18 v426> 2 426ruct tatright.+code= 3/6pa_3767 eienoight. < a <3p6n#L37679ref">atomic_ef"> dev s2.,i x115 4.6 3r6turn tatright.+code=dr3"6 x131 s.6 i2atri3 6.t;"> <3p6n#L38681ref">atomi.rswitch">atomic_inc_rella rtmtright.t;"> x18 v426 3o6t;"> x16 v3.6> 3o6tiocommen ">/**12 x16 v3.6> * x16 v3.6> 3o6tiocommen "> * @> atomi.rcase x16 v3.6> 3 6tiocommen "> */12 x16 v3.6>iatomic_case x16 v3.6> 2 426tioco <3p6n#L3868 <_rebobreakL153312<5ptionin231nam L1153>x115 4.6 2 4t6 tatright.+catomic_re3d6 <38689ref">atomic_default:16031 x16 v3.6 1 316tioco <3p6n#L3969ool s2. tatriiiiiiiii2.-="6wt;">de= atomi eNOTIFY_OK x115 4.6 1 316t;"> atomi.rL168312x118 326 316tiocommen "> * o a3o6t i3969ool s168312x118 326 3o6tiocommen "> * wi 3i6 er3969ool s2. tatrigight.">de=delomutex_lockdelockdelockx115 s26 1 316tiocommen "> */12x165 4.6 3o6tiocommen "> *12atomic_inc s2.(tatriri/span> de=dev" dev s2., r=s2.-="6>1atright.+ rht. h othert.ght31id L153312<5ptionin231nam L1153>x115 4.6 1 316tiocommen ">/**12refcnf"ef!c_inc s2.(tatric./span> ready_wa/te= x115 4.6 i * ruct 3 6/sp3969.ref">atomif">atomi.rgotnd.-="6>1atright.ou r=L153312<5ptionin231nam L1153>x115 4.6 2 426tiocommen "> * @> x119 326 2 3h6tiocommen "> * @reques3e6_ 39699ref">atomic_switch">atomic_inc_rella rtmtright.t;"> x18 v427> 2 427tiocommen "> * @ready_4a7tin4070ool s2. tatricase x16 v3.7>12 427t;"> atomic_case x16 v3.7>22 427tiocommen "> * o a3o7efe4070ool s2. tatf">atomic_.-="6>1atright.+ =drv" .nve ready_wa/te= x115 4.7> 2 427tiocommen "> * @preven4:7fla40703ol s2. tatf">atomic_breakL153312<5ptionin231nam L1153>x115 4.7> 2 427tiocommen "> */12 x16 v3.7> 2 427tiocommen "> *12atomi.rcase x16 v3.7> 2 427tiocommen ">/**12refcnf">atomic_.-="6>1atright.+ s.upd"I ready_wa/te= x115 4.7>72 427tiocommen "> * ruct 3 7x1s4070.ref">atomif">atomi.rsp gr have called#L17 Fp withrough *731id L187312x137 427>82 427tiocommen "> * @> x16 v3.7>92 427tiocommen "> * @reques3e7 n40709ref">atomic_case x16 v3.7 2 427 tatright.+code=refcn4"7 s.a wow_spa"tior inc s2.(tatric./span> ready_wa/te= x115 4.7 2 427t;"> atomiiiiiiiiiiibreakL153312<5ptionin231nam L1153>x115 4.7> 2 427 return;onnine_> 4n7" 4171ool s2. tatf"L168312x118 327> 2 4273 return;onnine_> 4n7" 4171id L15431 x154 327> 2 427tright.+code=========-4"7 1atright.ou r=:16031 x16 v3.7 2 427t;"> atomic_inc s2.(tatririmutex_unlockdelockdelockx115 s27> 2 427 tatrigh.+code=dr4"7 refcnf"2.-="6wt;">de= atomi eNOTIFY_OK x115 4.7 2 427.t;"> <4p7n#L41711id L168312x118 327i<2trig427t;"> x119 327>92 427tiocommen ">/**12 enotifisp s.a> enotifie531 -1L18031 x18 v427inctrig427tiocommen "> * refcn s2../spa_d;"> enotify s.a> enotifytiors187312x137 427incfor 427tiocommen "> * @dev: s4r7ct 42721.rad}L153312<5ptionin231nam L1153>x115 4.7 2for 427tiocommen "> * @refcn 4 7efe4272ool s168312x118 327> 2 427tiocommen "> * @preven4:7fla4272id LDLE_Fbarienoight. < a <__inidx115 4.7> 2 427tiocommen ">/*12x18 v427> 2 42751span#WFI refcnf"2.-="6wt;">de= atomi eregis6ht.a> enotifisp enotifisptior sp s2.-="6>1atrightht.+f">de enotifisp s.a> enotifie531 LL153312<5ptionin231nam L1153>x115 s27> 2 427tioco <4p7n#L4272 n eL168312x118 327> 2 427 tatright.+code=reque4t7d_ 4272he tar">ready_wa/te= relinidcpedde=dev" de x115 s27><2trig4278 tatrigh.+code=dr4"7 s/div>
The original LXR softwn>53312<5pthttp://sourceforge.net/projects/lxt">LXR calunidytiors>isn#Lexperilledal in23iondbym53312<5ptmailto:lxt@gh.ux.no">lxt@gh.ux.notior. s/div>
lxt.gh.ux.no kindly hosRedpill Lh.pro AStiors>provider/sa Lh.uxiconsul#sp_Co i"opera rtmc sers2., since 1995. s/div>