diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/fsp/fsp-ipmi.c | 9 | ||||
-rw-r--r-- | hw/fsp/fsp-sensor.c | 6 | ||||
-rw-r--r-- | hw/fsp/fsp.c | 16 |
3 files changed, 31 insertions, 0 deletions
diff --git a/hw/fsp/fsp-ipmi.c b/hw/fsp/fsp-ipmi.c index f803f179..d262cee6 100644 --- a/hw/fsp/fsp-ipmi.c +++ b/hw/fsp/fsp-ipmi.c @@ -126,6 +126,9 @@ static int fsp_ipmi_send_request(void) struct fsp_msg *msg; int rc; + if (fsp_in_rr()) + return OPAL_BUSY; + lock(&fsp_ipmi.lock); /* An outstanding request is still pending */ if (fsp_ipmi.cur_msg) { @@ -208,6 +211,9 @@ static int fsp_ipmi_queue_msg(struct ipmi_msg *ipmi_msg) struct fsp_ipmi_msg *fsp_ipmi_msg = container_of(ipmi_msg, struct fsp_ipmi_msg, ipmi_msg); + if (fsp_in_rr()) + return OPAL_BUSY; + lock(&fsp_ipmi.lock); list_add_tail(&fsp_ipmi.msg_queue, &fsp_ipmi_msg->link); unlock(&fsp_ipmi.lock); @@ -220,6 +226,9 @@ static int fsp_ipmi_queue_msg_head(struct ipmi_msg *ipmi_msg) struct fsp_ipmi_msg *fsp_ipmi_msg = container_of(ipmi_msg, struct fsp_ipmi_msg, ipmi_msg); + if (fsp_in_rr()) + return OPAL_BUSY; + lock(&fsp_ipmi.lock); list_add(&fsp_ipmi.msg_queue, &fsp_ipmi_msg->link); unlock(&fsp_ipmi.lock); diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 0fa31156..63635303 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -376,6 +376,9 @@ static int64_t fsp_sensor_send_read_request(struct opal_sensor_data *attr) uint32_t align; uint32_t cmd_header; + if (fsp_in_rr()) + return OPAL_BUSY; + prlog(PR_INSANE, "Get the data for modifier [%x]\n", spcn_mod_data[attr->mod_index].mod); @@ -516,6 +519,9 @@ int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, prlog(PR_INSANE, "fsp_opal_read_sensor [%08x]\n", sensor_hndl); + if (fsp_in_rr()) + return OPAL_BUSY; + if (sensor_state == SENSOR_PERMANENT_ERROR) { rc = OPAL_HARDWARE; goto out; diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c index c25e42c8..a0c5a788 100644 --- a/hw/fsp/fsp.c +++ b/hw/fsp/fsp.c @@ -409,6 +409,22 @@ static bool fsp_in_reset(struct fsp *fsp) } } +bool fsp_in_rr(void) +{ + struct fsp *fsp = fsp_get_active(); + struct fsp_iopath *iop; + + if (fsp->active_iopath < 0) + return true; + + iop = &fsp->iopath[fsp->active_iopath]; + + if (fsp_in_reset(fsp) || fsp_in_hir(fsp) || !(psi_check_link_active(iop->psi))) + return true; + + return false; +} + static bool fsp_hir_state_timeout(void) { u64 now = mftb(); |