Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * edac_device.c |
| 4 | * (C) 2007 www.douglaskthompson.com |
| 5 | * |
| 6 | * This file may be distributed under the terms of the |
| 7 | * GNU General Public License. |
| 8 | * |
| 9 | * Written by Doug Thompson <norsk5@xmission.com> |
| 10 | * |
| 11 | * edac_device API implementation |
| 12 | * 19 Jan 2007 |
| 13 | */ |
| 14 | |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/types.h> |
| 17 | #include <linux/smp.h> |
| 18 | #include <linux/init.h> |
| 19 | #include <linux/sysctl.h> |
| 20 | #include <linux/highmem.h> |
| 21 | #include <linux/timer.h> |
| 22 | #include <linux/slab.h> |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 23 | #include <linux/jiffies.h> |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 24 | #include <linux/spinlock.h> |
| 25 | #include <linux/list.h> |
| 26 | #include <linux/sysdev.h> |
| 27 | #include <linux/ctype.h> |
| 28 | #include <linux/workqueue.h> |
| 29 | #include <asm/uaccess.h> |
| 30 | #include <asm/page.h> |
| 31 | |
| 32 | #include "edac_core.h" |
| 33 | #include "edac_module.h" |
| 34 | |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 35 | /* lock to memory controller's control array 'edac_device_list' */ |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 36 | static DEFINE_MUTEX(device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 37 | static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list); |
| 38 | |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 39 | #ifdef CONFIG_EDAC_DEBUG |
| 40 | static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev) |
| 41 | { |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 42 | debugf3("\tedac_dev = %p dev_idx=%d \n", edac_dev, edac_dev->dev_idx); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 43 | debugf4("\tedac_dev->edac_check = %p\n", edac_dev->edac_check); |
| 44 | debugf3("\tdev = %p\n", edac_dev->dev); |
| 45 | debugf3("\tmod_name:ctl_name = %s:%s\n", |
| 46 | edac_dev->mod_name, edac_dev->ctl_name); |
| 47 | debugf3("\tpvt_info = %p\n\n", edac_dev->pvt_info); |
| 48 | } |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 49 | #endif /* CONFIG_EDAC_DEBUG */ |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 50 | |
| 51 | /* |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 52 | * edac_device_alloc_ctl_info() |
| 53 | * Allocate a new edac device control info structure |
| 54 | * |
| 55 | * The control structure is allocated in complete chunk |
| 56 | * from the OS. It is in turn sub allocated to the |
| 57 | * various objects that compose the struture |
| 58 | * |
| 59 | * The structure has a 'nr_instance' array within itself. |
| 60 | * Each instance represents a major component |
| 61 | * Example: L1 cache and L2 cache are 2 instance components |
| 62 | * |
| 63 | * Within each instance is an array of 'nr_blocks' blockoffsets |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 64 | */ |
| 65 | struct edac_device_ctl_info *edac_device_alloc_ctl_info( |
| 66 | unsigned sz_private, |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 67 | char *edac_device_name, unsigned nr_instances, |
| 68 | char *edac_block_name, unsigned nr_blocks, |
| 69 | unsigned offset_value, /* zero, 1, or other based offset */ |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 70 | struct edac_dev_sysfs_block_attribute *attrib_spec, unsigned nr_attrib) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 71 | { |
| 72 | struct edac_device_ctl_info *dev_ctl; |
| 73 | struct edac_device_instance *dev_inst, *inst; |
| 74 | struct edac_device_block *dev_blk, *blk_p, *blk; |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 75 | struct edac_dev_sysfs_block_attribute *dev_attrib, *attrib_p, *attrib; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 76 | unsigned total_size; |
| 77 | unsigned count; |
| 78 | unsigned instance, block, attr; |
| 79 | void *pvt; |
| 80 | |
| 81 | debugf1("%s() instances=%d blocks=%d\n", |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 82 | __func__, nr_instances, nr_blocks); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 83 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 84 | /* Calculate the size of memory we need to allocate AND |
| 85 | * determine the offsets of the various item arrays |
| 86 | * (instance,block,attrib) from the start of an allocated structure. |
| 87 | * We want the alignment of each item (instance,block,attrib) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 88 | * to be at least as stringent as what the compiler would |
| 89 | * provide if we could simply hardcode everything into a single struct. |
| 90 | */ |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 91 | dev_ctl = (struct edac_device_ctl_info *)NULL; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 92 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 93 | /* Calc the 'end' offset past end of ONE ctl_info structure |
| 94 | * which will become the start of the 'instance' array |
| 95 | */ |
Douglas Thompson | 7391c6d | 2007-07-19 01:50:21 -0700 | [diff] [blame] | 96 | dev_inst = edac_align_ptr(&dev_ctl[1], sizeof(*dev_inst)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 97 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 98 | /* Calc the 'end' offset past the instance array within the ctl_info |
| 99 | * which will become the start of the block array |
| 100 | */ |
Douglas Thompson | 7391c6d | 2007-07-19 01:50:21 -0700 | [diff] [blame] | 101 | dev_blk = edac_align_ptr(&dev_inst[nr_instances], sizeof(*dev_blk)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 102 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 103 | /* Calc the 'end' offset past the dev_blk array |
| 104 | * which will become the start of the attrib array, if any. |
| 105 | */ |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 106 | count = nr_instances * nr_blocks; |
Douglas Thompson | 7391c6d | 2007-07-19 01:50:21 -0700 | [diff] [blame] | 107 | dev_attrib = edac_align_ptr(&dev_blk[count], sizeof(*dev_attrib)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 108 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 109 | /* Check for case of when an attribute array is specified */ |
| 110 | if (nr_attrib > 0) { |
| 111 | /* calc how many nr_attrib we need */ |
| 112 | count *= nr_attrib; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 113 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 114 | /* Calc the 'end' offset past the attributes array */ |
| 115 | pvt = edac_align_ptr(&dev_attrib[count], sz_private); |
| 116 | } else { |
| 117 | /* no attribute array specificed */ |
| 118 | pvt = edac_align_ptr(dev_attrib, sz_private); |
| 119 | } |
| 120 | |
| 121 | /* 'pvt' now points to where the private data area is. |
| 122 | * At this point 'pvt' (like dev_inst,dev_blk and dev_attrib) |
| 123 | * is baselined at ZERO |
| 124 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 125 | total_size = ((unsigned long)pvt) + sz_private; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 126 | |
| 127 | /* Allocate the amount of memory for the set of control structures */ |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 128 | dev_ctl = kzalloc(total_size, GFP_KERNEL); |
| 129 | if (dev_ctl == NULL) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 130 | return NULL; |
| 131 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 132 | /* Adjust pointers so they point within the actual memory we |
| 133 | * just allocated rather than an imaginary chunk of memory |
| 134 | * located at address 0. |
| 135 | * 'dev_ctl' points to REAL memory, while the others are |
| 136 | * ZERO based and thus need to be adjusted to point within |
| 137 | * the allocated memory. |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 138 | */ |
| 139 | dev_inst = (struct edac_device_instance *) |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 140 | (((char *)dev_ctl) + ((unsigned long)dev_inst)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 141 | dev_blk = (struct edac_device_block *) |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 142 | (((char *)dev_ctl) + ((unsigned long)dev_blk)); |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 143 | dev_attrib = (struct edac_dev_sysfs_block_attribute *) |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 144 | (((char *)dev_ctl) + ((unsigned long)dev_attrib)); |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 145 | pvt = sz_private ? (((char *)dev_ctl) + ((unsigned long)pvt)) : NULL; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 146 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 147 | /* Begin storing the information into the control info structure */ |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 148 | dev_ctl->nr_instances = nr_instances; |
| 149 | dev_ctl->instances = dev_inst; |
| 150 | dev_ctl->pvt_info = pvt; |
| 151 | |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 152 | /* Name of this edac device */ |
| 153 | snprintf(dev_ctl->name,sizeof(dev_ctl->name),"%s",edac_device_name); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 154 | |
| 155 | /* Initialize every Instance */ |
| 156 | for (instance = 0; instance < nr_instances; instance++) { |
| 157 | inst = &dev_inst[instance]; |
| 158 | inst->ctl = dev_ctl; |
| 159 | inst->nr_blocks = nr_blocks; |
| 160 | blk_p = &dev_blk[instance * nr_blocks]; |
| 161 | inst->blocks = blk_p; |
| 162 | |
| 163 | /* name of this instance */ |
| 164 | snprintf(inst->name, sizeof(inst->name), |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 165 | "%s%u", edac_device_name, instance); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 166 | |
| 167 | /* Initialize every block in each instance */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 168 | for (block = 0; block < nr_blocks; block++) { |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 169 | blk = &blk_p[block]; |
| 170 | blk->instance = inst; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 171 | snprintf(blk->name, sizeof(blk->name), |
Douglas Thompson | d391a7b | 2007-07-19 01:50:11 -0700 | [diff] [blame] | 172 | "%s%d", edac_block_name, block+offset_value); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 173 | |
| 174 | debugf1("%s() instance=%d block=%d name=%s\n", |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 175 | __func__, instance, block, blk->name); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 176 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 177 | /* if there are NO attributes OR no attribute pointer |
| 178 | * then continue on to next block iteration |
| 179 | */ |
| 180 | if ((nr_attrib == 0) || (attrib_spec == NULL)) |
| 181 | continue; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 182 | |
Douglas Thompson | fd309a9d | 2007-07-19 01:50:25 -0700 | [diff] [blame^] | 183 | /* setup the attribute array for this block */ |
| 184 | blk->nr_attribs = nr_attrib; |
| 185 | attrib_p = &dev_attrib[block*nr_instances*nr_attrib]; |
| 186 | blk->block_attributes = attrib_p; |
| 187 | |
| 188 | /* Initialize every user specified attribute in this |
| 189 | * block with the data the caller passed in |
| 190 | */ |
| 191 | for (attr = 0; attr < nr_attrib; attr++) { |
| 192 | attrib = &attrib_p[attr]; |
| 193 | attrib->attr = attrib_spec->attr; |
| 194 | attrib->show = attrib_spec->show; |
| 195 | attrib->store = attrib_spec->store; |
| 196 | |
| 197 | /* up reference this block */ |
| 198 | attrib->block = blk; |
| 199 | |
| 200 | /* bump the attrib_spec */ |
| 201 | attrib_spec++; |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /* Mark this instance as merely ALLOCATED */ |
| 207 | dev_ctl->op_state = OP_ALLOC; |
| 208 | |
| 209 | return dev_ctl; |
| 210 | } |
| 211 | EXPORT_SYMBOL_GPL(edac_device_alloc_ctl_info); |
| 212 | |
| 213 | /* |
| 214 | * edac_device_free_ctl_info() |
| 215 | * frees the memory allocated by the edac_device_alloc_ctl_info() |
| 216 | * function |
| 217 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 218 | void edac_device_free_ctl_info(struct edac_device_ctl_info *ctl_info) |
| 219 | { |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 220 | kfree(ctl_info); |
| 221 | } |
| 222 | EXPORT_SYMBOL_GPL(edac_device_free_ctl_info); |
| 223 | |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 224 | /* |
| 225 | * find_edac_device_by_dev |
| 226 | * scans the edac_device list for a specific 'struct device *' |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 227 | * |
| 228 | * lock to be held prior to call: device_ctls_mutex |
| 229 | * |
| 230 | * Return: |
| 231 | * pointer to control structure managing 'dev' |
| 232 | * NULL if not found on list |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 233 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 234 | static struct edac_device_ctl_info *find_edac_device_by_dev(struct device *dev) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 235 | { |
| 236 | struct edac_device_ctl_info *edac_dev; |
| 237 | struct list_head *item; |
| 238 | |
| 239 | debugf3("%s()\n", __func__); |
| 240 | |
| 241 | list_for_each(item, &edac_device_list) { |
| 242 | edac_dev = list_entry(item, struct edac_device_ctl_info, link); |
| 243 | |
| 244 | if (edac_dev->dev == dev) |
| 245 | return edac_dev; |
| 246 | } |
| 247 | |
| 248 | return NULL; |
| 249 | } |
| 250 | |
| 251 | /* |
| 252 | * add_edac_dev_to_global_list |
| 253 | * Before calling this function, caller must |
| 254 | * assign a unique value to edac_dev->dev_idx. |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 255 | * |
| 256 | * lock to be held prior to call: device_ctls_mutex |
| 257 | * |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 258 | * Return: |
| 259 | * 0 on success |
| 260 | * 1 on failure. |
| 261 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 262 | static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 263 | { |
| 264 | struct list_head *item, *insert_before; |
| 265 | struct edac_device_ctl_info *rover; |
| 266 | |
| 267 | insert_before = &edac_device_list; |
| 268 | |
| 269 | /* Determine if already on the list */ |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 270 | rover = find_edac_device_by_dev(edac_dev->dev); |
| 271 | if (unlikely(rover != NULL)) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 272 | goto fail0; |
| 273 | |
| 274 | /* Insert in ascending order by 'dev_idx', so find position */ |
| 275 | list_for_each(item, &edac_device_list) { |
| 276 | rover = list_entry(item, struct edac_device_ctl_info, link); |
| 277 | |
| 278 | if (rover->dev_idx >= edac_dev->dev_idx) { |
| 279 | if (unlikely(rover->dev_idx == edac_dev->dev_idx)) |
| 280 | goto fail1; |
| 281 | |
| 282 | insert_before = item; |
| 283 | break; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | list_add_tail_rcu(&edac_dev->link, insert_before); |
| 288 | return 0; |
| 289 | |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 290 | fail0: |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 291 | edac_printk(KERN_WARNING, EDAC_MC, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 292 | "%s (%s) %s %s already assigned %d\n", |
| 293 | rover->dev->bus_id, dev_name(rover), |
| 294 | rover->mod_name, rover->ctl_name, rover->dev_idx); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 295 | return 1; |
| 296 | |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 297 | fail1: |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 298 | edac_printk(KERN_WARNING, EDAC_MC, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 299 | "bug in low-level driver: attempt to assign\n" |
| 300 | " duplicate dev_idx %d in %s()\n", rover->dev_idx, |
| 301 | __func__); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 302 | return 1; |
| 303 | } |
| 304 | |
| 305 | /* |
| 306 | * complete_edac_device_list_del |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 307 | * |
| 308 | * callback function when reference count is zero |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 309 | */ |
| 310 | static void complete_edac_device_list_del(struct rcu_head *head) |
| 311 | { |
| 312 | struct edac_device_ctl_info *edac_dev; |
| 313 | |
| 314 | edac_dev = container_of(head, struct edac_device_ctl_info, rcu); |
| 315 | INIT_LIST_HEAD(&edac_dev->link); |
| 316 | complete(&edac_dev->complete); |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | * del_edac_device_from_global_list |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 321 | * |
| 322 | * remove the RCU, setup for a callback call, then wait for the |
| 323 | * callback to occur |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 324 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 325 | static void del_edac_device_from_global_list(struct edac_device_ctl_info |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 326 | *edac_device) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 327 | { |
| 328 | list_del_rcu(&edac_device->link); |
| 329 | init_completion(&edac_device->complete); |
| 330 | call_rcu(&edac_device->rcu, complete_edac_device_list_del); |
| 331 | wait_for_completion(&edac_device->complete); |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * edac_device_find |
| 336 | * Search for a edac_device_ctl_info structure whose index is 'idx'. |
| 337 | * |
| 338 | * If found, return a pointer to the structure. |
| 339 | * Else return NULL. |
| 340 | * |
| 341 | * Caller must hold device_ctls_mutex. |
| 342 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 343 | struct edac_device_ctl_info *edac_device_find(int idx) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 344 | { |
| 345 | struct list_head *item; |
| 346 | struct edac_device_ctl_info *edac_dev; |
| 347 | |
| 348 | /* Iterate over list, looking for exact match of ID */ |
| 349 | list_for_each(item, &edac_device_list) { |
| 350 | edac_dev = list_entry(item, struct edac_device_ctl_info, link); |
| 351 | |
| 352 | if (edac_dev->dev_idx >= idx) { |
| 353 | if (edac_dev->dev_idx == idx) |
| 354 | return edac_dev; |
| 355 | |
| 356 | /* not on list, so terminate early */ |
| 357 | break; |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | return NULL; |
| 362 | } |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 363 | EXPORT_SYMBOL_GPL(edac_device_find); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 364 | |
| 365 | /* |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 366 | * edac_device_workq_function |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 367 | * performs the operation scheduled by a workq request |
| 368 | */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 369 | static void edac_device_workq_function(struct work_struct *work_req) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 370 | { |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 371 | struct delayed_work *d_work = (struct delayed_work *)work_req; |
| 372 | struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 373 | |
| 374 | //debugf0("%s() here and running\n", __func__); |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 375 | mutex_lock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 376 | |
| 377 | /* Only poll controllers that are running polled and have a check */ |
| 378 | if ((edac_dev->op_state == OP_RUNNING_POLL) && |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 379 | (edac_dev->edac_check != NULL)) { |
| 380 | edac_dev->edac_check(edac_dev); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 381 | } |
| 382 | |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 383 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 384 | |
| 385 | /* Reschedule */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 386 | queue_delayed_work(edac_workqueue, &edac_dev->work, edac_dev->delay); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | /* |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 390 | * edac_device_workq_setup |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 391 | * initialize a workq item for this edac_device instance |
| 392 | * passing in the new delay period in msec |
| 393 | */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 394 | void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 395 | unsigned msec) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 396 | { |
| 397 | debugf0("%s()\n", __func__); |
| 398 | |
| 399 | edac_dev->poll_msec = msec; |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 400 | edac_dev->delay = msecs_to_jiffies(msec); /* Calc delay jiffies */ |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 401 | |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 402 | INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 403 | queue_delayed_work(edac_workqueue, &edac_dev->work, edac_dev->delay); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | /* |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 407 | * edac_device_workq_teardown |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 408 | * stop the workq processing on this edac_dev |
| 409 | */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 410 | void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 411 | { |
| 412 | int status; |
| 413 | |
| 414 | status = cancel_delayed_work(&edac_dev->work); |
| 415 | if (status == 0) { |
| 416 | /* workq instance might be running, wait for it */ |
| 417 | flush_workqueue(edac_workqueue); |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | * edac_device_reset_delay_period |
| 423 | */ |
| 424 | |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 425 | void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 426 | unsigned long value) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 427 | { |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 428 | mutex_lock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 429 | |
| 430 | /* cancel the current workq request */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 431 | edac_device_workq_teardown(edac_dev); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 432 | |
| 433 | /* restart the workq request, with new delay value */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 434 | edac_device_workq_setup(edac_dev, value); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 435 | |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 436 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 437 | } |
| 438 | |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 439 | /** |
| 440 | * edac_device_add_device: Insert the 'edac_dev' structure into the |
| 441 | * edac_device global list and create sysfs entries associated with |
| 442 | * edac_device structure. |
| 443 | * @edac_device: pointer to the edac_device structure to be added to the list |
| 444 | * @edac_idx: A unique numeric identifier to be assigned to the |
| 445 | * 'edac_device' structure. |
| 446 | * |
| 447 | * Return: |
| 448 | * 0 Success |
| 449 | * !0 Failure |
| 450 | */ |
| 451 | int edac_device_add_device(struct edac_device_ctl_info *edac_dev, int edac_idx) |
| 452 | { |
| 453 | debugf0("%s()\n", __func__); |
| 454 | |
| 455 | edac_dev->dev_idx = edac_idx; |
| 456 | #ifdef CONFIG_EDAC_DEBUG |
| 457 | if (edac_debug_level >= 3) |
| 458 | edac_device_dump_device(edac_dev); |
| 459 | #endif |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 460 | mutex_lock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 461 | |
| 462 | if (add_edac_dev_to_global_list(edac_dev)) |
| 463 | goto fail0; |
| 464 | |
| 465 | /* set load time so that error rate can be tracked */ |
| 466 | edac_dev->start_time = jiffies; |
| 467 | |
| 468 | /* create this instance's sysfs entries */ |
| 469 | if (edac_device_create_sysfs(edac_dev)) { |
| 470 | edac_device_printk(edac_dev, KERN_WARNING, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 471 | "failed to create sysfs device\n"); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 472 | goto fail1; |
| 473 | } |
| 474 | |
| 475 | /* If there IS a check routine, then we are running POLLED */ |
| 476 | if (edac_dev->edac_check != NULL) { |
| 477 | /* This instance is NOW RUNNING */ |
| 478 | edac_dev->op_state = OP_RUNNING_POLL; |
| 479 | |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 480 | /* |
| 481 | * enable workq processing on this instance, |
| 482 | * default = 1000 msec |
| 483 | */ |
| 484 | edac_device_workq_setup(edac_dev, 1000); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 485 | } else { |
| 486 | edac_dev->op_state = OP_RUNNING_INTERRUPT; |
| 487 | } |
| 488 | |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 489 | /* Report action taken */ |
| 490 | edac_device_printk(edac_dev, KERN_INFO, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 491 | "Giving out device to module '%s' controller " |
| 492 | "'%s': DEV '%s' (%s)\n", |
| 493 | edac_dev->mod_name, |
| 494 | edac_dev->ctl_name, |
| 495 | dev_name(edac_dev), |
Douglas Thompson | 494d0d5 | 2007-07-19 01:50:21 -0700 | [diff] [blame] | 496 | edac_op_state_to_string(edac_dev->op_state)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 497 | |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 498 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 499 | return 0; |
| 500 | |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 501 | fail1: |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 502 | /* Some error, so remove the entry from the lsit */ |
| 503 | del_edac_device_from_global_list(edac_dev); |
| 504 | |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 505 | fail0: |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 506 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 507 | return 1; |
| 508 | } |
| 509 | EXPORT_SYMBOL_GPL(edac_device_add_device); |
| 510 | |
| 511 | /** |
| 512 | * edac_device_del_device: |
| 513 | * Remove sysfs entries for specified edac_device structure and |
| 514 | * then remove edac_device structure from global list |
| 515 | * |
| 516 | * @pdev: |
| 517 | * Pointer to 'struct device' representing edac_device |
| 518 | * structure to remove. |
| 519 | * |
| 520 | * Return: |
| 521 | * Pointer to removed edac_device structure, |
| 522 | * OR NULL if device not found. |
| 523 | */ |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 524 | struct edac_device_ctl_info *edac_device_del_device(struct device *dev) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 525 | { |
| 526 | struct edac_device_ctl_info *edac_dev; |
| 527 | |
| 528 | debugf0("MC: %s()\n", __func__); |
| 529 | |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 530 | mutex_lock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 531 | |
Douglas Thompson | 52490c8 | 2007-07-19 01:50:20 -0700 | [diff] [blame] | 532 | /* Find the structure on the list, if not there, then leave */ |
| 533 | edac_dev = find_edac_device_by_dev(dev); |
| 534 | if (edac_dev == NULL) { |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 535 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 536 | return NULL; |
| 537 | } |
| 538 | |
| 539 | /* mark this instance as OFFLINE */ |
| 540 | edac_dev->op_state = OP_OFFLINE; |
| 541 | |
| 542 | /* clear workq processing on this instance */ |
Dave Jiang | 81d87cb | 2007-07-19 01:49:52 -0700 | [diff] [blame] | 543 | edac_device_workq_teardown(edac_dev); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 544 | |
| 545 | /* Tear down the sysfs entries for this instance */ |
| 546 | edac_device_remove_sysfs(edac_dev); |
| 547 | |
| 548 | /* deregister from global list */ |
| 549 | del_edac_device_from_global_list(edac_dev); |
| 550 | |
Doug Thompson | 0ca8476 | 2007-07-19 01:50:22 -0700 | [diff] [blame] | 551 | mutex_unlock(&device_ctls_mutex); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 552 | |
| 553 | edac_printk(KERN_INFO, EDAC_MC, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 554 | "Removed device %d for %s %s: DEV %s\n", |
| 555 | edac_dev->dev_idx, |
| 556 | edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev)); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 557 | |
| 558 | return edac_dev; |
| 559 | } |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 560 | EXPORT_SYMBOL_GPL(edac_device_del_device); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 561 | |
| 562 | static inline int edac_device_get_log_ce(struct edac_device_ctl_info *edac_dev) |
| 563 | { |
| 564 | return edac_dev->log_ce; |
| 565 | } |
| 566 | |
| 567 | static inline int edac_device_get_log_ue(struct edac_device_ctl_info *edac_dev) |
| 568 | { |
| 569 | return edac_dev->log_ue; |
| 570 | } |
| 571 | |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 572 | static inline int edac_device_get_panic_on_ue(struct edac_device_ctl_info |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 573 | *edac_dev) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 574 | { |
| 575 | return edac_dev->panic_on_ue; |
| 576 | } |
| 577 | |
| 578 | /* |
| 579 | * edac_device_handle_ce |
| 580 | * perform a common output and handling of an 'edac_dev' CE event |
| 581 | */ |
| 582 | void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 583 | int inst_nr, int block_nr, const char *msg) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 584 | { |
| 585 | struct edac_device_instance *instance; |
| 586 | struct edac_device_block *block = NULL; |
| 587 | |
| 588 | if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { |
| 589 | edac_device_printk(edac_dev, KERN_ERR, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 590 | "INTERNAL ERROR: 'instance' out of range " |
| 591 | "(%d >= %d)\n", inst_nr, |
| 592 | edac_dev->nr_instances); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 593 | return; |
| 594 | } |
| 595 | |
| 596 | instance = edac_dev->instances + inst_nr; |
| 597 | |
| 598 | if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { |
| 599 | edac_device_printk(edac_dev, KERN_ERR, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 600 | "INTERNAL ERROR: instance %d 'block' " |
| 601 | "out of range (%d >= %d)\n", |
| 602 | inst_nr, block_nr, |
| 603 | instance->nr_blocks); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 604 | return; |
| 605 | } |
| 606 | |
| 607 | if (instance->nr_blocks > 0) { |
| 608 | block = instance->blocks + block_nr; |
| 609 | block->counters.ce_count++; |
| 610 | } |
| 611 | |
| 612 | /* Propogate the count up the 'totals' tree */ |
| 613 | instance->counters.ce_count++; |
| 614 | edac_dev->counters.ce_count++; |
| 615 | |
| 616 | if (edac_device_get_log_ce(edac_dev)) |
| 617 | edac_device_printk(edac_dev, KERN_WARNING, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 618 | "CE: %s instance: %s block: %s '%s'\n", |
| 619 | edac_dev->ctl_name, instance->name, |
| 620 | block ? block->name : "N/A", msg); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 621 | } |
| 622 | EXPORT_SYMBOL_GPL(edac_device_handle_ce); |
| 623 | |
| 624 | /* |
| 625 | * edac_device_handle_ue |
| 626 | * perform a common output and handling of an 'edac_dev' UE event |
| 627 | */ |
| 628 | void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 629 | int inst_nr, int block_nr, const char *msg) |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 630 | { |
| 631 | struct edac_device_instance *instance; |
| 632 | struct edac_device_block *block = NULL; |
| 633 | |
| 634 | if ((inst_nr >= edac_dev->nr_instances) || (inst_nr < 0)) { |
| 635 | edac_device_printk(edac_dev, KERN_ERR, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 636 | "INTERNAL ERROR: 'instance' out of range " |
| 637 | "(%d >= %d)\n", inst_nr, |
| 638 | edac_dev->nr_instances); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 639 | return; |
| 640 | } |
| 641 | |
| 642 | instance = edac_dev->instances + inst_nr; |
| 643 | |
| 644 | if ((block_nr >= instance->nr_blocks) || (block_nr < 0)) { |
| 645 | edac_device_printk(edac_dev, KERN_ERR, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 646 | "INTERNAL ERROR: instance %d 'block' " |
| 647 | "out of range (%d >= %d)\n", |
| 648 | inst_nr, block_nr, |
| 649 | instance->nr_blocks); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 650 | return; |
| 651 | } |
| 652 | |
| 653 | if (instance->nr_blocks > 0) { |
| 654 | block = instance->blocks + block_nr; |
| 655 | block->counters.ue_count++; |
| 656 | } |
| 657 | |
| 658 | /* Propogate the count up the 'totals' tree */ |
| 659 | instance->counters.ue_count++; |
| 660 | edac_dev->counters.ue_count++; |
| 661 | |
| 662 | if (edac_device_get_log_ue(edac_dev)) |
| 663 | edac_device_printk(edac_dev, KERN_EMERG, |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 664 | "UE: %s instance: %s block: %s '%s'\n", |
| 665 | edac_dev->ctl_name, instance->name, |
| 666 | block ? block->name : "N/A", msg); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 667 | |
| 668 | if (edac_device_get_panic_on_ue(edac_dev)) |
Douglas Thompson | d391a7b | 2007-07-19 01:50:11 -0700 | [diff] [blame] | 669 | panic("EDAC %s: UE instance: %s block %s '%s'\n", |
Douglas Thompson | 052dfb4 | 2007-07-19 01:50:13 -0700 | [diff] [blame] | 670 | edac_dev->ctl_name, instance->name, |
| 671 | block ? block->name : "N/A", msg); |
Douglas Thompson | e27e3da | 2007-07-19 01:49:36 -0700 | [diff] [blame] | 672 | } |
Douglas Thompson | 079708b | 2007-07-19 01:49:58 -0700 | [diff] [blame] | 673 | EXPORT_SYMBOL_GPL(edac_device_handle_ue); |