[Skiboot] [PATCH 1/2] phb4: Fix lost bit in PE number on config accesses

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Nov 16 11:36:05 AEDT 2017


A PE number can be up to 9 bits, using a uint8_t won't fly..

That was causing error on config accesses to freeze the
wrong PE.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/phb4.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index 4f10db32..96a6e0de 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -257,7 +257,7 @@ static inline void phb4_ioda_sel(struct phb4 *p, uint32_t table,
  */
 static int64_t phb4_pcicfg_check(struct phb4 *p, uint32_t bdfn,
 				 uint32_t offset, uint32_t size,
-				 uint8_t *pe)
+				 uint16_t *pe)
 {
 	uint32_t sm = size - 1;
 
@@ -437,7 +437,7 @@ static int64_t phb4_pcicfg_read(struct phb4 *p, uint32_t bdfn,
 {
 	uint64_t addr, val64;
 	int64_t rc;
-	uint8_t pe;
+	uint16_t pe;
 	bool use_asb = false;
 
 	rc = phb4_pcicfg_check(p, bdfn, offset, size, &pe);
@@ -530,7 +530,7 @@ static int64_t phb4_pcicfg_write(struct phb4 *p, uint32_t bdfn,
 {
 	uint64_t addr;
 	int64_t rc;
-	uint8_t pe;
+	uint16_t pe;
 	bool use_asb = false;
 
 	rc = phb4_pcicfg_check(p, bdfn, offset, size, &pe);
-- 
2.13.6



More information about the Skiboot mailing list