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