Michael Ellerman 61e8a0d5a0 powerpc/pci: Fix endian bug in fixed PHB numbering
The recent commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number
based on device-tree properties"), added code to read a 64-bit property
from the device tree, and if not found read a 32-bit property (reg).

There was a bug in the 32-bit case, on big endian machines, due to the
use of the 64-bit value to read the 32-bit property. The cast of &prop
means we end up writing to the high 32-bit of prop, leaving the low
32-bits containing whatever junk was on the stack.

If that junk value was non-zero, and < MAX_PHBS, we would end up using
it as the PHB id. This results in users seeing what appear to be random
PHB ids.

Fix it by reading into a u32 property and then assigning that to the
u64 value, letting the CPU do the correct conversions for us.

Fixes: 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on device-tree properties")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-08-09 16:52:03 +10:00
..
2016-01-20 17:09:18 -08:00
2016-01-20 17:09:18 -08:00
2016-06-14 13:58:26 +10:00
2016-06-21 15:30:56 +10:00
2016-07-15 14:57:47 +10:00
2014-11-27 09:32:58 +11:00
2015-08-06 15:10:20 +10:00
2016-05-20 10:12:41 -07:00
2015-03-24 13:15:52 +11:00
2016-07-15 14:57:47 +10:00
2016-06-14 13:58:26 +10:00
2015-12-14 20:40:32 +11:00
2016-08-05 09:48:22 -04:00
2015-04-07 17:15:13 +10:00
2016-08-09 16:52:00 +10:00