I'm running into a problem when resources are read.<br><br>The amd8111 adds two subtractive resources on link 0. The problem is that it has no link 0.<br><br>static void amd8111_lpc_read_resources(struct device * dev)<br>
{<br> struct resource *res;<br><br> printk(BIOS_DEBUG,"%s calls read_resources with %s bus %s \n",<br> __func__, dev->dtsname, dev->bus? dev->bus->dev->dtsname: "NULL");<br>
/* Get the normal pci resources of this device */<br> pci_dev_read_resources(dev);<br><br> /* Add an extra subtractive resource for both memory and I/O */<br> res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));<br>
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED;<br> <br> res = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0));<br> res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED;<br>
printk(BIOS_DEBUG,"%s after read_resources\n", __func__);<br>}<br><br>Either of these changes fix it, but I'd like a little more understanding of why we're trying to do this.<br><br>I like the first change better because it quits trying sooner.<br>
<br>Index: device/device.c<br>===================================================================<br>--- device/device.c (revision 984)<br>+++ device/device.c (working copy)<br>@@ -311,7 +311,7 @@<br> <br> /* Read in subtractive resources behind the current device. */<br>
links = 0;<br>- for (i = 0; i < curdev->resources; i++) {<br>+ for (i = 0; i < curdev->resources && curdev->links>0; i++) {<br> struct resource *resource;<br>
unsigned int link;<br> resource = &curdev->resource[i];<br>@@ -326,7 +326,8 @@<br> }<br> if (!(links & (1 << link))) {<br>
links |= (1 << link);<br>- read_resources(&curdev->link[link]);<br>+ if (curdev->link[link].dev)<br>+ read_resources(&curdev->link[link]);<br>
}<br> }<br> }<br><br><br>Signed-off-by: Myles Watson <<a href="mailto:mylesgw@gmail.com">mylesgw@gmail.com</a>><br><br>Thanks,<br>Myles<br><br><br>