-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edac_mce: Add an interface driver to report mce errors via edac
edac_mce module is an interface module that gets mcelog data and forwards to any registered edac module that expects to receive data via mce. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
- Loading branch information
Mauro Carvalho Chehab
committed
May 10, 2010
1 parent
41fcb7f
commit 696e409
Showing
5 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* Provides edac interface to mcelog events | ||
* | ||
* This file may be distributed under the terms of the | ||
* GNU General Public License version 2. | ||
* | ||
* Copyright (c) 2009 by: | ||
* Mauro Carvalho Chehab <mchehab@redhat.com> | ||
* | ||
* Red Hat Inc. http://www.redhat.com | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/edac_mce.h> | ||
#include <asm/mce.h> | ||
|
||
int edac_mce_enabled; | ||
EXPORT_SYMBOL_GPL(edac_mce_enabled); | ||
|
||
|
||
/* | ||
* Extension interface | ||
*/ | ||
|
||
static LIST_HEAD(edac_mce_list); | ||
static DEFINE_MUTEX(edac_mce_lock); | ||
|
||
int edac_mce_register(struct edac_mce *edac_mce) | ||
{ | ||
mutex_lock(&edac_mce_lock); | ||
list_add_tail(&edac_mce->list, &edac_mce_list); | ||
mutex_unlock(&edac_mce_lock); | ||
return 0; | ||
} | ||
EXPORT_SYMBOL(edac_mce_register); | ||
|
||
void edac_mce_unregister(struct edac_mce *edac_mce) | ||
{ | ||
mutex_lock(&edac_mce_lock); | ||
list_del(&edac_mce->list); | ||
mutex_unlock(&edac_mce_lock); | ||
} | ||
EXPORT_SYMBOL(edac_mce_unregister); | ||
|
||
|
||
|
||
int edac_mce_queue(struct mce *mce) | ||
{ | ||
struct edac_mce *edac_mce; | ||
|
||
list_for_each_entry(edac_mce, &edac_mce_list, list) { | ||
if (edac_mce->check_error(edac_mce->priv, mce)) | ||
return 1; | ||
} | ||
|
||
/* Nobody queued the error */ | ||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(edac_mce_queue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Provides edac interface to mcelog events | ||
* | ||
* This file may be distributed under the terms of the | ||
* GNU General Public License version 2. | ||
* | ||
* Copyright (c) 2009 by: | ||
* Mauro Carvalho Chehab <mchehab@redhat.com> | ||
* | ||
* Red Hat Inc. http://www.redhat.com | ||
*/ | ||
|
||
#if defined(CONFIG_EDAC_MCE) || \ | ||
(defined(CONFIG_EDAC_MCE_MODULE) && defined(MODULE)) | ||
|
||
#include <asm/mce.h> | ||
#include <linux/list.h> | ||
|
||
struct edac_mce { | ||
struct list_head list; | ||
|
||
void *priv; | ||
int (*check_error)(void *priv, struct mce *mce); | ||
}; | ||
|
||
int edac_mce_register(struct edac_mce *edac_mce); | ||
void edac_mce_unregister(struct edac_mce *edac_mce); | ||
int edac_mce_parse(struct mce *mce); | ||
|
||
#else | ||
#define edac_mce_parse(mce) (0) | ||
#endif |