[PATCH] PPC64: EEH Recovery
Benjamin Herrenschmidt
benh at kernel.crashing.org
Sun Nov 21 10:36:13 EST 2004
On Sat, 2004-11-20 at 17:11 -0600, Milton D. Miller II wrote:
> 2) I object to grabing pci devices so they don't disappear and reappear.
> I worry about duplicate devices across register/unregister and sysfs
> kobject lifetimes getting confused and duplicate names.
>
> I'd prefer we just kept the pci config stuff we are going to restore
> off the of device node.
Agreed... though it could even be a driver responsibility to restore the
stuff ... The basic stuff like BARs don't need to be saved/restored I
suppose too, just get the kernel to re-assign addresses after the old
ones have been freed ...
> adding trailing white space. tsk tsk
> PS: there is more white space, this one caught my eye.
Oh, I do that too all the time, bad bad emacs :)
> Do we need a tree for this?
No, this is overbloat
> > +
> > +static inline struct pci_dev * eeh_get_pci_dev(struct device_node *dn)
> > +{
> > + struct pci_dev *dev = NULL;
> > + char bus_id[BUS_ID_SIZE];
> > +
> > + sprintf(bus_id, "%04x:%02x:%02x.%d",dn->phb->global_number,
> > + dn->busno, PCI_SLOT(dn->devfn), PCI_FUNC(dn->devfn));
> > +
> > + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
> > + if (!strcmp(pci_name(dev), bus_id))
> > + return dev;
> > + }
> > + return NULL;
> > +}
>
>
> IICK
Indeed, GACK !
> 1) matching on a stirng when we have the device_node? really?
> please match on pci_device_to_OF_node(dev)
> 2) for_each_pcidev() please
Yup.
> How about a list of (dn *, pci config words to write)?
> or an array of dn
I don't understand why we need to do that... it's totally redundant with
just unplugging/re-plugging the device, the kernel will then re-assign
addresses to it.
More information about the Linuxppc64-dev
mailing list