aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
authorDouglas Thompson <dougthompson@xmission.com>2007-07-19 04:49:36 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:53 -0400
commite27e3dac651771fe3250f6305dee277bce29fc5d (patch)
tree9c0ac81a0948d8e52a72865ff9fbae4a12031a32 /drivers/edac/edac_mc.c
parent7c9281d76c1c0b130f79d5fc021084e9749959d4 (diff)
drivers/edac: add edac_device class
This patch adds the new 'class' of object to be managed, named: 'edac_device'. As a peer of the 'edac_mc' class of object, it provides a non-memory centric view of an ERROR DETECTING device in hardware. It provides a sysfs interface and an abstraction for varioius EDAC type devices. Multiple 'instances' within the class are possible, with each 'instance' able to have multiple 'blocks', and each 'block' having 'attributes'. At the 'block' level there are the 'ce_count' and 'ue_count' fields which the device driver can update and/or call edac_device_handle_XX() functions. At each higher level are additional 'total' count fields, which are a summation of counts below that level. This 'edac_device' has been used to capture and present ECC errors which are found in a a L1 and L2 system on a per CORE/CPU basis. Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r--drivers/edac/edac_mc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 3be5b7fe79cd..1f22d8cad6f7 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -88,7 +88,7 @@ static void edac_mc_dump_mci(struct mem_ctl_info *mci)
88 * If 'size' is a constant, the compiler will optimize this whole function 88 * If 'size' is a constant, the compiler will optimize this whole function
89 * down to either a no-op or the addition of a constant to the value of 'ptr'. 89 * down to either a no-op or the addition of a constant to the value of 'ptr'.
90 */ 90 */
91static inline char * align_ptr(void *ptr, unsigned size) 91char * edac_align_ptr(void *ptr, unsigned size)
92{ 92{
93 unsigned align, r; 93 unsigned align, r;
94 94
@@ -147,10 +147,10 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
147 * hardcode everything into a single struct. 147 * hardcode everything into a single struct.
148 */ 148 */
149 mci = (struct mem_ctl_info *) 0; 149 mci = (struct mem_ctl_info *) 0;
150 csi = (struct csrow_info *)align_ptr(&mci[1], sizeof(*csi)); 150 csi = (struct csrow_info *)edac_align_ptr(&mci[1], sizeof(*csi));
151 chi = (struct channel_info *) 151 chi = (struct channel_info *)
152 align_ptr(&csi[nr_csrows], sizeof(*chi)); 152 edac_align_ptr(&csi[nr_csrows], sizeof(*chi));
153 pvt = align_ptr(&chi[nr_chans * nr_csrows], sz_pvt); 153 pvt = edac_align_ptr(&chi[nr_chans * nr_csrows], sz_pvt);
154 size = ((unsigned long) pvt) + sz_pvt; 154 size = ((unsigned long) pvt) + sz_pvt;
155 155
156 if ((mci = kmalloc(size, GFP_KERNEL)) == NULL) 156 if ((mci = kmalloc(size, GFP_KERNEL)) == NULL)