Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
715a4318
Commit
715a4318
authored
Dec 15, 2011
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'early-mce-decode' of
git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
into x86/mce
parents
29e9bf18
09371957
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
16 deletions
+65
-16
arch/x86/include/asm/mce.h
arch/x86/include/asm/mce.h
+2
-1
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mcheck/mce.c
+57
-7
drivers/edac/i7core_edac.c
drivers/edac/i7core_edac.c
+2
-2
drivers/edac/mce_amd.c
drivers/edac/mce_amd.c
+2
-2
drivers/edac/sb_edac.c
drivers/edac/sb_edac.c
+2
-4
No files found.
arch/x86/include/asm/mce.h
View file @
715a4318
...
@@ -120,7 +120,8 @@ struct mce_log {
...
@@ -120,7 +120,8 @@ struct mce_log {
#ifdef __KERNEL__
#ifdef __KERNEL__
extern
struct
atomic_notifier_head
x86_mce_decoder_chain
;
extern
void
mce_register_decode_chain
(
struct
notifier_block
*
nb
);
extern
void
mce_unregister_decode_chain
(
struct
notifier_block
*
nb
);
#include <linux/percpu.h>
#include <linux/percpu.h>
#include <linux/init.h>
#include <linux/init.h>
...
...
arch/x86/kernel/cpu/mcheck/mce.c
View file @
715a4318
...
@@ -95,13 +95,6 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_chrdev_wait);
...
@@ -95,13 +95,6 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_chrdev_wait);
static
DEFINE_PER_CPU
(
struct
mce
,
mces_seen
);
static
DEFINE_PER_CPU
(
struct
mce
,
mces_seen
);
static
int
cpu_missing
;
static
int
cpu_missing
;
/*
* CPU/chipset specific EDAC code can register a notifier call here to print
* MCE errors in a human-readable form.
*/
ATOMIC_NOTIFIER_HEAD
(
x86_mce_decoder_chain
);
EXPORT_SYMBOL_GPL
(
x86_mce_decoder_chain
);
/* MCA banks polled by the period polling timer for corrected events */
/* MCA banks polled by the period polling timer for corrected events */
DEFINE_PER_CPU
(
mce_banks_t
,
mce_poll_banks
)
=
{
DEFINE_PER_CPU
(
mce_banks_t
,
mce_poll_banks
)
=
{
[
0
...
BITS_TO_LONGS
(
MAX_NR_BANKS
)
-
1
]
=
~
0UL
[
0
...
BITS_TO_LONGS
(
MAX_NR_BANKS
)
-
1
]
=
~
0UL
...
@@ -109,6 +102,12 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
...
@@ -109,6 +102,12 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
static
DEFINE_PER_CPU
(
struct
work_struct
,
mce_work
);
static
DEFINE_PER_CPU
(
struct
work_struct
,
mce_work
);
/*
* CPU/chipset specific EDAC code can register a notifier call here to print
* MCE errors in a human-readable form.
*/
ATOMIC_NOTIFIER_HEAD
(
x86_mce_decoder_chain
);
/* Do initial initialization of a struct mce */
/* Do initial initialization of a struct mce */
void
mce_setup
(
struct
mce
*
m
)
void
mce_setup
(
struct
mce
*
m
)
{
{
...
@@ -190,6 +189,57 @@ void mce_log(struct mce *mce)
...
@@ -190,6 +189,57 @@ void mce_log(struct mce *mce)
set_bit
(
0
,
&
mce_need_notify
);
set_bit
(
0
,
&
mce_need_notify
);
}
}
static
void
drain_mcelog_buffer
(
void
)
{
unsigned
int
next
,
i
,
prev
=
0
;
next
=
rcu_dereference_check_mce
(
mcelog
.
next
);
do
{
struct
mce
*
m
;
/* drain what was logged during boot */
for
(
i
=
prev
;
i
<
next
;
i
++
)
{
unsigned
long
start
=
jiffies
;
unsigned
retries
=
1
;
m
=
&
mcelog
.
entry
[
i
];
while
(
!
m
->
finished
)
{
if
(
time_after_eq
(
jiffies
,
start
+
2
*
retries
))
retries
++
;
cpu_relax
();
if
(
!
m
->
finished
&&
retries
>=
4
)
{
pr_err
(
"MCE: skipping error being logged currently!
\n
"
);
break
;
}
}
smp_rmb
();
atomic_notifier_call_chain
(
&
x86_mce_decoder_chain
,
0
,
m
);
}
memset
(
mcelog
.
entry
+
prev
,
0
,
(
next
-
prev
)
*
sizeof
(
*
m
));
prev
=
next
;
next
=
cmpxchg
(
&
mcelog
.
next
,
prev
,
0
);
}
while
(
next
!=
prev
);
}
void
mce_register_decode_chain
(
struct
notifier_block
*
nb
)
{
atomic_notifier_chain_register
(
&
x86_mce_decoder_chain
,
nb
);
drain_mcelog_buffer
();
}
EXPORT_SYMBOL_GPL
(
mce_register_decode_chain
);
void
mce_unregister_decode_chain
(
struct
notifier_block
*
nb
)
{
atomic_notifier_chain_unregister
(
&
x86_mce_decoder_chain
,
nb
);
}
EXPORT_SYMBOL_GPL
(
mce_unregister_decode_chain
);
static
void
print_mce
(
struct
mce
*
m
)
static
void
print_mce
(
struct
mce
*
m
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
...
drivers/edac/i7core_edac.c
View file @
715a4318
...
@@ -2234,7 +2234,7 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev)
...
@@ -2234,7 +2234,7 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev)
if
(
pvt
->
enable_scrub
)
if
(
pvt
->
enable_scrub
)
disable_sdram_scrub_setting
(
mci
);
disable_sdram_scrub_setting
(
mci
);
atomic_notifier_chain_unregister
(
&
x86_mce_decoder_chain
,
&
i7_mce_dec
);
mce_unregister_decode_chain
(
&
i7_mce_dec
);
/* Disable EDAC polling */
/* Disable EDAC polling */
i7core_pci_ctl_release
(
pvt
);
i7core_pci_ctl_release
(
pvt
);
...
@@ -2336,7 +2336,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev)
...
@@ -2336,7 +2336,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev)
/* DCLK for scrub rate setting */
/* DCLK for scrub rate setting */
pvt
->
dclk_freq
=
get_dclk_freq
();
pvt
->
dclk_freq
=
get_dclk_freq
();
atomic_notifier_chain_register
(
&
x86_mce_decoder_chain
,
&
i7_mce_dec
);
mce_register_decode_chain
(
&
i7_mce_dec
);
return
0
;
return
0
;
...
...
drivers/edac/mce_amd.c
View file @
715a4318
...
@@ -884,7 +884,7 @@ static int __init mce_amd_init(void)
...
@@ -884,7 +884,7 @@ static int __init mce_amd_init(void)
pr_info
(
"MCE: In-kernel MCE decoding enabled.
\n
"
);
pr_info
(
"MCE: In-kernel MCE decoding enabled.
\n
"
);
atomic_notifier_chain_register
(
&
x86_mce_decoder_chain
,
&
amd_mce_dec_nb
);
mce_register_decode_chain
(
&
amd_mce_dec_nb
);
return
0
;
return
0
;
}
}
...
@@ -893,7 +893,7 @@ early_initcall(mce_amd_init);
...
@@ -893,7 +893,7 @@ early_initcall(mce_amd_init);
#ifdef MODULE
#ifdef MODULE
static
void
__exit
mce_amd_exit
(
void
)
static
void
__exit
mce_amd_exit
(
void
)
{
{
atomic_notifier_chain_unregister
(
&
x86_mce_decoder_chain
,
&
amd_mce_dec_nb
);
mce_unregister_decode_chain
(
&
amd_mce_dec_nb
);
kfree
(
fam_ops
);
kfree
(
fam_ops
);
}
}
...
...
drivers/edac/sb_edac.c
View file @
715a4318
...
@@ -1661,8 +1661,7 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev)
...
@@ -1661,8 +1661,7 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev)
debugf0
(
"MC: "
__FILE__
": %s(): mci = %p, dev = %p
\n
"
,
debugf0
(
"MC: "
__FILE__
": %s(): mci = %p, dev = %p
\n
"
,
__func__
,
mci
,
&
sbridge_dev
->
pdev
[
0
]
->
dev
);
__func__
,
mci
,
&
sbridge_dev
->
pdev
[
0
]
->
dev
);
atomic_notifier_chain_unregister
(
&
x86_mce_decoder_chain
,
mce_unregister_decode_chain
(
&
sbridge_mce_dec
);
&
sbridge_mce_dec
);
/* Remove MC sysfs nodes */
/* Remove MC sysfs nodes */
edac_mc_del_mc
(
mci
->
dev
);
edac_mc_del_mc
(
mci
->
dev
);
...
@@ -1731,8 +1730,7 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev)
...
@@ -1731,8 +1730,7 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev)
goto
fail0
;
goto
fail0
;
}
}
atomic_notifier_chain_register
(
&
x86_mce_decoder_chain
,
mce_register_decode_chain
(
&
sbridge_mce_dec
);
&
sbridge_mce_dec
);
return
0
;
return
0
;
fail0:
fail0:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment