From: Alex Chiang <achiang@hp.com>
To: Jeff Chua <jeff.chua.linux@gmail.com>
Cc: Troy Moure <twmoure@szypr.net>,
Alessandro Suardi <alessandro.suardi@gmail.com>,
Bjorn Helgaas <bjorn.helgaas@hp.com>,
linux-kernel@vger.kernel.org, jbarnes@virtuousgeek.org,
lenb@kernel.org
Subject: Re: [2.6.31-rc1] oops in acpi_get_pci_dev
Date: Thu, 25 Jun 2009 12:59:32 -0600 [thread overview]
Message-ID: <20090625185932.GF27102@ldl.fc.hp.com> (raw)
In-Reply-To: <b6a2187b0906250902xede3041p599e538099340a04@mail.gmail.com>
Hi Jeff, Alessandro,
First, thanks for reporting this bug, and apologies for the
inconvenience.
* Jeff Chua <jeff.chua.linux@gmail.com>:
> On Thu, Jun 25, 2009 at 11:13 PM, Troy Moure<twmoure@szypr.net> wrote:
> > (I don't know if it's the "right" fix or not, not being familiar with the
> > system. If it is, I can send it in as a proper patch.)
> >
> > diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
> > index 8a5bf3b..55b5b90 100644
> > --- a/drivers/acpi/pci_root.c
> > +++ b/drivers/acpi/pci_root.c
> > @@ -395,7 +395,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
> > fn = adr & 0xffff;
> >
> > pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn));
> > - if (hnd == handle)
> > + if (!pdev || hnd == handle)
> > break;
> >
> > pbus = pdev->subordinate;
I'm a little hesitant to do this (yet), because it means one of
my assumptions was wrong.
Can you please try this debug patch and send me the dmesg output?
Please boot with 'debug'. I did add the same NULL check so you
shouldn't crash, and can send me the output after you're done
booting up.
Also, if you could include the output of 'lspci -v', that would
be great too.
Thanks.
/ac
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 8a5bf3b..7674987 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -355,12 +355,20 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
struct pci_dev *pdev = NULL;
struct acpi_handle_node *node, *tmp;
struct acpi_pci_root *root;
+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
LIST_HEAD(device_list);
/*
* Walk up the ACPI CA namespace until we reach a PCI root bridge.
*/
phandle = handle;
+
+ acpi_get_name(phandle, ACPI_FULL_PATHNAME, &buffer);
+ printk("Starting root bridge search from %s\n", (char *)buffer.pointer);
+ kfree(buffer.pointer);
+ buffer.pointer = NULL;
+ buffer.length = 0;
+
while (!acpi_is_root_bridge(phandle)) {
node = kzalloc(sizeof(struct acpi_handle_node), GFP_KERNEL);
if (!node)
@@ -370,6 +378,12 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
node->handle = phandle;
list_add(&node->node, &device_list);
+ acpi_get_name(phandle, ACPI_FULL_PATHNAME, &buffer);
+ printk("+ Adding %s\n", (char *)buffer.pointer);
+ kfree(buffer.pointer);
+ buffer.pointer = NULL;
+ buffer.length = 0;
+
status = acpi_get_parent(phandle, &phandle);
if (ACPI_FAILURE(status))
goto out;
@@ -380,6 +394,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
goto out;
pbus = root->bus;
+ dev_info(&pbus->dev, "I'm a little pci_bus, short and stout...\n");
/*
* Now, walk back down the PCI device tree until we return to our
@@ -394,7 +409,16 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
dev = (adr >> 16) & 0xffff;
fn = adr & 0xffff;
+ printk("Searching for %04x:%02x:%02x.%d\n",
+ pci_domain_nr(pbus), pbus->number,
+ PCI_SLOT(PCI_DEVFN(dev, fn)),
+ PCI_FUNC(PCI_DEVFN(dev, fn)));
+
pdev = pci_get_slot(pbus, PCI_DEVFN(dev, fn));
+ if (!pdev) {
+ printk("Ouch.\n");
+ break;
+ }
if (hnd == handle)
break;
next prev parent reply other threads:[~2009-06-25 18:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-25 15:13 [2.6.31-rc1] oops in acpi_get_pci_dev Troy Moure
2009-06-25 16:02 ` Jeff Chua
2009-06-25 18:59 ` Alex Chiang [this message]
2009-06-25 21:32 ` Alessandro Suardi
2009-06-25 16:41 ` Alex Chiang
-- strict thread matches above, loose matches on Subject: below --
2009-06-25 10:25 Alessandro Suardi
2009-06-24 15:02 ` Pavel Machek
2009-06-27 18:55 ` Alex Chiang
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=20090625185932.GF27102@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=alessandro.suardi@gmail.com \
--cc=bjorn.helgaas@hp.com \
--cc=jbarnes@virtuousgeek.org \
--cc=jeff.chua.linux@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=twmoure@szypr.net \
/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