* pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." [not found] <20080417010122.148289106@sous-sol.org> @ 2008-04-17 1:02 ` Chris Wright 2008-04-17 15:24 ` Nick Andrew 2008-04-18 21:48 ` Bjorn Helgaas 0 siblings, 2 replies; 5+ messages in thread From: Chris Wright @ 2008-04-17 1:02 UTC (permalink / raw) To: linux-kernel, stable, Linux-acpi Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Len Brown, Len Brown [-- Attachment #1: pnpacpi-reduce-printk-severity-for-pnpacpi-exceeded-the-max-number-of.patch --] [-- Type: text/plain, Size: 2506 bytes --] -stable review patch. If anyone has any objections, please let us know. --------------------- From: Len Brown <len.brown@intel.com> upstream commit 33fd7afd66ffdc6addf1b085fe6403b6af532f8e We have been printing these messages at KERN_ERR since 2.6.24, per http://bugzilla.kernel.org/show_bug.cgi?id=9535 But KERN_ERR pops up on a console booted with "quiet" and causes users to get alarmed and file bugs about the message itself: https://bugzilla.redhat.com/show_bug.cgi?id=436589 So reduce the severity of these messages to KERN_WARNING, which is not printed by "quiet". This message will still be seen without "quiet", but a lot of messages are printed in that mode and it will be less likely to cause undue alarm. We could go all the way to KERN_DEBUG, but this is a real warning after all, so it seems prudent not to require "debug" to see it. Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> --- drivers/pnp/pnpacpi/rsparser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqr i < PNP_MAX_IRQ) i++; if (i >= PNP_MAX_IRQ && !warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " "resources: %d \n", PNP_MAX_IRQ); warned = 1; return; @@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmar res->dma_resource[i].start = dma; res->dma_resource[i].end = dma; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " + printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA " "resources: %d \n", PNP_MAX_DMA); warned = 1; } @@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_iore res->port_resource[i].start = io; res->port_resource[i].end = io + len - 1; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of IO " + printk(KERN_WARNING "pnpacpi: exceeded the max number of IO " "resources: %d \n", PNP_MAX_PORT); warned = 1; } @@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memr res->mem_resource[i].start = mem; res->mem_resource[i].end = mem + len - 1; } else if (!warned) { - printk(KERN_ERR "pnpacpi: exceeded the max number of mem " + printk(KERN_WARNING "pnpacpi: exceeded the max number of mem " "resources: %d\n", PNP_MAX_MEM); warned = 1; } -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." 2008-04-17 1:02 ` pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." Chris Wright @ 2008-04-17 15:24 ` Nick Andrew 2008-04-17 17:09 ` Chris Wright 2008-04-18 21:48 ` Bjorn Helgaas 1 sibling, 1 reply; 5+ messages in thread From: Nick Andrew @ 2008-04-17 15:24 UTC (permalink / raw) To: Chris Wright Cc: linux-kernel, stable, Linux-acpi, Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Len Brown, Len Brown On Wed, Apr 16, 2008 at 06:02:20PM -0700, Chris Wright wrote: > - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " > + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " > "resources: %d \n", PNP_MAX_IRQ); This is a good time to delete that whitespace before the newline in this hunk plus the two following. Unless you're going to go to dynamic memory allocation for these arrays in a month and wipe out all this code. Nick. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." 2008-04-17 15:24 ` Nick Andrew @ 2008-04-17 17:09 ` Chris Wright 0 siblings, 0 replies; 5+ messages in thread From: Chris Wright @ 2008-04-17 17:09 UTC (permalink / raw) To: Nick Andrew Cc: Chris Wright, linux-kernel, stable, Linux-acpi, Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Len Brown, Len Brown * Nick Andrew (nick@nick-andrew.net) wrote: > On Wed, Apr 16, 2008 at 06:02:20PM -0700, Chris Wright wrote: > > - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " > > + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " > > "resources: %d \n", PNP_MAX_IRQ); > > This is a good time to delete that whitespace before the newline > in this hunk plus the two following. Unless you're going to go to > dynamic memory allocation for these arrays in a month and wipe > out all this code. Not for -stable...maybe upstream, send Len a patch. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." 2008-04-17 1:02 ` pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." Chris Wright 2008-04-17 15:24 ` Nick Andrew @ 2008-04-18 21:48 ` Bjorn Helgaas 2008-04-23 4:09 ` [stable PATCH for 2.6.24.5 and 2.6.25] pnpacpi: fix potential corruption on "pnpacpi: exceeded the max number of IRQ resources 2" Len Brown 1 sibling, 1 reply; 5+ messages in thread From: Bjorn Helgaas @ 2008-04-18 21:48 UTC (permalink / raw) To: Chris Wright Cc: linux-kernel, stable, Linux-acpi, Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan, Len Brown, Len Brown On Wednesday 16 April 2008 07:02:20 pm Chris Wright wrote: > -stable review patch. If anyone has any objections, please let us know. I don't object to the point of the patch (changing KERN_ERR to KERN_WARNING), but there is a more serious bug lurking here that corrupts memory, and if we're doing a -stable patch, we should fix it. The test is: if (i >= PNP_MAX_IRQ && !warned) { printk(...); warned = 1; return; } But it should be: if (i >= PNP_MAX_IRQ) { if (!warned) { printk(...); warned = 1; } return; } > --- a/drivers/pnp/pnpacpi/rsparser.c > +++ b/drivers/pnp/pnpacpi/rsparser.c > @@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqr > i < PNP_MAX_IRQ) > i++; > if (i >= PNP_MAX_IRQ && !warned) { > - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ " > + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " > "resources: %d \n", PNP_MAX_IRQ); > warned = 1; > return; > @@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmar > res->dma_resource[i].start = dma; > res->dma_resource[i].end = dma; > } else if (!warned) { > - printk(KERN_ERR "pnpacpi: exceeded the max number of DMA " > + printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA " > "resources: %d \n", PNP_MAX_DMA); > warned = 1; > } > @@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_iore > res->port_resource[i].start = io; > res->port_resource[i].end = io + len - 1; > } else if (!warned) { > - printk(KERN_ERR "pnpacpi: exceeded the max number of IO " > + printk(KERN_WARNING "pnpacpi: exceeded the max number of IO " > "resources: %d \n", PNP_MAX_PORT); > warned = 1; > } > @@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memr > res->mem_resource[i].start = mem; > res->mem_resource[i].end = mem + len - 1; > } else if (!warned) { > - printk(KERN_ERR "pnpacpi: exceeded the max number of mem " > + printk(KERN_WARNING "pnpacpi: exceeded the max number of mem " > "resources: %d\n", PNP_MAX_MEM); > warned = 1; > } > ^ permalink raw reply [flat|nested] 5+ messages in thread
* [stable PATCH for 2.6.24.5 and 2.6.25] pnpacpi: fix potential corruption on "pnpacpi: exceeded the max number of IRQ resources 2" 2008-04-18 21:48 ` Bjorn Helgaas @ 2008-04-23 4:09 ` Len Brown 0 siblings, 0 replies; 5+ messages in thread From: Len Brown @ 2008-04-23 4:09 UTC (permalink / raw) To: Bjorn Helgaas Cc: Chris Wright, linux-kernel, stable, Linux-acpi, Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap, Dave Jones, Chuck Wolber, Chris Wedgwood, Michael Krufky, Chuck Ebbert, Domenico Andreoli, torvalds, akpm, alan From: Len Brown <len.brown@intel.com> PNP_MAX_IRQ is 2 If a device invokes pnpacpi_parse_allocated_irqresource() 0, 1, or 2 times, we are happy. The 3rd time, we will fail and print "pnpacpi: exceeded the max number of IRQ resources: 2" The 4th and subsequent calls (if this ever happened) would silently scribble on irq_resource[2], which doesn't actualy exist. Found-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com> diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 2dcd196..98cbc9f 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -84,10 +84,12 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res, while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_IRQ) i++; - if (i >= PNP_MAX_IRQ && !warned) { - printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ " - "resources: %d \n", PNP_MAX_IRQ); - warned = 1; + if (i >= PNP_MAX_IRQ) { + if (!warned) { + printk(KERN_WARNING "pnpacpi: exceeded the max number" + " of IRQ resources: %d\n", PNP_MAX_IRQ); + warned = 1; + } return; } /* ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-04-23 4:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080417010122.148289106@sous-sol.org>
2008-04-17 1:02 ` pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." Chris Wright
2008-04-17 15:24 ` Nick Andrew
2008-04-17 17:09 ` Chris Wright
2008-04-18 21:48 ` Bjorn Helgaas
2008-04-23 4:09 ` [stable PATCH for 2.6.24.5 and 2.6.25] pnpacpi: fix potential corruption on "pnpacpi: exceeded the max number of IRQ resources 2" Len Brown
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox