* [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog
@ 2013-04-09 18:19 Khalid Aziz
2013-04-09 18:30 ` Luck, Tony
0 siblings, 1 reply; 4+ messages in thread
From: Khalid Aziz @ 2013-04-09 18:19 UTC (permalink / raw)
To: tony.luck, bp, tglx, mingo, hpa; +Cc: x86, linux-edac, linux-kernel
Print a warning if machine check handler fails to register
/dev/mcelog device.
Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
---
arch/x86/kernel/cpu/mcheck/mce.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 7bc1263..7b4c28c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2412,7 +2412,8 @@ static __init int mcheck_init_device(void)
register_hotcpu_notifier(&mce_cpu_notifier);
/* register character device /dev/mcelog */
- misc_register(&mce_chrdev_device);
+ if (misc_register(&mce_chrdev_device) != 0)
+ pr_warn("Failed to register mcelog device\n");
return err;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog
2013-04-09 18:19 [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog Khalid Aziz
@ 2013-04-09 18:30 ` Luck, Tony
2013-04-09 18:52 ` Borislav Petkov
2013-04-09 19:20 ` Khalid Aziz
0 siblings, 2 replies; 4+ messages in thread
From: Luck, Tony @ 2013-04-09 18:30 UTC (permalink / raw)
To: Khalid Aziz, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com
Cc: x86@kernel.org, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 599 bytes --]
- misc_register(&mce_chrdev_device);
+ if (misc_register(&mce_chrdev_device) != 0)
+ pr_warn("Failed to register mcelog device\n");
Did this actually happen to you? Or is this just "good practice" to check the
return value from misc_register?
If this can really happen, we should remember that it failed and
just drop out of mce_log() early (no point in queueing up records
when there is no way for a user to ever access them).
-Tony
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog
2013-04-09 18:30 ` Luck, Tony
@ 2013-04-09 18:52 ` Borislav Petkov
2013-04-09 19:20 ` Khalid Aziz
1 sibling, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2013-04-09 18:52 UTC (permalink / raw)
To: Luck, Tony
Cc: Khalid Aziz, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Apr 09, 2013 at 06:30:58PM +0000, Luck, Tony wrote:
> - misc_register(&mce_chrdev_device);
> + if (misc_register(&mce_chrdev_device) != 0)
> + pr_warn("Failed to register mcelog device\n");
>
> Did this actually happen to you? Or is this just "good practice" to check the
> return value from misc_register?
I'm very sceptical this actually happens - we would've otherwise seen
reports about mcelog not starting correctly.
Hmm.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog
2013-04-09 18:30 ` Luck, Tony
2013-04-09 18:52 ` Borislav Petkov
@ 2013-04-09 19:20 ` Khalid Aziz
1 sibling, 0 replies; 4+ messages in thread
From: Khalid Aziz @ 2013-04-09 19:20 UTC (permalink / raw)
To: Luck, Tony
Cc: bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org
On 04/09/2013 12:30 PM, Luck, Tony wrote:
> - misc_register(&mce_chrdev_device);
> + if (misc_register(&mce_chrdev_device) != 0)
> + pr_warn("Failed to register mcelog device\n");
>
> Did this actually happen to you? Or is this just "good practice" to check the
> return value from misc_register?
>
No, I did not see this happen. It is just "good practice". If it were to
happen, mcelog daemon would fail to get any mce records and it will not
be easy to figure out what happened. Most other places in kernel where
misc_register() is called, do check for return code and take action if
it fails.
--
Khalid
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-09 19:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 18:19 [PATCH] x86, mce: Print warning if MCE handler fails to register /dev/mcelog Khalid Aziz
2013-04-09 18:30 ` Luck, Tony
2013-04-09 18:52 ` Borislav Petkov
2013-04-09 19:20 ` Khalid Aziz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox