[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>
This commit is contained in:
parent
4d404edce3
commit
ca8ffc974d
|
@ -66,24 +66,13 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
|
||||||
* device-tree/ibm,hypertas-functions. Ultimately this functionality may
|
* device-tree/ibm,hypertas-functions. Ultimately this functionality may
|
||||||
* be moved into prom.c prom_init().
|
* be moved into prom.c prom_init().
|
||||||
*/
|
*/
|
||||||
void __init fw_feature_init(void)
|
void __init fw_feature_init(const char *hypertas, unsigned long len)
|
||||||
{
|
{
|
||||||
struct device_node *dn;
|
const char *s;
|
||||||
const char *hypertas, *s;
|
int i;
|
||||||
int len, i;
|
|
||||||
|
|
||||||
DBG(" -> fw_feature_init()\n");
|
DBG(" -> fw_feature_init()\n");
|
||||||
|
|
||||||
dn = of_find_node_by_path("/rtas");
|
|
||||||
if (dn == NULL) {
|
|
||||||
printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
hypertas = of_get_property(dn, "ibm,hypertas-functions", &len);
|
|
||||||
if (hypertas == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
|
for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
|
||||||
for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
|
for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
|
||||||
/* check value against table of strings */
|
/* check value against table of strings */
|
||||||
|
@ -98,7 +87,5 @@ void __init fw_feature_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
|
||||||
of_node_put(dn);
|
|
||||||
DBG(" <- fw_feature_init()\n");
|
DBG(" <- fw_feature_init()\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#ifndef _PSERIES_PSERIES_H
|
#ifndef _PSERIES_PSERIES_H
|
||||||
#define _PSERIES_PSERIES_H
|
#define _PSERIES_PSERIES_H
|
||||||
|
|
||||||
extern void __init fw_feature_init(void);
|
extern void __init fw_feature_init(const char *hypertas, unsigned long len);
|
||||||
|
|
||||||
struct pt_regs;
|
struct pt_regs;
|
||||||
|
|
||||||
|
|
|
@ -320,8 +320,6 @@ static void __init pSeries_init_early(void)
|
||||||
{
|
{
|
||||||
DBG(" -> pSeries_init_early()\n");
|
DBG(" -> pSeries_init_early()\n");
|
||||||
|
|
||||||
fw_feature_init();
|
|
||||||
|
|
||||||
if (firmware_has_feature(FW_FEATURE_LPAR))
|
if (firmware_has_feature(FW_FEATURE_LPAR))
|
||||||
find_udbg_vterm();
|
find_udbg_vterm();
|
||||||
|
|
||||||
|
@ -343,12 +341,19 @@ static int __init pSeries_probe_hypertas(unsigned long node,
|
||||||
const char *uname, int depth,
|
const char *uname, int depth,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
|
const char *hypertas;
|
||||||
|
unsigned long len;
|
||||||
|
|
||||||
if (depth != 1 ||
|
if (depth != 1 ||
|
||||||
(strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
|
(strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL)
|
hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
|
||||||
|
if (!hypertas)
|
||||||
|
return 1;
|
||||||
|
|
||||||
powerpc_firmware_features |= FW_FEATURE_LPAR;
|
powerpc_firmware_features |= FW_FEATURE_LPAR;
|
||||||
|
fw_feature_init(hypertas, len);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue