[PATCH] support for Hotplug/DLPAR PCI multifunction cards

Hollis Blanchard hollisb at us.ibm.com
Sat Feb 14 04:15:49 EST 2004


On Feb 13, 2004, at 10:43 AM, Linda Xie wrote:

> The attached patch fixes OF device tree update code so that it supports
> Hotplug and DLPAR PCI multifunction cards.

I'm still unclear on the requirement to have an "interrupts" property.
In this patch, all non-PCI devices without interrupts will be treated
as errors. Why? If the new node doesn't have the property, just skip
the interrupt code (bringing you to what you've called "fixup_pci"). It
doesn't even have to be a goto: break the interrupt code into its own
function and then:

  	ints = (unsigned int *) get_property(node, "interrupts", &intlen);
  	if (ints)
		of_finish_dynamic_interrupts(...)

	node->phb = parent->phb;
	regs = (u32 *)get_property(node, "reg", 0);

> @@ -2929,8 +2930,12 @@
>
>  	ints = (unsigned int *) get_property(node, "interrupts", &intlen);
>  	if (!ints) {
> -		err = -ENODEV;
> -		goto out;
> +		char *name = get_property(node, "name", NULL);
> +
> +		/* hot-pluggable cards don't have "interrupts" */
> +		if (name && !strcmp(name, "pci") && !get_property(node, "built-in",
> NULL))
> +			goto fixup_pci;
> +		goto out;
>  	}
>
>  	intrcells = prom_n_intr_cells(node);

--
Hollis Blanchard
IBM Linux Technology Center


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list