diff options
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 2d2e0b565a9c..e8b893e880ed 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -88,9 +88,10 @@ int mce_cmci_disabled __read_mostly; | |||
88 | int mce_ignore_ce __read_mostly; | 88 | int mce_ignore_ce __read_mostly; |
89 | int mce_ser __read_mostly; | 89 | int mce_ser __read_mostly; |
90 | 90 | ||
91 | static unsigned long notify_user; | 91 | /* User mode helper program triggered by machine check event */ |
92 | static char trigger[128]; | 92 | static unsigned long mce_need_notify; |
93 | static char *trigger_argv[2] = { trigger, NULL }; | 93 | static char mce_helper[128]; |
94 | static char *mce_helper_argv[2] = { mce_helper, NULL }; | ||
94 | 95 | ||
95 | static unsigned long dont_init_banks; | 96 | static unsigned long dont_init_banks; |
96 | 97 | ||
@@ -180,7 +181,7 @@ void mce_log(struct mce *mce) | |||
180 | wmb(); | 181 | wmb(); |
181 | 182 | ||
182 | mce->finished = 1; | 183 | mce->finished = 1; |
183 | set_bit(0, ¬ify_user); | 184 | set_bit(0, &mce_need_notify); |
184 | } | 185 | } |
185 | 186 | ||
186 | static void print_mce(struct mce *m) | 187 | static void print_mce(struct mce *m) |
@@ -1122,7 +1123,7 @@ static void mcheck_timer(unsigned long data) | |||
1122 | 1123 | ||
1123 | static void mce_do_trigger(struct work_struct *work) | 1124 | static void mce_do_trigger(struct work_struct *work) |
1124 | { | 1125 | { |
1125 | call_usermodehelper(trigger, trigger_argv, NULL, UMH_NO_WAIT); | 1126 | call_usermodehelper(mce_helper, mce_helper_argv, NULL, UMH_NO_WAIT); |
1126 | } | 1127 | } |
1127 | 1128 | ||
1128 | static DECLARE_WORK(mce_trigger_work, mce_do_trigger); | 1129 | static DECLARE_WORK(mce_trigger_work, mce_do_trigger); |
@@ -1139,7 +1140,7 @@ int mce_notify_irq(void) | |||
1139 | 1140 | ||
1140 | clear_thread_flag(TIF_MCE_NOTIFY); | 1141 | clear_thread_flag(TIF_MCE_NOTIFY); |
1141 | 1142 | ||
1142 | if (test_and_clear_bit(0, ¬ify_user)) { | 1143 | if (test_and_clear_bit(0, &mce_need_notify)) { |
1143 | wake_up_interruptible(&mce_wait); | 1144 | wake_up_interruptible(&mce_wait); |
1144 | 1145 | ||
1145 | /* | 1146 | /* |
@@ -1147,7 +1148,7 @@ int mce_notify_irq(void) | |||
1147 | * work_pending is always cleared before the function is | 1148 | * work_pending is always cleared before the function is |
1148 | * executed. | 1149 | * executed. |
1149 | */ | 1150 | */ |
1150 | if (trigger[0] && !work_pending(&mce_trigger_work)) | 1151 | if (mce_helper[0] && !work_pending(&mce_trigger_work)) |
1151 | schedule_work(&mce_trigger_work); | 1152 | schedule_work(&mce_trigger_work); |
1152 | 1153 | ||
1153 | if (__ratelimit(&ratelimit)) | 1154 | if (__ratelimit(&ratelimit)) |
@@ -1664,9 +1665,9 @@ static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr, | |||
1664 | static ssize_t | 1665 | static ssize_t |
1665 | show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf) | 1666 | show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf) |
1666 | { | 1667 | { |
1667 | strcpy(buf, trigger); | 1668 | strcpy(buf, mce_helper); |
1668 | strcat(buf, "\n"); | 1669 | strcat(buf, "\n"); |
1669 | return strlen(trigger) + 1; | 1670 | return strlen(mce_helper) + 1; |
1670 | } | 1671 | } |
1671 | 1672 | ||
1672 | static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, | 1673 | static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, |
@@ -1675,10 +1676,10 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, | |||
1675 | char *p; | 1676 | char *p; |
1676 | int len; | 1677 | int len; |
1677 | 1678 | ||
1678 | strncpy(trigger, buf, sizeof(trigger)); | 1679 | strncpy(mce_helper, buf, sizeof(mce_helper)); |
1679 | trigger[sizeof(trigger)-1] = 0; | 1680 | mce_helper[sizeof(mce_helper)-1] = 0; |
1680 | len = strlen(trigger); | 1681 | len = strlen(mce_helper); |
1681 | p = strchr(trigger, '\n'); | 1682 | p = strchr(mce_helper, '\n'); |
1682 | 1683 | ||
1683 | if (*p) | 1684 | if (*p) |
1684 | *p = 0; | 1685 | *p = 0; |