public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.25-rc8-mm1 panic in rpaphp_register_slot()
Date: Wed, 16 Apr 2008 11:11:27 -0600	[thread overview]
Message-ID: <20080416171127.GA18290@ldl.fc.hp.com> (raw)
In-Reply-To: <1208331916.6958.270.camel@pasglop>

Hi Ben,

* Benjamin Herrenschmidt <benh@kernel.crashing.org>:
> 
> On Tue, 2008-04-15 at 21:17 -0600, Alex Chiang wrote:
> > 
> > Could you take a look at this patch and tell me what I'm doing
> > wrong?
> 
> Hrm, I'll have a look but I'd need some context first... This is to fix
> a problem introduced by another serie of patches ? Can you give me some
> pointers here ?

Thanks for taking a look. The patch series that got accepted into
-mm is here:

	http://lkml.org/lkml/2008/3/25/228

There have been several fixes on top of that series. I'm not sure
what the canonical way to refer to -mm patches is, but if you
navigate to this URL:

	http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.25-rc8/2.6.25-rc8-mm2/patch-list

You'll also need to apply:

	pci-hotplug-introduce-pci_slot-fix.patch
	pci-hotplug-introduce-pci_slot-fix-fix.patch
	pci-hotplug-introduce-pci_slot-fix-2.patch
	pci-hotplug-introduce-pci_slot-fix-99.patch
	pci-hotplug-introduce-pci_slot-fix-3.patch
	pci-hotplug-acpi-pci-slot-detection-driver-fix.patch
	drivers-acpi-pci_slotc-fix-build-with-config_dmi=n.patch

[wow, that's bad on me :( ]


> The pSeries PCI stuff can be tricky so I'll need some time tomorrow to
> context switch and remind myself of everything involved :-) So I'd like
> to make sure by that time, I have all the elements.

The basic idea, which I keep botching on pSeries, is that when we
make a call to pci_hp_register, we now need to pass it:

pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)

I am having trouble figuring out the slot_nr argument. Basically,
I want to get the devfn of the slot we're looking at.

Thanks again.

/ac

> Thanks,
> Ben.
> 
> > Thanks.
> > 
> > /ac
> > 
> > * Alex Chiang <achiang@hp.com>:
> > > Hi Badari,
> > > 
> > > > > > pci_hotplug: PCI Hot Plug PCI Core version: 0.5
> > > > > > rpaphp: RPA HOT Plug PCI Controller Driver version: 0.1
> > > > > > rpaphp_register_slot registering slot:path[/pci@800000020000003/pci@2,4] index[22010003], name[U787E.001.AAA3015-P2-C1] pdomain[22010003] type[16]
> > > > > > Unable to handle kernel paging request for data at address 0x00000070
> > > > > 
> > > > > Hrm, this is a little more information, but still not quite
> > > > > enough. I'm going to take a stab in the dark and say I'm probably
> > > > > doing something wrong on this line, maybe dereferencing a pointer
> > > > > incorrectly:
> > > > > 
> > > > >         retval = pci_hp_register(php_slot, slot->bus,
> > > > > 				 PCI_SLOT(PCI_DN(slot->dn->child)->devfn));
> > > > 
> > > > Sorry. I thought you knew this already. Disassembly clearly showed
> > > > that slot->dn->child is NULL. 
> > > > 
> > > > I confirmed it by adding printk also.
> > > 
> > > This patch is a complete guess on my part (since I've not been
> > > able to understand pseries architecture) but I think it should
> > > fix your issue.
> > > 
> > > Can you give it a try and let me know? It applies on top of the
> > > -mm tree that includes my physical pci_slot series.
> > > 
> > > Also, I'm hoping Linas will speak up and let me know what the
> > > real answer might be. ;)
> > > 
> > > Thanks.
> > > 
> > > /ac
> > > 
> > > From: Alex Chiang <achiang@hp.com>
> > > Subject: rpaphp: correctly call pci_hp_register for empty PCI slots
> > > 
> > > Unpopulated device_node slots do not have children, and
> > > attempting to dereference them will result in a panic.
> > > 
> > > Instead, attempt to derive the PCI slot number from the bus
> > > itself, and failing that, default to 0.
> > > 
> > > Signed-off-by: Alex Chiang <achiang@hp.com>
> > > ---
> > > diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
> > > index 0d4cfc7..91ce6a6 100644
> > > --- a/drivers/pci/hotplug/rpaphp_slot.c
> > > +++ b/drivers/pci/hotplug/rpaphp_slot.c
> > > @@ -121,6 +121,7 @@ int rpaphp_register_slot(struct slot *slot)
> > >  {
> > >  	struct hotplug_slot *php_slot = slot->hotplug_slot;
> > >  	int retval;
> > > +	int slot_nr;
> > >  
> > >  	dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", 
> > >  		__FUNCTION__, slot->dn->full_name, slot->index, slot->name, 
> > > @@ -132,8 +133,11 @@ int rpaphp_register_slot(struct slot *slot)
> > >  		return -EAGAIN;
> > >  	}	
> > >  
> > > -	retval = pci_hp_register(php_slot, slot->bus,
> > > -				 PCI_SLOT(PCI_DN(slot->dn->child)->devfn));
> > > +	if (slot->bus->self)
> > > +		slot_nr = PCI_SLOT(slot->bus->self->devfn);
> > > +	else
> > > +		slot_nr = 0;
> > > +	retval = pci_hp_register(php_slot, slot->bus, slot_nr);
> > >  	if (retval) {
> > >  		err("pci_hp_register failed with error %d\n", retval);
> > >  		return retval;
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at  http://www.tux.org/lkml/
> > > 
> 

  reply	other threads:[~2008-04-16 17:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 17:53 2.6.25-rc8-mm1 panic in rpaphp_register_slot() Badari Pulavarty
2008-04-04 18:05 ` Alex Chiang
2008-04-04 20:19   ` Badari Pulavarty
2008-04-04 22:42     ` Alex Chiang
2008-04-04 23:35       ` Badari Pulavarty
2008-04-07 23:42         ` Alex Chiang
2008-04-16  0:36           ` Andrew Morton
2008-04-16  2:13             ` Alex Chiang
2008-04-16  3:08             ` Badari Pulavarty
2008-04-16  3:18               ` Alex Chiang
2008-04-16  3:20                 ` Badari Pulavarty
2008-04-16 19:32                 ` Badari Pulavarty
2008-04-16 19:59                   ` Alex Chiang
2008-04-16  3:17           ` Alex Chiang
2008-04-16  7:45             ` Benjamin Herrenschmidt
2008-04-16 17:11               ` Alex Chiang [this message]
2008-04-16 20:03                 ` Andrew Morton
2008-04-16 22:16                   ` Benjamin Herrenschmidt
2008-04-19  6:38                     ` Alex Chiang
2008-04-19  7:03                       ` Benjamin Herrenschmidt
2008-04-22  4:05                         ` Alex Chiang
2008-04-22  5:07                           ` Benjamin Herrenschmidt
2008-04-16 22:15                 ` Benjamin Herrenschmidt

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=20080416171127.GA18290@ldl.fc.hp.com \
    --to=achiang@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    /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