aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_core.h
diff options
context:
space:
mode:
authorDave Jiang <djiang@mvista.com>2007-07-19 01:49:52 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 10:04:54 -0700
commit81d87cb13e367bb804bf44889ae0de7369705d6c (patch)
tree1c135cb57d92ae3baf2b3308f01fb548ab39f644 /drivers/edac/edac_core.h
parentdrivers/edac: new inte 30x0 MC driver (diff)
downloadlinux-dev-81d87cb13e367bb804bf44889ae0de7369705d6c.tar.xz
linux-dev-81d87cb13e367bb804bf44889ae0de7369705d6c.zip
drivers/edac: mod MC to use workq instead of kthread
Move the memory controller object to work queue based implementation from the kernel thread based. Signed-off-by: Dave Jiang <djiang@mvista.com> 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_core.h')
-rw-r--r--drivers/edac/edac_core.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index f34ebb609d55..b73d659a4bb2 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -382,6 +382,15 @@ struct mem_ctl_info {
/* edac sysfs device control */
struct kobject edac_mci_kobj;
struct completion kobj_complete;
+
+ /* work struct for this MC */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
+ struct delayed_work work;
+#else
+ struct work_struct work;
+#endif
+ /* the internal state of this controller instance */
+ int op_state;
};
/*
@@ -573,6 +582,9 @@ struct edac_device_ctl_info {
};
/* To get from the instance's wq to the beginning of the ctl structure */
+#define to_edac_mem_ctl_work(w) \
+ container_of(w, struct mem_ctl_info, work)
+
#define to_edac_device_ctl_work(w) \
container_of(w,struct edac_device_ctl_info,work)
@@ -584,6 +596,8 @@ static inline void edac_device_calc_delay(
edac_dev->delay = edac_dev->poll_msec * HZ / 1000;
}
+#define edac_calc_delay(dev) dev->delay = dev->poll_msec * HZ / 1000;
+
/*
* The alloc() and free() functions for the 'edac_device' control info
* structure. A MC driver will allocate one of these for each edac_device