[POWERPC] Fix future firmware feature fixups function failure

Move firmware feature initialisation from pSeries_init_early to the
earlier pSeries_probe_hypertas so they are initialised before firmware
feature fixups are applied.

Currently firmware feature sections are only used for iSeries which
initialises the these features much earlier. This is a bug in waiting
on pSeries.

Also adds some whitespace fixups.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Michael Neuling and committed by
Paul Mackerras
ca8ffc97 4d404edc

+15 -23
+3 -16
arch/powerpc/platforms/pseries/firmware.c
··· 66 * device-tree/ibm,hypertas-functions. Ultimately this functionality may 67 * be moved into prom.c prom_init(). 68 */ 69 - void __init fw_feature_init(void) 70 { 71 - struct device_node *dn; 72 - const char *hypertas, *s; 73 - int len, i; 74 75 DBG(" -> fw_feature_init()\n"); 76 - 77 - dn = of_find_node_by_path("/rtas"); 78 - if (dn == NULL) { 79 - printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); 80 - goto out; 81 - } 82 - 83 - hypertas = of_get_property(dn, "ibm,hypertas-functions", &len); 84 - if (hypertas == NULL) 85 - goto out; 86 87 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { 88 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { ··· 87 } 88 } 89 90 - out: 91 - of_node_put(dn); 92 DBG(" <- fw_feature_init()\n"); 93 }
··· 66 * device-tree/ibm,hypertas-functions. Ultimately this functionality may 67 * be moved into prom.c prom_init(). 68 */ 69 + void __init fw_feature_init(const char *hypertas, unsigned long len) 70 { 71 + const char *s; 72 + int i; 73 74 DBG(" -> fw_feature_init()\n"); 75 76 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { 77 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { ··· 98 } 99 } 100 101 DBG(" <- fw_feature_init()\n"); 102 }
+1 -1
arch/powerpc/platforms/pseries/pseries.h
··· 10 #ifndef _PSERIES_PSERIES_H 11 #define _PSERIES_PSERIES_H 12 13 - extern void __init fw_feature_init(void); 14 15 struct pt_regs; 16
··· 10 #ifndef _PSERIES_PSERIES_H 11 #define _PSERIES_PSERIES_H 12 13 + extern void __init fw_feature_init(const char *hypertas, unsigned long len); 14 15 struct pt_regs; 16
+11 -6
arch/powerpc/platforms/pseries/setup.c
··· 320 { 321 DBG(" -> pSeries_init_early()\n"); 322 323 - fw_feature_init(); 324 - 325 if (firmware_has_feature(FW_FEATURE_LPAR)) 326 find_udbg_vterm(); 327 ··· 341 const char *uname, int depth, 342 void *data) 343 { 344 if (depth != 1 || 345 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) 346 - return 0; 347 348 - if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) 349 - powerpc_firmware_features |= FW_FEATURE_LPAR; 350 351 - return 1; 352 } 353 354 static int __init pSeries_probe(void)
··· 320 { 321 DBG(" -> pSeries_init_early()\n"); 322 323 if (firmware_has_feature(FW_FEATURE_LPAR)) 324 find_udbg_vterm(); 325 ··· 343 const char *uname, int depth, 344 void *data) 345 { 346 + const char *hypertas; 347 + unsigned long len; 348 + 349 if (depth != 1 || 350 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) 351 + return 0; 352 353 + hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len); 354 + if (!hypertas) 355 + return 1; 356 357 + powerpc_firmware_features |= FW_FEATURE_LPAR; 358 + fw_feature_init(hypertas, len); 359 + 360 + return 1; 361 } 362 363 static int __init pSeries_probe(void)