Re: [PATCH 5/7] pci hotplug core: add check of duplicate slot name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>:
> On Tue, 27 May 2008 19:07:01 +0900
> Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx> wrote:
> > 
> > Slot with the same name can be registered multiple times if shpchp or
> > pciehp driver is loaded after acpiphp is loaded because ACPI based
> > hotplug driver and Native OS hotplug driver trying to handle the same
> > physical slot. In this case, current pci_hotplug core will call
> > kobject_init_and_add() muliple time with the same name. This is the
> > cause of this problem. To fix this problem, this patch adds the check
> > into pci_hp_register() to see if the slot with the same name.
> > 
> > Signed-off-by: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>
> > 
> > ---
> >  drivers/pci/hotplug/pci_hotplug_core.c |    7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > Index: linux-2.6.26-rc4/drivers/pci/hotplug/pci_hotplug_core.c
> > ===================================================================
> > --- linux-2.6.26-rc4.orig/drivers/pci/hotplug/pci_hotplug_core.c
> > +++ linux-2.6.26-rc4/drivers/pci/hotplug/pci_hotplug_core.c
> > @@ -619,6 +619,7 @@ static struct hotplug_slot *get_slot_fro
> >  int pci_hp_register (struct hotplug_slot *slot)
> >  {
> >  	int result;
> > +	struct hotplug_slot *tmp;
> >  
> >  	if (slot == NULL)
> >  		return -ENODEV;
> > @@ -630,7 +631,11 @@ int pci_hp_register (struct hotplug_slot
> >  		return -EINVAL;
> >  	}
> >  
> > -	/* this can fail if we have already registered a slot with the same name */
> > +	/* Check if we have already registered a slot with the same name. */
> > +	tmp = get_slot_from_name(slot->name);
> > +	if (tmp)
> > +		return -EEXIST;
> > +
> 
> Please avoid adding variables called `tmp' or `temp' or such.  In this
> case
> 
> 	if (get_slot_from_name(slot->name))
> 		return -EEXIST;
> 
> would suit.
> 
> 
> I assume these patches will destroy Alex's frequently-destroyed
> pci-hotplug-introduce-pci_slot.patch.  Ho hum.

I took a quick scan, and yeah, they'll break my patch series, but
I should be able to adapt. Ho hum indeed.

More importantly though, I can't seem to get any help on the
pseries front. Benjamin Herrenschmidt is too busy, and I haven't
heard a single peep from the IBM fellow (Mike Mason).

Any suggestions on how to move forward? My fixup patch did fix
Badari's original oops in a syntactically sane manner; it was the
semantics that were a bit trickier.

Perhaps we could roll that last fixup patch into the series, aim
for the next merge window, and see who complains? Obviously I'd
work any issues that would pop up, and we could always revert it
as a last resort.

Or is that idea too sloppy for mainline?

Thanks,

/ac

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux