From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Jim Cromie <jim.cromie@gmail.com>,
Jason Baron <jbaron@redhat.com>,
Kay Sievers <kay.sievers@vrfy.org>, Joe Perches <joe@perches.com>
Subject: [PATCH] drivers-core: beware dev_printk() from printing nonsense
Date: Mon, 20 Aug 2012 12:33:37 +0200 [thread overview]
Message-ID: <20120820103337.GA16744@linutronix.de> (raw)
on boot I saw plenty of rubbish like:
|ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
|pci_root PNP0A03:00: Force enabled HPET at 0x%lx
|host bridge window [io 0x0000-0x0cf7] (ignored)
|pci_root PNP0A03:00: Force enabled HPET at 0x%lx
|host bridge window [io 0x0d00-0xffff] (ignored)
|pci_root PNP0A03:00: Force enabled HPET at 0x%lx
|ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
|virtio-pci 0000:00:05.0: Force enabled HPET at 0x%lx
First I wonder myself why the kernel Force enables more than one HPET
and why the address isn't printed. Then I wasn't sure why virtio-pci
does the same thing.
As it turns out commit af7f2158fdee ("drivers-core: make structured
logging play nice with dynamic-debug") has probably an off by one error.
Since commit 314ba3520 ("printk: add kern_levels.h to make KERN_<LEVEL>
available for asm use") the whole shrunk by one byte. And for some
reason the compiler put the HPET string just after one of the kernel log
levels so level[3] was always true.
This should make the rubish go away, I am not sure if the dynamic debug
is still working. Jim could you please try?
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: stable <stable@vger.kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/base/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index cdd01c5..5a864c3 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1912,7 +1912,7 @@ int __dev_printk(const char *level, const struct device *dev,
"DEVICE=+%s:%s", subsys, dev_name(dev));
}
skip:
- if (level[3])
+ if (level[sizeof(KERN_ERR) - 1])
level_extra = &level[3]; /* skip past "<L>" */
return printk_emit(0, level[1] - '0',
--
1.7.10.4
next reply other threads:[~2012-08-20 10:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 10:33 Sebastian Andrzej Siewior [this message]
2012-08-20 15:26 ` [PATCH] drivers-core: beware dev_printk() from printing nonsense Greg Kroah-Hartman
2012-08-20 16:53 ` Sebastian Andrzej Siewior
2012-08-20 18:13 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120820103337.GA16744@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@redhat.com \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).