Skip to content

Commit 3ca93a0

Browse files
maheshsalrarbab
authored andcommitted
opal/fsp: Fix opal boot failure on systems with redundant FSP
On systems with redundant FSP, opal detects primary/backup FSPs. However, it ends up considering Backup FSP as active_fsp and starts mailbox communication with it. This causes opal to send IPL messages to backup FSP instead of primary. Since primary FSP never receives IPL messages from OPAL, it assumes that opal failed to boot and enters into termination state. The active_fsp is set during fsp_update_links_states() function which is invoked during boot, through fsp_create_fsp(), as well as reset/reload, through fsp_reinit_fsp(). During the boot, when 2 FSPs are detected by opal, fsp_update_links_states() sets the last one as active_fsp which may not be primary FSP. Fix this issue by detecting/setting primary FSP as active_fsp during opal boot. Signed-off-by: Mahesh Salgaonkar <[email protected]> Signed-off-by: Reza Arbab <[email protected]>
1 parent 3055242 commit 3ca93a0

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

hw/fsp/fsp.c

+18-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ struct fsp {
7676
unsigned int iopath_count;
7777
int active_iopath; /* -1: no active IO path */
7878
struct fsp_iopath iopath[FSP_MAX_IOPATH];
79+
bool primary;
7980
};
8081

8182
enum ipl_state {
@@ -1959,7 +1960,7 @@ static void fsp_update_links_states(struct fsp *fsp)
19591960
}
19601961

19611962
if (fsp->active_iopath >= 0) {
1962-
if (!active_fsp || (active_fsp != fsp))
1963+
if (active_fsp && (active_fsp != fsp))
19631964
active_fsp = fsp;
19641965

19651966
fsp_inbound_off = 0;
@@ -2003,8 +2004,12 @@ static void fsp_create_fsp(struct dt_node *fsp_node)
20032004
fsp->index = index;
20042005
fsp->active_iopath = -1;
20052006

2007+
if (dt_find_property(fsp_node, "primary"))
2008+
fsp->primary = true;
2009+
20062010
count = linksprop->len / 4;
2007-
prlog(PR_DEBUG, "FSP #%d: Found %d IO PATH\n", index, count);
2011+
prlog(PR_DEBUG, "FSP #%d: Found %d IO PATH %s\n", index, count,
2012+
fsp->primary ? "(Primary FSP)" : "");
20082013
if (count > FSP_MAX_IOPATH) {
20092014
prerror("FSP #%d: WARNING, limited to %d IO PATH\n",
20102015
index, FSP_MAX_IOPATH);
@@ -2073,6 +2078,16 @@ int fsp_fatal_msg(struct fsp_msg *msg)
20732078
return rc;
20742079
}
20752080

2081+
static void fsp_init_set_active(void)
2082+
{
2083+
struct fsp *fsp;
2084+
2085+
/* Mark primary FSP as active fsp during boot */
2086+
for (fsp = first_fsp; fsp; fsp = fsp->link)
2087+
if (fsp->primary)
2088+
active_fsp = fsp;
2089+
}
2090+
20762091
static bool fsp_init_one(const char *compat)
20772092
{
20782093
struct dt_node *fsp_node;
@@ -2104,6 +2119,7 @@ static bool fsp_init_one(const char *compat)
21042119
/* Create the FSP data structure */
21052120
fsp_create_fsp(fsp_node);
21062121
}
2122+
fsp_init_set_active();
21072123

21082124
return inited;
21092125
}

0 commit comments

Comments
 (0)