[PATCH 2/7] Powerpc MSI implementation

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Jan 12 18:27:49 EST 2007


> Most of this shouldn't live in arch/powerpc as it's generic code except
> for tiny little bits.

Generally agreed.

> > +static struct ppc_msi_ops *get_msi_ops(struct pci_dev *pdev)
> > +{
> > +	if (ppc_md.get_msi_ops)
> > +		return ppc_md.get_msi_ops(pdev);
> > +
> > +	return NULL;
> > +}
>
> struct ppc_msi_ops should become msi_ops, and this function should
> be an arch hook in asm/msi.h

Yes. We need an asm hook as some archs will return one single global ops
instance for any PCI devices, while others (like powerpc) need to be
able to return different ops depending on what bus a device hangs off.

> > +static struct msi_info *get_msi_info(struct pci_dev *pdev)
> > +{
> > +	return pdev->msi_info;
> > +}
> 
> This wrapper looks rather useless :)

It dates from when we were unsure where to put the msi_info (initially
in some ppc-specific pci_dn data structure iirc, until we had Greg's ok
about having it in pci_dev... Easier to just update the wrapper than fix
everybody using it :-)

> > +#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_MERGE)
> > +struct msi_info;
> > +#endif
> 
> Unconditional, please.
>
> >  /*
> >   * The pci_dev structure is used to describe PCI devices.
> >   */
> > @@ -174,6 +178,9 @@ struct pci_dev {
> >  	struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
> >  	int rom_attr_enabled;		/* has display of the rom attribute been enabled? */
> >  	struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
> > +#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_MERGE)
> > +	struct	msi_info *msi_info;
> > +#endif
> 
> and only #ifdef CONFIG_PCI_MSI here please.

Yeah well, CONFIG_PCI_MSI_NEW for now and CONFIG_PCI_MSI once
everything's been ported over the new infrastructure.

Ben.





More information about the Linuxppc-dev mailing list