Skip to contentSkip to conversation

powerpc: fix OF pci flags parsing

PATCH In review Olof Johansson 2 participants 2 messages Nov 28, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: fix OF pci flags parsing

For PCI devices with only io ports, of_bus_pci_get_flags() will fall through and still mark the resource as IORESOURCE_MEM.

---

This should be fine to hold until 2.6.20, since noone (as far as I know) has hit it in the wild.

arch/powerpc/kernel/prom_parse.c +2 -0
index 346fb7b..0dfbe1c 100644
@@ -160,9 +160,11 @@ static unsigned int of_bus_pci_get_flags
 	switch((w >> 24) & 0x03) {
 	case 0x01:
 		flags |= IORESOURCE_IO;
+		break;
 	case 0x02: /* 32 bits */
 	case 0x03: /* 64 bits */
 		flags |= IORESOURCE_MEM;
+		break;
 	}
 	if (w & 0x40000000)
 		flags |= IORESOURCE_PREFETCH;
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Olof Johansson

For PCI devices with only io ports, of_bus_pci_get_flags() will fall through and still mark the resource as IORESOURCE_MEM.

Oops :-)

Quoted 22 lines

---

This should be fine to hold until 2.6.20, since noone (as far as I know) has hit it in the wild.

arch/powerpc/kernel/prom_parse.c +2 -0
index 346fb7b..0dfbe1c 100644
@@ -160,9 +160,11 @@ static unsigned int of_bus_pci_get_flags
 	switch((w >> 24) & 0x03) {
 	case 0x01:
 		flags |= IORESOURCE_IO;
+		break;
 	case 0x02: /* 32 bits */
 	case 0x03: /* 64 bits */
 		flags |= IORESOURCE_MEM;
+		break;
 	}
 	if (w & 0x40000000)
 		flags |= IORESOURCE_PREFETCH;