linux/drivers/edac/edac_device.c
<<
0" /spaion /formon a 0" href="../linux+v3.9.5/drivers/edac/edac_device.c">0" img src="../.static/gfx/right.png" alt=">>">0" /spaion0" spai class="lxr_search">0" 0" input typluehidden" namluenavtarget" n value">0" input typluetext" namluesearch" iduesearch">0" butttiotypluesubmit">Search0" Prefsn /a>0" /spaion /divon form acopti="ajax+*" method="post" onsubmit="return false;">0" input typluehidden" namlueajax_lookup" idueajax_lookup" n value">0 /formon0 div class="headingbotttm">n div iduefile_contents"o
 
1 /a>0
 
2 /a> spai class="comment">/* /spaion
 
3 /a> spai class="comment"> * edac_device.c /spaion
 
4 /a> spai class="comment"> * (C) 2007 www.douglaskthompson.com /spaion
 
5 /a> spai class="comment"> * /spaion
 
6 /a> spai class="comment"> * This file may be distributed under the terms of the /spaion
 
7 /a> spai class="comment"> * GNU General Public License. /spaion
 
8 /a> spai class="comment"> * /spaion
 
9 /a> spai class="comment"> * Written by Doug Thompson <norsk5@xmission.com> /spaion
 7.10a> spai class="comment"> * /spaion
 11 /a> spai class="comment"> * edac_device API implementaopti /spaion
 12 /a> spai class="comment"> * 19 Jai 2007 /spaion
 13 /a> spai class="comment"> */ /spaion
 14 /a>0
 15 /a>#include <linux/module.h /a>>0
 16 /a>#include <linux/typls.h /a>>0
 17 /a>#include <linux/smp.h /a>>0
 18 /a>#include <linux/init.h /a>>0
 19 /a>#include <linux/sysctl.h /a>>0
 20 /a>#include <linux/highmem.h /a>>0
 21 /a>#include <linux/timer.h /a>>0
 22 /a>#include <linux/slab.h /a>>0
 23 /a>#include <linux/jiffils.h /a>>0
 24 /a>#include <linux/spinlock.h /a>>0
 25 /a>#include <linux/list.h /a>>0
 26 /a>#include <linux/ctypl.h /a>>0
 27 /a>#include <linux/workqueul.h /a>>0
 28 /a>#include <asm/uaccess.h /a>>0
 29 /a>#include <asm/page.h /a>>0
 30 /a>0
 31 /a>#include "edac_corl.h /a>"0
 32 /a>#include "edac_module.h /a>"0
 33 /a>0
 34 /a> spai class="comment">/* lock for the list: 'edac_device_list', manipulaopti of this list /spaion
 35 /a> spai class="comment"> * is protected by the 'device_ctls_mutex' lock /spaion
 36 /a> spai class="comment"> */ /spaion
 37 /a>static
 a href="+code=DEFINE_MUTEX" class="sref">DEFINE_MUTEX /a>( a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
 38 /a>static
 a href="+code=LIST_HEAD" class="sref">LIST_HEAD /a>( a href="+code=edac_device_list" class="sref">edac_device_list /a>);0
 39 /a>0
 40 /a>#ifdef
 a href="+code=CONFIG_EDAC_DEBUG" class="sref">CONFIG_EDAC_DEBUG /a>0
 41 /a>static
void
 a href="+code=edac_device_dump_device" class="sref">edac_device_dump_device /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)0
 42 /a>{0
 43 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(3,  spai class="string">"\tedac_dev = %p dev_idx=%d\n"
 44 /a>                  a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>);0
 45 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"\tedac_dev->edac_check = %p\n"edac_dev /a>-> a href="+code=edac_check" class="sref">edac_check /a>);0
 46 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(3,  spai class="string">"\tdev = %p\n"edac_dev /a>-> a href="+code=dev" class="sref">dev /a>);0
 47 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(3,  spai class="string">"\tmod_naml:ctl_naml = %s:%s\n"
 48 /a>                  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=mod_naml" class="sref">mod_naml /a>,  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>);0
 49 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(3,  spai class="string">"\tpvt_info = %p\n\n"edac_dev /a>-> a href="+code=pvt_info" class="sref">pvt_info /a>);0
 50 /a>}0
 51 /a>#endif                           spai class="comment">/* CONFIG_EDAC_DEBUG */ /spaion
 52 /a>0
 53 /a>0
 54 /a> spai class="comment">/* /spaion
 55 /a> spai class="comment"> * edac_device_alloc_ctl_info() /spaion
 56 /a> spai class="comment"> *      Allocate a new edac device control info structure /spaion
 57 /a> spai class="comment"> * /spaion
 58 /a> spai class="comment"> *      The control structure is allocated in complete chunk /spaion
 59 /a> spai class="comment"> *      from the OS. It is in turn sub allocated to the /spaion
 6.10a> spai class="comment"> *      various objects that compose the structure /spaion
 61 /a> spai class="comment"> * /spaion
 62 /a> spai class="comment"> *      The structure has a 'nr_instance' array within itself. /spaion
 63 /a> spai class="comment"> *      Each instance represents a major component /spaion
 64 /a> spai class="comment"> *              Example:  L1 cache and L2 cache are 2 instance components /spaion
 65 /a> spai class="comment"> * /spaion
 66 /a> spai class="comment"> *      Within each instance is an array of 'nr_blocks' blockoffsets /spaion
 67 /a> spai class="comment"> */ /spaion
 68 /a>struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_device_alloc_ctl_info" class="sref">edac_device_alloc_ctl_info /a>(n
 69 /a>        unsigned
 a href="+code=sz_private" class="sref">sz_private /a>,n
 70 /a>        char * a href="+code=edac_device_naml" class="sref">edac_device_naml /a>, unsigned
 a href="+code=nr_instances" class="sref">nr_instances /a>,n
 71 /a>        char * a href="+code=edac_block_naml" class="sref">edac_block_naml /a>, unsigned
 a href="+code=nr_blocks" class="sref">nr_blocks /a>,n
 72 /a>        unsigned
 a href="+code=offset_n val" class="sref">offset_n val /a>,           spai class="comment">/* zero, 1, or other based
offset */ /spaion
 73 /a>        struct
 a href="+code=edac_dev_sysfs_block_attribute" class="sref">edac_dev_sysfs_block_attribute /a> * a href="+code=attrib_spec" class="sref">attrib_spec /a>, unsigned
 a href="+code=nr_attrib" class="sref">nr_attrib /a>,n
 74 /a>        int
 a href="+code=device_index" class="sref">device_index /a>)0
 75 /a>{0
 76 /a>        struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=dev_ctl" class="sref">dev_ctl /a>;0
 77 /a>        struct
 a href="+code=edac_device_instance" class="sref">edac_device_instance /a> * a href="+code=dev_inst" class="sref">dev_inst /a>, * a href="+code=inst" class="sref">inst /a>;0
 78 /a>        struct
 a href="+code=edac_device_block" class="sref">edac_device_block /a> * a href="+code=dev_blk" class="sref">dev_blk /a>, * a href="+code=blk_p" class="sref">blk_p /a>, * a href="+code=blk" class="sref">blk /a>;0
 79 /a>        struct
 a href="+code=edac_dev_sysfs_block_attribute" class="sref">edac_dev_sysfs_block_attribute /a> * a href="+code=dev_attrib" class="sref">dev_attrib /a>, * a href="+code=attrib_p" class="sref">attrib_p /a>, * a href="+code=attrib" class="sref">attrib /a>;0
 80 /a>        unsigned
 a href="+code=total_size" class="sref">total_size /a>;0
 81 /a>        unsigned
 a href="+code=count" class="sref">count /a>;0
 82 /a>        unsigned
 a href="+code=instance" class="sref">instance /a>,  a href="+code=block" class="sref">block /a>,  a href="+code=attr" class="sref">attr /a>;0
 83 /a>        void
* a href="+code=pvt" class="sref">pvt /a>, * a href="+code=p" class="sref">p /a>;0
 84 /a>        int
 a href="+code=err" class="sref">err /a>;0
 85 /a>0
 86 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"instances=%d blocks=%d\n"nr_instances /a>,
 a href="+code=nr_blocks" class="sref">nr_blocks /a>);0
 87 /a>0
 88 /a>         spai class="comment">/* Calculaoe the size of memory we need to allocate AND /spaion
 89 /a> spai class="comment">         * determine the offsets of the various item arrays /spaion
 9.10a> spai class="comment">         * (instance,block,attrib) from the start of ai  allocated structure. /spaion
 91 /a> spai class="comment">         * We want
the alignment of each item  (instance,block,attrib) /spaion
 92 /a> spai class="comment">         * to be at least as stringent as what the compiler would /spaion
 93 /a> spai class="comment">         * provide if we could simply hardcode everything into a single struct. /spaion
 94 /a> spai class="comment">         */ /spaion
 95 /a>         a href="+code=p" class="sref">p /a> =  a href="+code=NULL" class="sref">NULL /a>;0
 96 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a> =  a href="+code=edac_align_ptr" class="sref">edac_align_ptr /a>(& a href="+code=p" class="sref">p /a>, sizeof(* a href="+code=dev_ctl" class="sref">dev_ctl /a>), 1);0
 97 /a>0
 98 /a>         spai class="comment">/* Calc the 'end' offset past end of ONE ctl_info structure /spaion
 99 /a> spai class="comment">         * which will become the start of the 'instance' array /spaion
100 /a> spai class="comment">         */ /spaion
101 /a>         a href="+code=dev_inst" class="sref">dev_inst /a> =  a href="+code=edac_align_ptr" class="sref">edac_align_ptr /a>(& a href="+code=p" class="sref">p /a>, sizeof(* a href="+code=dev_inst" class="sref">dev_inst /a>),
 a href="+code=nr_instances" class="sref">nr_instances /a>);0
102 /a>0
103 /a>         spai class="comment">/* Calc the 'end' offset past the instance array within the ctl_info /spaion
104 /a> spai class="comment">         * which will become the start of the block array /spaion
105 /a> spai class="comment">         */ /spaion
106 /a>         a href="+code=count" class="sref">count /a> =  a href="+code=nr_instances" class="sref">nr_instances /a> *  a href="+code=nr_blocks" class="sref">nr_blocks /a>;0
107 /a>         a href="+code=dev_blk" class="sref">dev_blk /a> =  a href="+code=edac_align_ptr" class="sref">edac_align_ptr /a>(& a href="+code=p" class="sref">p /a>, sizeof(* a href="+code=dev_blk" class="sref">dev_blk /a>),
 a href="+code=count" class="sref">count /a>);0
108 /a>0
109 /a>         spai class="comment">/* Calc the 'end' offset past the dev_blk array /spaion
17.10a> spai class="comment">         * which will become the start of the attrib array, if any. /spaion
111 /a> spai class="comment">         */ /spaion
112 /a>         spai class="comment">/* calc how many nr_attrib we need */ /spaion
113 /a>        if ( a href="+code=nr_attrib" class="sref">nr_attrib /a> > 0)0
114 /a>                 a href="+code=count" class="sref">count /a> *=  a href="+code=nr_attrib" class="sref">nr_attrib /a>;0
115 /a>         a href="+code=dev_attrib" class="sref">dev_attrib /a> =  a href="+code=edac_align_ptr" class="sref">edac_align_ptr /a>(& a href="+code=p" class="sref">p /a>, sizeof(* a href="+code=dev_attrib" class="sref">dev_attrib /a>),
 a href="+code=count" class="sref">count /a>);0
116 /a>0
117 /a>         spai class="comment">/* Calc the 'end' offset past the attributes array */ /spaion
118 /a>         a href="+code=pvt" class="sref">pvt /a> =  a href="+code=edac_align_ptr" class="sref">edac_align_ptr /a>(& a href="+code=p" class="sref">p /a>,  a href="+code=sz_private" class="sref">sz_private /a>, 1);0
119 /a>0
120 /a>         spai class="comment">/* 'pvt' now points to where the private data area is. /spaion
121 /a> spai class="comment">         * At this point 'pvt' (like dev_inst,dev_blk and dev_attrib) /spaion
122 /a> spai class="comment">         * is baselined at ZERO /spaion
123 /a> spai class="comment">         */ /spaion
124 /a>         a href="+code=total_size" class="sref">total_size /a> = ((unsigned
long) a href="+code=pvt" class="sref">pvt /a>) +  a href="+code=sz_private" class="sref">sz_private /a>;0
125 /a>0
126 /a>         spai class="comment">/* Allocate the amount of memory for the set of control structures */ /spaion
127 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a> =  a href="+code=kzalloc" class="sref">kzalloc /a>( a href="+code=total_size" class="sref">total_size /a>,  a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);0
128 /a>        if ( a href="+code=dev_ctl" class="sref">dev_ctl /a> ==  a href="+code=NULL" class="sref">NULL /a>)0
129 /a>                return  a href="+code=NULL" class="sref">NULL /a>;0
130 /a>0
131 /a>         spai class="comment">/* Adjust pointers so they point within the actual memory we /spaion
132 /a> spai class="comment">         * just allocated rather than an imaginary chunk of memory /spaion
133 /a> spai class="comment">         * located at address 0. /spaion
134 /a> spai class="comment">         * 'dev_ctl' points to REAL memory, while the others are /spaion
135 /a> spai class="comment">         * ZERO based
and thus need to be adjusted to point within /spaion
136 /a> spai class="comment">         * the allocated memory. /spaion
137 /a> spai class="comment">         */ /spaion
138 /a>         a href="+code=dev_inst" class="sref">dev_inst /a> = (struct
 a href="+code=edac_device_instance" class="sref">edac_device_instance /a> *)0
139 /a>                (((char *) a href="+code=dev_ctl" class="sref">dev_ctl /a>) + ((unsigned
long) a href="+code=dev_inst" class="sref">dev_inst /a>));0
140 /a>         a href="+code=dev_blk" class="sref">dev_blk /a> = (struct
 a href="+code=edac_device_block" class="sref">edac_device_block /a> *)0
141 /a>                (((char *) a href="+code=dev_ctl" class="sref">dev_ctl /a>) + ((unsigned
long) a href="+code=dev_blk" class="sref">dev_blk /a>));0
142 /a>         a href="+code=dev_attrib" class="sref">dev_attrib /a> = (struct
 a href="+code=edac_dev_sysfs_block_attribute" class="sref">edac_dev_sysfs_block_attribute /a> *)0
