From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, kernel-testers@vger.kernel.org
Subject: Re: pnp changes -> suspend oops [Was: 2.6.26-rc5-mm2]
Date: Wed, 11 Jun 2008 13:03:38 -0600 [thread overview]
Message-ID: <200806111303.39267.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <485014B5.7080305@gmail.com>
On Wednesday 11 June 2008 12:08:53 pm Jiri Slaby wrote:
> On 06/10/2008 07:31 AM, Andrew Morton wrote:
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.26-rc5/2.6.26-rc5-mm2/
>
> I face problems after some of the pnp changes. If this is not known, I may
> bisect it, it's 100% reproducible. I have no real logs, It panics prior to
> network is woken up to see something on netconsole, I just captured a function
> name and an offset of place where it oopses.
>
> pnpacpi_encode_resources, ACPI_RESOURCE_TYPE_DMA case, pnp_get_resource(dev,
> IORESOURCE_DMA, dma) returns NULL, which is dereferenced at pnpacpi_encode_dma
> at p->flags.
>
> It happens on resume after mem > /sys/power/state.
Thanks for the report, I hadn't heard about this.
We used to always have a resource from the static table to encode
(assuming the table was big enough), even if that resource was
disabled or unassigned. But now we don't keep those around, so
we can end up with null pointers like you're seeing.
Before you go to all the trouble of bisecting it, can you turn on
CONFIG_PNP_DEBUG and try the following debug patch? I think this
will prevent the oops, but it's just papering over the real problem,
so please capture the complete dmesg log.
Bjorn
Index: work10/drivers/pnp/pnpacpi/rsparser.c
===================================================================
--- work10.orig/drivers/pnp/pnpacpi/rsparser.c 2008-06-11 12:46:28.000000000 -0600
+++ work10/drivers/pnp/pnpacpi/rsparser.c 2008-06-11 12:59:43.000000000 -0600
@@ -749,6 +749,11 @@ static void pnpacpi_encode_irq(struct pn
struct acpi_resource_irq *irq = &resource->data.irq;
int triggering, polarity, shareable;
+ if (!p) {
+ dev_err(&dev->dev, " no irq resource to encode!\n");
+ return;
+ }
+
decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
irq->triggering = triggering;
irq->polarity = polarity;
@@ -771,6 +776,11 @@ static void pnpacpi_encode_ext_irq(struc
struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq;
int triggering, polarity, shareable;
+ if (!p) {
+ dev_err(&dev->dev, " no extended irq resource to encode!\n");
+ return;
+ }
+
decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
extended_irq->producer_consumer = ACPI_CONSUMER;
extended_irq->triggering = triggering;
@@ -791,6 +801,11 @@ static void pnpacpi_encode_dma(struct pn
{
struct acpi_resource_dma *dma = &resource->data.dma;
+ if (!p) {
+ dev_err(&dev->dev, " no dma resource to encode!\n");
+ return;
+ }
+
/* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
switch (p->flags & IORESOURCE_DMA_SPEED_MASK) {
case IORESOURCE_DMA_TYPEA:
@@ -832,6 +847,11 @@ static void pnpacpi_encode_io(struct pnp
{
struct acpi_resource_io *io = &resource->data.io;
+ if (!p) {
+ dev_err(&dev->dev, " no io resource to encode!\n");
+ return;
+ }
+
/* Note: pnp_assign_port will copy pnp_port->flags into p->flags */
io->io_decode = (p->flags & IORESOURCE_IO_16BIT_ADDR) ?
ACPI_DECODE_16 : ACPI_DECODE_10;
@@ -851,6 +871,11 @@ static void pnpacpi_encode_fixed_io(stru
{
struct acpi_resource_fixed_io *fixed_io = &resource->data.fixed_io;
+ if (!p) {
+ dev_err(&dev->dev, " no fixed io resource to encode!\n");
+ return;
+ }
+
fixed_io->address = p->start;
fixed_io->address_length = p->end - p->start + 1;
@@ -864,6 +889,11 @@ static void pnpacpi_encode_mem24(struct
{
struct acpi_resource_memory24 *memory24 = &resource->data.memory24;
+ if (!p) {
+ dev_err(&dev->dev, " no mem24 resource to encode!\n");
+ return;
+ }
+
/* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */
memory24->write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
@@ -884,6 +914,11 @@ static void pnpacpi_encode_mem32(struct
{
struct acpi_resource_memory32 *memory32 = &resource->data.memory32;
+ if (!p) {
+ dev_err(&dev->dev, " no mem32 resource to encode!\n");
+ return;
+ }
+
memory32->write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
@@ -903,6 +938,11 @@ static void pnpacpi_encode_fixed_mem32(s
{
struct acpi_resource_fixed_memory32 *fixed_memory32 = &resource->data.fixed_memory32;
+ if (!p) {
+ dev_err(&dev->dev, " no fixed_mem32 resource to encode!\n");
+ return;
+ }
+
fixed_memory32->write_protect =
(p->flags & IORESOURCE_MEM_WRITEABLE) ?
ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
next prev parent reply other threads:[~2008-06-11 19:04 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 5:31 2.6.26-rc5-mm2 Andrew Morton
2008-06-10 6:12 ` 2.6.26-rc5-mm2 Nick Piggin
2008-06-10 7:28 ` 2.6.26-rc5-mm2 Nick Piggin
2008-06-10 8:34 ` 2.6.26-rc5-mm2 Andrew Morton
2008-06-10 8:48 ` 2.6.26-rc5-mm2 Nick Piggin
2008-06-10 9:15 ` 2.6.26-rc5-mm2 Andrew Morton
2008-06-10 12:34 ` 2.6.26-rc5-mm2 Rik van Riel
2008-06-11 18:09 ` 2.6.26-rc5-mm2 Rik van Riel
2008-06-11 23:58 ` 2.6.26-rc5-mm2 Nick Piggin
2008-06-12 19:29 ` 2.6.26-rc5-mm2 Rik van Riel
2008-06-12 21:15 ` 2.6.26-rc5-mm2 (swap_state.c:77) Hugh Dickins
2008-06-13 17:45 ` Rik van Riel
2008-06-13 21:15 ` Hugh Dickins
2008-06-13 22:03 ` Rik van Riel
2008-06-10 15:34 ` 2.6.26-rc5-mm2 Lee Schermerhorn
2008-06-10 16:50 ` 2.6.26-rc5-mm2 Hugh Dickins
2008-06-10 10:20 ` 2.6.26-rc5-mm2 lockup up on Intel G33+ICH9R+Core2Duo, -mm1 okay Grant Coady
2008-06-10 18:18 ` Andrew Morton
2008-06-10 21:48 ` Grant Coady
2008-06-10 11:50 ` 2.6.26-rc5-mm2 compile error in vmscan.c Helge Hafting
2008-06-10 12:23 ` Johannes Weiner
2008-06-10 18:37 ` Andrew Morton
2008-06-12 8:13 ` Helge Hafting
2008-06-11 2:26 ` 2.6.26-rc5-mm2 (compile error in mm/memory_hotplug.c) Yasunori Goto
2008-06-11 6:00 ` 2.6.26-rc5-mm2: OOM with 1G free swap Alexey Dobriyan
2008-06-11 6:11 ` Nick Piggin
2008-06-11 6:15 ` Nick Piggin
2008-06-11 6:27 ` Andrew Morton
2008-06-11 6:31 ` Nick Piggin
2008-06-11 6:36 ` KOSAKI Motohiro
2008-06-11 7:31 ` Frederik Deweerdt
2008-06-11 12:57 ` Rik van Riel
2008-06-11 13:44 ` Nick Piggin
2008-06-11 17:56 ` [BUG] 2.6.26-rc5-mm2 - kernel BUG at arch/x86/kernel/setup.c:388! Kamalesh Babulal
2008-06-11 18:28 ` Dave Hansen
2008-06-11 18:37 ` Vegard Nossum
2008-06-12 6:55 ` Kamalesh Babulal
2008-06-11 18:08 ` pnp changes -> suspend oops [Was: 2.6.26-rc5-mm2] Jiri Slaby
2008-06-11 19:03 ` Bjorn Helgaas [this message]
2008-06-12 21:10 ` Jiri Slaby
2008-06-12 21:22 ` Bjorn Helgaas
2008-06-12 21:39 ` Jiri Slaby
2008-06-12 21:57 ` Bjorn Helgaas
2008-06-12 21:57 ` Jiri Slaby
2008-06-13 16:05 ` Jiri Slaby
2008-06-13 17:23 ` Bjorn Helgaas
2008-06-16 10:43 ` Jiri Slaby
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=200806111303.39267.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=akpm@linux-foundation.org \
--cc=jirislaby@gmail.com \
--cc=kernel-testers@vger.kernel.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
all inboxes | Powered by JetHome®