143 /a>                (((char *) a href="+code=dev_ctl" class="sref">dev_ctl /a>) + ((unsigned
long) a href="+code=dev_attrib" class="sref">dev_attrib /a>));0
144 /a>         a href="+code=pvt" class="sref">pvt /a> =  a href="+code=sz_private" class="sref">sz_private /a> ? (((char *) a href="+code=dev_ctl" class="sref">dev_ctl /a>) + ((unsigned
long) a href="+code=pvt" class="sref">pvt /a>)) :  a href="+code=NULL" class="sref">NULL /a>;0
145 /a>0
146 /a>         spai class="comment">/* Begin storing the informaopti into the control info structure */ /spaion
147 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=dev_idx" class="sref">dev_idx /a> =  a href="+code=device_index" class="sref">device_index /a>;0
148 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=nr_instances" class="sref">nr_instances /a> =  a href="+code=nr_instances" class="sref">nr_instances /a>;0
149 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=instances" class="sref">instances /a> =  a href="+code=dev_inst" class="sref">dev_inst /a>;0
150 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=pvt_info" class="sref">pvt_info /a> =  a href="+code=pvt" class="sref">pvt /a>;0
151 /a>0
152 /a>         spai class="comment">/* Default
logging of CEs
and UEs */ /spaion
153 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=log_ce" class="sref">log_ce /a> = 1;0
154 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=log_al" class="sref">log_al /a> = 1;0
155 /a>0
156 /a>         spai class="comment">/* Naml of this edac device */ /spaion
157 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=naml" class="sref">naml /a>,sizeof( a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=naml" class="sref">naml /a>), spai class="string">"%s"edac_device_naml /a>);0
158 /a>0
159 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"edac_dev=%p next after end=%p\n"
160 /a>                  a href="+code=dev_ctl" class="sref">dev_ctl /a>,  a href="+code=pvt" class="sref">pvt /a> +  a href="+code=sz_private" class="sref">sz_private /a>);0
161 /a>0
162 /a>         spai class="comment">/* Initialize every Instance */ /spaion
163 /a>        for ( a href="+code=instance" class="sref">instance /a> = 0;
 a href="+code=instance" class="sref">instance /a> <  a href="+code=nr_instances" class="sref">nr_instances /a>;
 a href="+code=instance" class="sref">instance /a>++) {0
164 /a>                 a href="+code=inst" class="sref">inst /a> = & a href="+code=dev_inst" class="sref">dev_inst /a>[ a href="+code=instance" class="sref">instance /a>];0
165 /a>                 a href="+code=inst" class="sref">inst /a>-> a href="+code=ctl" class="sref">ctl /a> =  a href="+code=dev_ctl" class="sref">dev_ctl /a>;0
166 /a>                 a href="+code=inst" class="sref">inst /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a> =  a href="+code=nr_blocks" class="sref">nr_blocks /a>;0
167 /a>                 a href="+code=blk_p" class="sref">blk_p /a> = & a href="+code=dev_blk" class="sref">dev_blk /a>[ a href="+code=instance" class="sref">instance /a> *  a href="+code=nr_blocks" class="sref">nr_blocks /a>];0
168 /a>                 a href="+code=inst" class="sref">inst /a>-> a href="+code=blocks" class="sref">blocks /a> =  a href="+code=blk_p" class="sref">blk_p /a>;0
169 /a>0
170 /a>                 spai class="comment">/* naml of this instance */ /spaion
171 /a>                 a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=inst" class="sref">inst /a>-> a href="+code=naml" class="sref">naml /a>, sizeof( a href="+code=inst" class="sref">inst /a>-> a href="+code=naml" class="sref">naml /a>),0
172 /a>                          spai class="string">"%s%u"edac_device_naml /a>,  a href="+code=instance" class="sref">instance /a>);0
173 /a>0
174 /a>                 spai class="comment">/* Initialize every block in each instance */ /spaion
175 /a>                for ( a href="+code=block" class="sref">block /a> = 0;
 a href="+code=block" class="sref">block /a> <  a href="+code=nr_blocks" class="sref">nr_blocks /a>;
 a href="+code=block" class="sref">block /a>++) {0
176 /a>                         a href="+code=blk" class="sref">blk /a> = & a href="+code=blk_p" class="sref">blk_p /a>[ a href="+code=block" class="sref">block /a>];0
177 /a>                         a href="+code=blk" class="sref">blk /a>-> a href="+code=instance" class="sref">instance /a> =  a href="+code=inst" class="sref">inst /a>;0
178 /a>                         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=blk" class="sref">blk /a>-> a href="+code=naml" class="sref">naml /a>, sizeof( a href="+code=blk" class="sref">blk /a>-> a href="+code=naml" class="sref">naml /a>),0
179 /a>                                  spai class="string">"%s%d"edac_block_naml /a>,  a href="+code=block" class="sref">block /a>+ a href="+code=offset_n val" class="sref">offset_n val /a>);0
180 /a>0
181 /a>                         a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"instance=%d inst_p=%p block=#%d block_p=%p namlu'%s'\n"
182 /a>                                  a href="+code=instance" class="sref">instance /a>,  a href="+code=inst" class="sref">inst /a>,  a href="+code=block" class="sref">block /a>,  a href="+code=blk" class="sref">blk /a>,  a href="+code=blk" class="sref">blk /a>-> a href="+code=naml" class="sref">naml /a>);0
183 /a>0
184 /a>                         spai class="comment">/* if there are NO attributes OR no attribute pointer /spaion
185 /a> spai class="comment">                         * then continul on to next block iteraopti /spaion
186 /a> spai class="comment">                         */ /spaion
187 /a>                        if (( a href="+code=nr_attrib" class="sref">nr_attrib /a> == 0) || ( a href="+code=attrib_spec" class="sref">attrib_spec /a> ==  a href="+code=NULL" class="sref">NULL /a>))0
188 /a>                                continul;0
189 /a>0
190 /a>                         spai class="comment">/* setup the attribute array for this block */ /spaion
191 /a>                         a href="+code=blk" class="sref">blk /a>-> a href="+code=nr_attribs" class="sref">nr_attribs /a> =  a href="+code=nr_attrib" class="sref">nr_attrib /a>;0
192 /a>                         a href="+code=attrib_p" class="sref">attrib_p /a> = & a href="+code=dev_attrib" class="sref">dev_attrib /a>[ a href="+code=block" class="sref">block /a>* a href="+code=nr_instances" class="sref">nr_instances /a>* a href="+code=nr_attrib" class="sref">nr_attrib /a>];0
193 /a>                         a href="+code=blk" class="sref">blk /a>-> a href="+code=block_attributes" class="sref">block_attributes /a> =  a href="+code=attrib_p" class="sref">attrib_p /a>;0
194 /a>0
195 /a>                         a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"THIS BLOCK_ATTRIB=%p\n"
196 /a>                                  a href="+code=blk" class="sref">blk /a>-> a href="+code=block_attributes" class="sref">block_attributes /a>);0
197 /a>0
198 /a>                         spai class="comment">/* Initialize every user specified attribute in this /spaion
199 /a> spai class="comment">                         * block with the data the caller passed in /spaion
200 /a> spai class="comment">                         * Each block gets its own copy of pointers, /spaion
201 /a> spai class="comment">                         * and its unique 'n val' /spaion
202 /a> spai class="comment">                         */ /spaion
203 /a>                        for ( a href="+code=attr" class="sref">attr /a> = 0;
 a href="+code=attr" class="sref">attr /a> <  a href="+code=nr_attrib" class="sref">nr_attrib /a>;
 a href="+code=attr" class="sref">attr /a>++) {0
204 /a>                                 a href="+code=attrib" class="sref">attrib /a> = & a href="+code=attrib_p" class="sref">attrib_p /a>[ a href="+code=attr" class="sref">attr /a>];0
205 /a>0
206 /a>                                 spai class="comment">/* populaoe the unique per attrib /spaion
207 /a> spai class="comment">                                 * with the code pointers and info /spaion
208 /a> spai class="comment">                                 */ /spaion
209 /a>                                 a href="+code=attrib" class="sref">attrib /a>-> a href="+code=attr" class="sref">attr /a> =  a href="+code=attrib_spec" class="sref">attrib_spec /a>[ a href="+code=attr" class="sref">attr /a>]. a href="+code=attr" class="sref">attr /a>;0
210 /a>                                 a href="+code=attrib" class="sref">attrib /a>-> a href="+code=show" class="sref">show /a> =  a href="+code=attrib_spec" class="sref">attrib_spec /a>[ a href="+code=attr" class="sref">attr /a>]. a href="+code=show" class="sref">show /a>;0
211 /a>                                 a href="+code=attrib" class="sref">attrib /a>-> a href="+code=store" class="sref">store /a> =  a href="+code=attrib_spec" class="sref">attrib_spec /a>[ a href="+code=attr" class="sref">attr /a>]. a href="+code=store" class="sref">store /a>;0
212 /a>0
213 /a>                                 a href="+code=attrib" class="sref">attrib /a>-> a href="+code=block" class="sref">block /a> =  a href="+code=blk" class="sref">blk /a>;     spai class="comment">/* up link */ /spaion
214 /a>0
215 /a>                                 a href="+code=edac_dbg" class="sref">edac_dbg /a>(4,  spai class="string">"alloc-attrib=%p attrib_namlu'%s' attrib-spec=%p spec-namlu%s\n"
216 /a>                                          a href="+code=attrib" class="sref">attrib /a>,  a href="+code=attrib" class="sref">attrib /a>-> a href="+code=attr" class="sref">attr /a>. a href="+code=naml" class="sref">naml /a>,0
217 /a>                                         & a href="+code=attrib_spec" class="sref">attrib_spec /a>[ a href="+code=attr" class="sref">attr /a>],0
218 /a>                                          a href="+code=attrib_spec" class="sref">attrib_spec /a>[ a href="+code=attr" class="sref">attr /a>]. a href="+code=attr" class="sref">attr /a>. a href="+code=naml" class="sref">naml /a>0
219 /a>                                        );0
220 /a>                        }0
221 /a>                }0
222 /a>        }0
223 /a>0
224 /a>         spai class="comment">/* Mark this instance as merely ALLOCATED */ /spaion
225 /a>         a href="+code=dev_ctl" class="sref">dev_ctl /a>-> a href="+code=op_state" class="sref">op_state /a> =  a href="+code=OP_ALLOC" class="sref">OP_ALLOC /a>;0
226 /a>0
227 /a>         spai class="comment">/* /spaion
228 /a> spai class="comment">         * Initialize the 'root' kobj for the edac_device controller /spaion
229 /a> spai class="comment">         */ /spaion
230 /a>         a href="+code=err" class="sref">err /a> =  a href="+code=edac_device_register_sysfs_main_kobj" class="sref">edac_device_register_sysfs_main_kobj /a>( a href="+code=dev_ctl" class="sref">dev_ctl /a>);0
231 /a>        if ( a href="+code=err" class="sref">err /a>) {0
232 /a>                 a href="+code=kfree" class="sref">kfree /a>( a href="+code=dev_ctl" class="sref">dev_ctl /a>);0
233 /a>                return  a href="+code=NULL" class="sref">NULL /a>;0
234 /a>        }0
235 /a>0
236 /a>         spai class="comment">/* at this point, the root kobj is valid, and in order to /spaion
237 /a> spai class="comment">         * 'free' the object, then the funcopti: /spaion
238 /a> spai class="comment">         *      edac_device_unregister_sysfs_main_kobj() must be called /spaion
239 /a> spai class="comment">         * which will perform kobj unregistraopti
and the actual free /spaion
24.10a> spai class="comment">         * will occur during the kobject callback operaopti /spaion
241 /a> spai class="comment">         */ /spaion
242 /a>0
243 /a>        return  a href="+code=dev_ctl" class="sref">dev_ctl /a>;0
244 /a>}0
245 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_alloc_ctl_info" class="sref">edac_device_alloc_ctl_info /a>);0
246 /a>0
247 /a> spai class="comment">/* /spaion
248 /a> spai class="comment"> * edac_device_free_ctl_info() /spaion
249 /a> spai class="comment"> *      frees the memory allocated by the edac_device_alloc_ctl_info() /spaion
25.10a> spai class="comment"> *      funcopti /spaion
251 /a> spai class="comment"> */ /spaion
252 /a>void
 a href="+code=edac_device_free_ctl_info" class="sref">edac_device_free_ctl_info /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=ctl_info" class="sref">ctl_info /a>)n
253 /a>{0
254 /a>         a href="+code=edac_device_unregister_sysfs_main_kobj" class="sref">edac_device_unregister_sysfs_main_kobj /a>( a href="+code=ctl_info" class="sref">ctl_info /a>);0
255 /a>}0
256 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_free_ctl_info" class="sref">edac_device_free_ctl_info /a>);0
257 /a>0
258 /a> spai class="comment">/* /spaion
259 /a> spai class="comment"> * find_edac_device_by_dev /spaion
26.10a> spai class="comment"> *      scans the edac_device list for a specific 'struct
device *' /spaion
261 /a> spai class="comment"> * /spaion
262 /a> spai class="comment"> *      lock to be held prior to call:  device_ctls_mutex /spaion
263 /a> spai class="comment"> * /spaion
264 /a> spai class="comment"> *      Return: /spaion
265 /a> spai class="comment"> *              pointer to control structure managing 'dev' /spaion
266 /a> spai class="comment"> *              NULL if not found on list /spaion
267 /a> spai class="comment"> */ /spaion
268 /a>static struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=find_edac_device_by_dev" class="sref">find_edac_device_by_dev /a>(struct
 a href="+code=device" class="sref">device /a> * a href="+code=dev" class="sref">dev /a>)n
269 /a>{0
270 /a>        struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>;0
271 /a>        struct
 a href="+code=list_head" class="sref">list_head /a> * a href="+code=item" class="sref">item /a>;0
272 /a>0
273 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(0,  spai class="string">"\n"
274 /a>0
275 /a>         a href="+code=list_for_each" class="sref">list_for_each /a>( a href="+code=item" class="sref">item /a>, & a href="+code=edac_device_list" class="sref">edac_device_list /a>) {0
276 /a>                 a href="+code=edac_dev" class="sref">edac_dev /a> =  a href="+code=list_entry" class="sref">list_entry /a>( a href="+code=item" class="sref">item /a>, struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a>,  a href="+code=link" class="sref">link /a>);0
277 /a>0
278 /a>                if ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev" class="sref">dev /a> ==  a href="+code=dev" class="sref">dev /a>)n
279 /a>                        return  a href="+code=edac_dev" class="sref">edac_dev /a>;0
280 /a>        }0
281 /a>0
282 /a>        return  a href="+code=NULL" class="sref">NULL /a>;0
283 /a>}0
284 /a>0
285 /a> spai class="comment">/* /spaion
286 /a> spai class="comment"> * add_edac_dev_to_global_list /spaion
287 /a> spai class="comment"> *      Before calling this funcopti, caller must /spaion
288 /a> spai class="comment"> *      assign a unique n val to edac_dev->dev_idx. /spaion
289 /a> spai class="comment"> * /spaion
29.10a> spai class="comment"> *      lock to be held prior to call:  device_ctls_mutex /spaion
291 /a> spai class="comment"> * /spaion
292 /a> spai class="comment"> *      Return: /spaion
293 /a> spai class="comment"> *              0 on success /spaion
294 /a> spai class="comment"> *              1 on failure. /spaion
295 /a> spai class="comment"> */ /spaion
296 /a>static int  a href="+code=add_edac_dev_to_global_list" class="sref">add_edac_dev_to_global_list /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)n
297 /a>{0
298 /a>        struct
 a href="+code=list_head" class="sref">list_head /a> * a href="+code=item" class="sref">item /a>, * a href="+code=insert_before" class="sref">insert_before /a>;0
299 /a>        struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=rover" class="sref">rover /a>;0
300 /a>0
301 /a>         a href="+code=insert_before" class="sref">insert_before /a> = & a href="+code=edac_device_list" class="sref">edac_device_list /a>;0
302 /a>0
303 /a>         spai class="comment">/* Determine if already on the list */ /spaion
304 /a>         a href="+code=rover" class="sref">rover /a> =  a href="+code=find_edac_device_by_dev" class="sref">find_edac_device_by_dev /a>( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev" class="sref">dev /a>);0
305 /a>        if ( a href="+code=unlikely" class="sref">unlikely /a>( a href="+code=rover" class="sref">rover /a> !=  a href="+code=NULL" class="sref">NULL /a>))0
306 /a>                goto  a href="+code=fail0" class="sref">fail0 /a>;0
307 /a>0
308 /a>         spai class="comment">/* Insert in ascending order by 'dev_idx', so find posiopti
*/ /spaion
309 /a>         a href="+code=list_for_each" class="sref">list_for_each /a>( a href="+code=item" class="sref">item /a>, & a href="+code=edac_device_list" class="sref">edac_device_list /a>) {0
310 /a>                 a href="+code=rover" class="sref">rover /a> =  a href="+code=list_entry" class="sref">list_entry /a>( a href="+code=item" class="sref">item /a>, struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a>,  a href="+code=link" class="sref">link /a>);0
311 /a>0
312 /a>                if ( a href="+code=rover" class="sref">rover /a>-> a href="+code=dev_idx" class="sref">dev_idx /a> >=  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>) {0
313 /a>                        if ( a href="+code=unlikely" class="sref">unlikely /a>( a href="+code=rover" class="sref">rover /a>-> a href="+code=dev_idx" class="sref">dev_idx /a> ==  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>))0
314 /a>                                goto  a href="+code=fail1" class="sref">fail1 /a>;0
315 /a>0
316 /a>                         a href="+code=insert_before" class="sref">insert_before /a> =  a href="+code=item" class="sref">item /a>;0
317 /a>                        break;0
318 /a>                }0
319 /a>        }0
320 /a>0
321 /a>         a href="+code=list_add_tail_rcu" class="sref">list_add_tail_rcu /a>(& a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=link" class="sref">link /a>,  a href="+code=insert_before" class="sref">insert_before /a>);0
322 /a>        return 0;0
323 /a>0
324 /a> a href="+code=fail0" class="sref">fail0 /a>:0
325 /a>         a href="+code=edac_printk" class="sref">edac_printk /a>( a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>,  a href="+code=EDAC_MC" class="sref">EDAC_MC /a>,0
326 /a>                         spai class="string">"%s (%s) %s %s already assigned %d\n"
327 /a>                         a href="+code=dev_naml" class="sref">dev_naml /a>( a href="+code=rover" class="sref">rover /a>-> a href="+code=dev" class="sref">dev /a>),  a href="+code=edac_dev_naml" class="sref">edac_dev_naml /a>( a href="+code=rover" class="sref">rover /a>),0
328 /a>                         a href="+code=rover" class="sref">rover /a>-> a href="+code=mod_naml" class="sref">mod_naml /a>,  a href="+code=rover" class="sref">rover /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,  a href="+code=rover" class="sref">rover /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>);0
329 /a>        return 1;0
330 /a>0
331 /a> a href="+code=fail1" class="sref">fail1 /a>:0
332 /a>         a href="+code=edac_printk" class="sref">edac_printk /a>( a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>,  a href="+code=EDAC_MC" class="sref">EDAC_MC /a>,0
333 /a>                         spai class="string">"bug in low-level driver: attempt to assign\n"
334 /a>                         spai class="string">"    duplicate dev_idx %d in %s()\n"rover /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>,0
335 /a>                         a href="+code=__func__" class="sref">__func__ /a>);0
336 /a>        return 1;0
337 /a>}0
338 /a>0
339 /a> spai class="comment">/* /spaion
34.10a> spai class="comment"> * del_edac_device_from_global_list /spaion
341 /a> spai class="comment"> */ /spaion
342 /a>static void
 a href="+code=del_edac_device_from_global_list" class="sref">del_edac_device_from_global_list /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a>n
343 /a>                                                * a href="+code=edac_device" class="sref">edac_device /a>)n
344 /a>{0
345 /a>         a href="+code=list_del_rcu" class="sref">list_del_rcu /a>(& a href="+code=edac_device" class="sref">edac_device /a>-> a href="+code=link" class="sref">link /a>);0
346 /a>0
347 /a>         spai class="comment">/* these are for safe removal of devices from global list while /spaion
348 /a> spai class="comment">         * NMI handlers may be traversing list /spaion
349 /a> spai class="comment">         */ /spaion
350 /a>         a href="+code=synchronize_rcu" class="sref">synchronize_rcu /a>();0
351 /a>         a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD /a>(& a href="+code=edac_device" class="sref">edac_device /a>-> a href="+code=link" class="sref">link /a>);0
352 /a>}0
353 /a>0
354 /a> spai class="comment">/* /spaion
355 /a> spai class="comment"> * edac_device_workq_funcopti /spaion
356 /a> spai class="comment"> *      performs the operaopti scheduled by a workq request /spaion
357 /a> spai class="comment"> * /spaion
358 /a> spai class="comment"> *      this workq is embedded within an edac_device_ctl_info /spaion
359 /a> spai class="comment"> *      structure, that needs to be polled for possible error events. /spaion
36.10a> spai class="comment"> * /spaion
361 /a> spai class="comment"> *      This operaopti is to acquire the list mutex lock /spaion
362 /a> spai class="comment"> *      (thus preventing insertaopti or deleopti) /spaion
363 /a> spai class="comment"> *      and then call the device's poll funcopti IFF this device is /spaion
364 /a> spai class="comment"> *      running polled and there is a poll funcopti defined. /spaion
365 /a> spai class="comment"> */ /spaion
366 /a>static void
 a href="+code=edac_device_workq_funcopti" class="sref">edac_device_workq_funcopti /a>(struct
 a href="+code=work_struct" class="sref">work_struct /a> * a href="+code=work_req" class="sref">work_req /a>)n
367 /a>{0
368 /a>        struct
 a href="+code=delayed_work" class="sref">delayed_work /a> * a href="+code=d_work" class="sref">d_work /a> =  a href="+code=to_delayed_work" class="sref">to_delayed_work /a>( a href="+code=work_req" class="sref">work_req /a>);0
369 /a>        struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a> =  a href="+code=to_edac_device_ctl_work" class="sref">to_edac_device_ctl_work /a>( a href="+code=d_work" class="sref">d_work /a>);0
370 /a>0
371 /a>         a href="+code=mutex_lock" class="sref">mutex_lock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
372 /a>0
373 /a>         spai class="comment">/* If we are being removed, bail out immediately */ /spaion
374 /a>        if ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a> ==  a href="+code=OP_OFFLINE" class="sref">OP_OFFLINE /a>) {0
375 /a>                 a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
376 /a>                return;0
377 /a>        }0
378 /a>0
379 /a>         spai class="comment">/* Only poll controllers that are running polled and have a check */ /spaion
380 /a>        if (( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a> ==  a href="+code=OP_RUNNING_POLL" class="sref">OP_RUNNING_POLL /a>) &&n
381 /a>                ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=edac_check" class="sref">edac_check /a> !=  a href="+code=NULL" class="sref">NULL /a>)) {0
382 /a>                         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=edac_check" class="sref">edac_check /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
383 /a>        }0
384 /a>0
385 /a>         a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
386 /a>0
387 /a>         spai class="comment">/* Reschedule the workq for the next time period to start agaii /spaion
388 /a> spai class="comment">         * if the number of msec is for 1 sec, then adjust to the next /spaion
389 /a> spai class="comment">         * whole one second to save timers firing all over the period /spaion
39.10a> spai class="comment">         * between integral seconds /spaion
391 /a> spai class="comment">         */ /spaion
392 /a>        if ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=poll_msec" class="sref">poll_msec /a> == 1000)n
393 /a>                 a href="+code=queue_delayed_work" class="sref">queue_delayed_work /a>( a href="+code=edac_workqueue" class="sref">edac_workqueue /a>, & a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>,0
394 /a>                                 a href="+code=round_jiffies_relative" class="sref">round_jiffies_relative /a>( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=delay" class="sref">delay /a>));0
395 /a>        else0
396 /a>                 a href="+code=queue_delayed_work" class="sref">queue_delayed_work /a>( a href="+code=edac_workqueue" class="sref">edac_workqueue /a>, & a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>,0
397 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=delay" class="sref">delay /a>);0
398 /a>}0
399 /a>0
40.10a> spai class="comment">/* /spaion
401 /a> spai class="comment"> * edac_device_workq_setup /spaion
402 /a> spai class="comment"> *      initialize a workq item for this edac_device instance /spaion
403 /a> spai class="comment"> *      passing in the new delay period in msec /spaion
404 /a> spai class="comment"> */ /spaion
405 /a>void
 a href="+code=edac_device_workq_setup" class="sref">edac_device_workq_setup /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>,0
406 /a>                                unsigned  a href="+code=msec" class="sref">msec /a>)n
407 /a>{0
408 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(0,  spai class="string">"\n"
409 /a>0
410 /a>         spai class="comment">/* take the arg 'msec' and set it into the control structure /spaion
411 /a> spai class="comment">         * to used in the time period calculaopti /spaion
412 /a> spai class="comment">         * then calc the number of jiffies that represents /spaion
413 /a> spai class="comment">         */ /spaion
414 /a>         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=poll_msec" class="sref">poll_msec /a> =  a href="+code=msec" class="sref">msec /a>;0
415 /a>         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=delay" class="sref">delay /a> =  a href="+code=msecs_to_jiffies" class="sref">msecs_to_jiffies /a>( a href="+code=msec" class="sref">msec /a>);0
416 /a>0
417 /a>         a href="+code=INIT_DELAYED_WORK" class="sref">INIT_DELAYED_WORK /a>(& a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>,
 a href="+code=edac_device_workq_funcopti" class="sref">edac_device_workq_funcopti /a>);0
418 /a>0
419 /a>         spai class="comment">/* optimize here for the 1 second case, which will be normal n val, to /spaion
42.10a> spai class="comment">         * fire ON the 1 second time event. This helps reduce all sorts of /spaion
421 /a> spai class="comment">         * timers firing on sub-second basis, while they are happy /spaion
422 /a> spai class="comment">         * to fire together on the 1 second exactly /spaion
423 /a> spai class="comment">         */ /spaion
424 /a>        if ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=poll_msec" class="sref">poll_msec /a> == 1000)n
425 /a>                 a href="+code=queue_delayed_work" class="sref">queue_delayed_work /a>( a href="+code=edac_workqueue" class="sref">edac_workqueue /a>, & a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>,0
426 /a>                                 a href="+code=round_jiffies_relative" class="sref">round_jiffies_relative /a>( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=delay" class="sref">delay /a>));0
427 /a>        else0
428 /a>                 a href="+code=queue_delayed_work" class="sref">queue_delayed_work /a>( a href="+code=edac_workqueue" class="sref">edac_workqueue /a>, & a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>,0
429 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=delay" class="sref">delay /a>);0
430 /a>}0
431 /a>0
432 /a> spai class="comment">/* /spaion
433 /a> spai class="comment"> * edac_device_workq_teardowi /spaion
434 /a> spai class="comment"> *      stop the workq processing on this edac_dev /spaion
435 /a> spai class="comment"> */ /spaion
436 /a>void
 a href="+code=edac_device_workq_teardowi" class="sref">edac_device_workq_teardowi /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)n
437 /a>{0
438 /a>        int  a href="+code=status" class="sref">status /a>;0
439 /a>0
440 /a>         a href="+code=status" class="sref">status /a> =  a href="+code=cancel_delayed_work" class="sref">cancel_delayed_work /a>(& a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=work" class="sref">work /a>);0
441 /a>        if ( a href="+code=status" class="sref">status /a> == 0) {0
442 /a>                 spai class="comment">/* workq instance might be running, wait for it */ /spaion
443 /a>                 a href="+code=flush_workqueue" class="sref">flush_workqueue /a>( a href="+code=edac_workqueue" class="sref">edac_workqueue /a>);0
444 /a>        }0
445 /a>}0
446 /a>0
447 /a> spai class="comment">/* /spaion
448 /a> spai class="comment"> * edac_device_reset_delay_period /spaion
449 /a> spai class="comment"> * /spaion
45.10a> spai class="comment"> *      need to stop any outstanding workq queued up at this time /spaion
451 /a> spai class="comment"> *      because we will be resetting the sleep time. /spaion
452 /a> spai class="comment"> *      Then restart the workq on the new delay /spaion
453 /a> spai class="comment"> */ /spaion
454 /a>void
 a href="+code=edac_device_reset_delay_period" class="sref">edac_device_reset_delay_period /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>,0
455 /a>                                        unsigned long  a href="+code=n val" class="sref">n val /a>)n
456 /a>{0
457 /a>         spai class="comment">/* cancel the current workq request, without the mutex lock */ /spaion
458 /a>         a href="+code=edac_device_workq_teardowi" class="sref">edac_device_workq_teardowi /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
459 /a>0
460 /a>         spai class="comment">/* acquire the mutex before doing the workq setup */ /spaion
461 /a>         a href="+code=mutex_lock" class="sref">mutex_lock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
462 /a>0
463 /a>         spai class="comment">/* restart the workq request, with new delay n val */ /spaion
464 /a>         a href="+code=edac_device_workq_setup" class="sref">edac_device_workq_setup /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=n val" class="sref">n val /a>);0
465 /a>0
466 /a>         a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
467 /a>}0
468 /a>0
469 /a> spai class="comment">/* /spaion
47.10a> spai class="comment"> * edac_device_alloc_index: Allocate a unique device index number /spaion
471 /a> spai class="comment"> * /spaion
472 /a> spai class="comment"> * Return: /spaion
473 /a> spai class="comment"> *      allocated index number /spaion
474 /a> spai class="comment"> */ /spaion
475 /a>int  a href="+code=edac_device_alloc_index" class="sref">edac_device_alloc_index /a>(void)n
476 /a>{0
477 /a>        static  a href="+code=atomic_t" class="sref">atomic_t /a>  a href="+code=device_indexes" class="sref">device_indexes /a> =  a href="+code=ATOMIC_INIT" class="sref">ATOMIC_INIT /a>(0);0
478 /a>0
479 /a>        return  a href="+code=atomic_inc_return" class="sref">atomic_inc_return /a>(& a href="+code=device_indexes" class="sref">device_indexes /a>) - 1;0
480 /a>}0
481 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_alloc_index" class="sref">edac_device_alloc_index /a>);0
482 /a>0
483 /a> spai class="comment">/** /spaion
484 /a> spai class="comment"> * edac_device_add_device: Insert the 'edac_dev' structure into the /spaion
485 /a> spai class="comment"> * edac_device global list and create sysfs entries associated with /spaion
486 /a> spai class="comment"> * edac_device structure. /spaion
487 /a> spai class="comment"> * @edac_device: pointer to the edac_device structure to be added to the list /spaion
488 /a> spai class="comment"> * 'edac_device' structure. /spaion
489 /a> spai class="comment"> * /spaion
49.10a> spai class="comment"> * Return: /spaion
491 /a> spai class="comment"> *      0       Success /spaion
492 /a> spai class="comment"> *      !0      Failure /spaion
493 /a> spai class="comment"> */ /spaion
494 /a>int  a href="+code=edac_device_add_device" class="sref">edac_device_add_device /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)n
495 /a>{0
496 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(0,  spai class="string">"\n"
497 /a>0
498 /a>#ifdef  a href="+code=CONFIG_EDAC_DEBUG" class="sref">CONFIG_EDAC_DEBUG /a>0
499 /a>        if ( a href="+code=edac_debug_level" class="sref">edac_debug_level /a> >= 3)n
500 /a>                 a href="+code=edac_device_dump_device" class="sref">edac_device_dump_device /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
501 /a>#endif0
502 /a>         a href="+code=mutex_lock" class="sref">mutex_lock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
503 /a>0
504 /a>        if ( a href="+code=add_edac_dev_to_global_list" class="sref">add_edac_dev_to_global_list /a>( a href="+code=edac_dev" class="sref">edac_dev /a>))n
505 /a>                goto  a href="+code=fail0" class="sref">fail0 /a>;0
506 /a>0
507 /a>         spai class="comment">/* set load time so that error rate cai be tracked */ /spaion
508 /a>         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=start_time" class="sref">start_time /a> =  a href="+code=jiffies" class="sref">jiffies /a>;0
509 /a>0
510 /a>         spai class="comment">/* create this instance's sysfs entries */ /spaion
511 /a>        if ( a href="+code=edac_device_create_sysfs" class="sref">edac_device_create_sysfs /a>( a href="+code=edac_dev" class="sref">edac_dev /a>)) {0
512 /a>                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>,0
513 /a>                                         spai class="string">"failed to create sysfs device\n"
514 /a>                goto  a href="+code=fail1" class="sref">fail1 /a>;0
515 /a>        }0
516 /a>0
517 /a>         spai class="comment">/* If there IS a check routine, then we are running POLLED */ /spaion
518 /a>        if ( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=edac_check" class="sref">edac_check /a> !=  a href="+code=NULL" class="sref">NULL /a>) {0
519 /a>                 spai class="comment">/* This instance is NOW RUNNING */ /spaion
520 /a>                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a> =  a href="+code=OP_RUNNING_POLL" class="sref">OP_RUNNING_POLL /a>;0
521 /a>0
522 /a>                 spai class="comment">/* /spaion
523 /a> spai class="comment">                 * enable workq processing on this instance, /spaion
524 /a> spai class="comment">                 * default = 1000 msec /spaion
525 /a> spai class="comment">                 */ /spaion
526 /a>                 a href="+code=edac_device_workq_setup" class="sref">edac_device_workq_setup /a>( a href="+code=edac_dev" class="sref">edac_dev /a>, 1000);0
527 /a>        } else {0
528 /a>                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a> =  a href="+code=OP_RUNNING_INTERRUPT" class="sref">OP_RUNNING_INTERRUPT /a>;0
529 /a>        }0
530 /a>0
531 /a>         spai class="comment">/* Report acopti taken */ /spaion
532 /a>         a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_INFO" class="sref">KERN_INFO /a>,0
533 /a>                                 spai class="string">"Giving out device to module '%s' controller "
534 /a>                                 spai class="string">"'%s': DEV '%s' (%s)\n"
535 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=mod_naml" class="sref">mod_naml /a>,0
536 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,0
537 /a>                                 a href="+code=edac_dev_naml" class="sref">edac_dev_naml /a>( a href="+code=edac_dev" class="sref">edac_dev /a>),0
538 /a>                                 a href="+code=edac_op_state_to_string" class="sref">edac_op_state_to_string /a>( a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a>));0
539 /a>0
540 /a>         a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
541 /a>        return 0;0
542 /a>0
543 /a> a href="+code=fail1" class="sref">fail1 /a>:0
544 /a>         spai class="comment">/* Some error, so remove the entry from the lsit */ /spaion
545 /a>         a href="+code=del_edac_device_from_global_list" class="sref">del_edac_device_from_global_list /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
546 /a>0
547 /a> a href="+code=fail0" class="sref">fail0 /a>:0
548 /a>         a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
549 /a>        return 1;0
550 /a>}0
551 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_add_device" class="sref">edac_device_add_device /a>);0
552 /a>0
553 /a> spai class="comment">/** /spaion
554 /a> spai class="comment"> * edac_device_del_device: /spaion
555 /a> spai class="comment"> *      Remove sysfs entries for specified edac_device structure and /spaion
556 /a> spai class="comment"> *      then remove edac_device structure from global list /spaion
557 /a> spai class="comment"> * /spaion
558 /a> spai class="comment"> * @dev: /spaion
559 /a> spai class="comment"> *      Pointer to 'struct
device' representing edac_device /spaion
56.10a> spai class="comment"> *      structure to remove. /spaion
561 /a> spai class="comment"> * /spaion
562 /a> spai class="comment"> * Return: /spaion
563 /a> spai class="comment"> *      Pointer to removed edac_device structure, /spaion
564 /a> spai class="comment"> *      OR NULL if device not found. /spaion
565 /a> spai class="comment"> */ /spaion
566 /a>struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_device_del_device" class="sref">edac_device_del_device /a>(struct
 a href="+code=device" class="sref">device /a> * a href="+code=dev" class="sref">dev /a>)n
567 /a>{0
568 /a>        struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>;0
569 /a>0
570 /a>         a href="+code=edac_dbg" class="sref">edac_dbg /a>(0,  spai class="string">"\n"
571 /a>0
572 /a>         a href="+code=mutex_lock" class="sref">mutex_lock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
573 /a>0
574 /a>         spai class="comment">/* Find the structure on the list, if not there, then leave */ /spaion
575 /a>         a href="+code=edac_dev" class="sref">edac_dev /a> =  a href="+code=find_edac_device_by_dev" class="sref">find_edac_device_by_dev /a>( a href="+code=dev" class="sref">dev /a>);0
576 /a>        if ( a href="+code=edac_dev" class="sref">edac_dev /a> ==  a href="+code=NULL" class="sref">NULL /a>) {0
577 /a>                 a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
578 /a>                return  a href="+code=NULL" class="sref">NULL /a>;0
579 /a>        }0
580 /a>0
581 /a>         spai class="comment">/* mark this instance as OFFLINE */ /spaion
582 /a>         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=op_state" class="sref">op_state /a> =  a href="+code=OP_OFFLINE" class="sref">OP_OFFLINE /a>;0
583 /a>0
584 /a>         spai class="comment">/* deregister from global list */ /spaion
585 /a>         a href="+code=del_edac_device_from_global_list" class="sref">del_edac_device_from_global_list /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
586 /a>0
587 /a>         a href="+code=mutex_unlock" class="sref">mutex_unlock /a>(& a href="+code=device_ctls_mutex" class="sref">device_ctls_mutex /a>);0
588 /a>0
589 /a>         spai class="comment">/* clear workq processing on this instance */ /spaion
590 /a>         a href="+code=edac_device_workq_teardowi" class="sref">edac_device_workq_teardowi /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
591 /a>0
592 /a>         spai class="comment">/* Tear dowi the sysfs entries for this instance */ /spaion
593 /a>         a href="+code=edac_device_remove_sysfs" class="sref">edac_device_remove_sysfs /a>( a href="+code=edac_dev" class="sref">edac_dev /a>);0
594 /a>0
595 /a>         a href="+code=edac_printk" class="sref">edac_printk /a>( a href="+code=KERN_INFO" class="sref">KERN_INFO /a>,  a href="+code=EDAC_MC" class="sref">EDAC_MC /a>,0
596 /a>                 spai class="string">"Removed device %d for %s %s: DEV %s\n"
597 /a>                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=dev_idx" class="sref">dev_idx /a>,0
598 /a>                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=mod_naml" class="sref">mod_naml /a>,  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,  a href="+code=edac_dev_naml" class="sref">edac_dev_naml /a>( a href="+code=edac_dev" class="sref">edac_dev /a>));0
599 /a>0
600 /a>        return  a href="+code=edac_dev" class="sref">edac_dev /a>;0
601 /a>}0
602 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_del_device" class="sref">edac_device_del_device /a>);0
603 /a>0
604 /a>static  a href="+code=inline" class="sref">inline /a> int  a href="+code=edac_device_get_log_ce" class="sref">edac_device_get_log_ce /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)n
605 /a>{0
606 /a>        return  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=log_ce" class="sref">log_ce /a>;0
607 /a>}0
608 /a>0
609 /a>static  a href="+code=inline" class="sref">inline /a> int  a href="+code=edac_device_get_log_ue" class="sref">edac_device_get_log_ue /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>)n
610 /a>{0
611 /a>        return  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=log_ue" class="sref">log_ue /a>;0
612 /a>}0
613 /a>0
614 /a>static  a href="+code=inline" class="sref">inline /a> int  a href="+code=edac_device_get_paiic_on_ue" class="sref">edac_device_get_paiic_on_ue /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a>0
615 /a>                                        * a href="+code=edac_dev" class="sref">edac_dev /a>)n
616 /a>{0
617 /a>        return  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=paiic_on_ue" class="sref">paiic_on_ue /a>;0
618 /a>}0
619 /a>0
62.10a> spai class="comment">/* /spaion
621 /a> spai class="comment"> * edac_device_handle_ce /spaion
622 /a> spai class="comment"> *      perform a common output and handling of an 'edac_dev' CE event /spaion
623 /a> spai class="comment"> */ /spaion
624 /a>void
 a href="+code=edac_device_handle_ce" class="sref">edac_device_handle_ce /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>,0
625 /a>                        int  a href="+code=inst_nr" class="sref">inst_nr /a>, int  a href="+code=block_nr" class="sref">block_nr /a>, const char * a href="+code=msg" class="sref">msg /a>)n
626 /a>{0
627 /a>        struct
 a href="+code=edac_device_instance" class="sref">edac_device_instance /a> * a href="+code=instance" class="sref">instance /a>;0
628 /a>        struct
 a href="+code=edac_device_block" class="sref">edac_device_block /a> * a href="+code=block" class="sref">block /a> =  a href="+code=NULL" class="sref">NULL /a>;0
629 /a>0
630 /a>        if (( a href="+code=inst_nr" class="sref">inst_nr /a> >=  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=nr_instances" class="sref">nr_instances /a>) || ( a href="+code=inst_nr" class="sref">inst_nr /a> < 0)) {0
631 /a>                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_ERR" class="sref">KERN_ERR /a>,0
632 /a>                                 spai class="string">"INTERNAL ERROR: 'instance' out of range "
633 /a>                                 spai class="string">"(%d >= %d)\n"inst_nr /a>,0
634 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=nr_instances" class="sref">nr_instances /a>);0
635 /a>                return;0
636 /a>        }0
637 /a>0
638 /a>         a href="+code=instance" class="sref">instance /a> =  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=instances" class="sref">instances /a> +  a href="+code=inst_nr" class="sref">inst_nr /a>;0
639 /a>0
640 /a>        if (( a href="+code=block_nr" class="sref">block_nr /a> >=  a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a>) || ( a href="+code=block_nr" class="sref">block_nr /a> < 0)) {0
641 /a>                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_ERR" class="sref">KERN_ERR /a>,0
642 /a>                                 spai class="string">"INTERNAL ERROR: instance %d 'block' "
643 /a>                                 spai class="string">"out of range (%d >= %d)\n"
644 /a>                                 a href="+code=inst_nr" class="sref">inst_nr /a>,  a href="+code=block_nr" class="sref">block_nr /a>,0
645 /a>                                 a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a>);0
646 /a>                return;0
647 /a>        }0
648 /a>0
649 /a>        if ( a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a> > 0) {0
650 /a>                 a href="+code=block" class="sref">block /a> =  a href="+code=instance" class="sref">instance /a>-> a href="+code=blocks" class="sref">blocks /a> +  a href="+code=block_nr" class="sref">block_nr /a>;0
651 /a>                 a href="+code=block" class="sref">block /a>-> a href="+code=counters" class="sref">counters /a>. a href="+code=ce_count" class="sref">ce_count /a>++;0
652 /a>        }0
653 /a>0
654 /a>         spai class="comment">/* Propagate the count up the 'totals' tree */ /spaion
655 /a>         a href="+code=instance" class="sref">instance /a>-> a href="+code=counters" class="sref">counters /a>. a href="+code=ce_count" class="sref">ce_count /a>++;0
656 /a>         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=counters" class="sref">counters /a>. a href="+code=ce_count" class="sref">ce_count /a>++;0
657 /a>0
658 /a>        if ( a href="+code=edac_device_get_log_ce" class="sref">edac_device_get_log_ce /a>( a href="+code=edac_dev" class="sref">edac_dev /a>))n
659 /a>                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>,0
660 /a>                                 spai class="string">"CE: %s instance: %s block: %s '%s'\n"
661 /a>                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,  a href="+code=instance" class="sref">instance /a>-> a href="+code=naml" class="sref">naml /a>,0
662 /a>                                 a href="+code=block" class="sref">block /a> ?  a href="+code=block" class="sref">block /a>-> a href="+code=naml" class="sref">naml /a> :  spai class="string">"N/A"msg /a>);0
663 /a>}0
664 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_handle_ce" class="sref">edac_device_handle_ce /a>);0
665 /a>0
666 /a> spai class="comment">/* /spaion
667 /a> spai class="comment"> * edac_device_handle_ue /spaion
668 /a> spai class="comment"> *      perform a common output and handling of an 'edac_dev' UE event /spaion
669 /a> spai class="comment"> */ /spaion
670 /a>void
 a href="+code=edac_device_handle_ue" class="sref">edac_device_handle_ue /a>(struct
 a href="+code=edac_device_ctl_info" class="sref">edac_device_ctl_info /a> * a href="+code=edac_dev" class="sref">edac_dev /a>,0
671 /a>                        int  a href="+code=inst_nr" class="sref">inst_nr /a>, int  a href="+code=block_nr" class="sref">block_nr /a>, const char * a href="+code=msg" class="sref">msg /a>)n
672 /a>{0
673 /a>        struct
 a href="+code=edac_device_instance" class="sref">edac_device_instance /a> * a href="+code=instance" class="sref">instance /a>;0        struct
 a href="+code=edac_device_block" class="sref">edac_device_block /a> * a href="+code=block" class="sref">block /a> =  a href="+code=NULL" class="sref">NULL /a>;00        if (( a href="+code=inst_nr" class="sref">inst_nr /a> >=  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=nr_instances" class="sref">nr_instances /a>) || ( a href="+code=inst_nr" class="sref">inst_nr /a> < 0)) {0                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_ERR" class="sref">KERN_ERR /a>,0              a>                 spai class="string">"INTERNAL ERROR: 'instance' out of range "              a>                 spai class="string">"(%d >= %d)\n"inst_nr /a>,0                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=nr_instances" class="sref">nr_instances /a>);0                return;0        }00         a href="+code=instance" class="sref">instance /a> =  a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=instances" class="sref">instances /a> +  a href="+code=inst_nr" class="sref">inst_nr /a>;00        if (( a href="+code=block_nr" class="sref">block_nr /a> >=  a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a>) || ( a href="+code=block_nr" class="sref">block_nr /a> < 0)) {0                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERN_ERR" class="sref">KERN_ERR /a>,0              a>                 spai class="string">"INTERNAL ERROR: instance %d 'block' "              a>                 spai class="string">"out of range (%d >= %d)\n"                                 a href="+code=inst_nr" class="sref">inst_nr /a>,  a href="+code=block_nr" class="sref">block_nr /a>,0                                 a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a>);0                return;0        }00        if ( a href="+code=instance" class="sref">instance /a>-> a href="+code=nr_blocks" class="sref">nr_blocks /a> > 0) {0                 a href="+code=block" class="sref">block /a> =  a href="+code=instance" class="sref">instance /a>-> a href="+code=blocks" class="sref">blocks /a> +  a href="+code=block_nr" class="sref">block_nr /a>;0                 a href="+code=block" class="sref">block /a>-> a href="+code=counters" class="sref">counters /a>. a href="+codu=ce_count" class="srefu>ce_count /a>++;0        }00         spai class="comment">/* Propagate the count up the 'totals' tree */ /spaion         a href="+code=instance" class="sref">instance /a>-> a href="+code=counters" class="sref">counters /a>. a href="+codu=ce_count" class="srefu>ce_count /a>++;0         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=counters" class="sref">counters /a>. a href="+codu=ce_count" class="srefu>ce_count /a>++;00        if ( a href="+cod">edac_device_get_log_ue" class="sref">edac_device_get_log_ue /a>( a href="+code=edac_dev" class="sref">edac_dev /a>))n                 a href="+code=edac_device_printk" class="sref">edac_device_printk /a>( a href="+code=edac_dev" class="sref">edac_dev /a>,  a href="+code=KERNMERING" class="sref">KERNMERInr /a>,0              a>                 spai class="string">&quoU;CE: %s instance: %s block: %s '%s'\n"                                 a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,  a href="+code=instance" class="sref">instance /a>-> a href="+code=naml" class="sref">naml /a>,0                                 a href="+code=block" class="sref">block /a> ?  a href="+code=block" class="sref">block /a>-> a href="+code=naml" class="sref">naml /a> :  spai class="string">"N/A"msg /a>);00        if ( a href="+cod">edac_device_get_paiic_on_ue" class="sref">edac_device_get_paiic_on_ue /a>( a href="+code=edac_dev" class="sref">edac_dev /a>))n                 a href="+codt_paiev" class="sreft_paiue /a>  spai class="string">&quo">ED;s %sUE;s instance: %s blok: %s '%s'\n"                         a href="+code=edac_dev" class="sref">edac_dev /a>-> a href="+code=ctl_naml" class="sref">ctl_naml /a>,  a href="+code=instance" class="sref">instance /a>-> a href="+code=naml" class="sref">naml /a>,0                         a href="+code=block" class="sref">block /a> ?  a href="+code=block" class="sref">block /a>-> a href="+code=naml" class="sref">naml /a> :  spai class="string">"N/A"msg /a>);0 a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=edac_device_handle_ue" class="sref">edac_device_handle_ue /a>);0


T thoriginal LXR software byup th;0LXR ="counityml /a>r thiexperiommeal riveion byu;0lxt@="lux.nors /a
lxt.="lux.no kihany hosted byu;0Redpill L"lpro ASml /a>providerut oL"lux>, coulentint anoperations serdevis sitanc1995.