osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c | 35 ++++++++++++-----------
osaf/services/saf/plmsv/plms/plms_he_pres_fsm.c | 8 ++--
2 files changed, 22 insertions(+), 21 deletions(-)
Jul 14 16:56:02 linux-po6q osafplmd[32627]: ER plms_hrb_req FAILED. Ent:
safHE=Fan_Tray_1,safDomain=Q50chassis, cmd: 6#011#011#011resp: 2
Jul 14 16:56:02 linux-po6q osafplmd[32627]: ER Ent
safHE=Fan_Tray_1,safDomain=Q50chassis deactivation failed.
PLMs is using SAHPI_POWER_ON/OFF for Full/Partial-5 Hotswap entities, which is
not correct. This is not consistent with hsm_get_hotswap_model() in plms_hsm.c
which sets Full/Partial-5 based on whether or not
SAHPI_CAPABILITY_MANAGED_HOTSWAP
is set. If SAHPI_CAPABILITY_POWER is set, then the model is 3-HS. According to
the documentation for saHpiResourcePowerStateSet "SA_ERR_HPI_CAPABILITY is
returned if the resource does not support power management, as indicated by
SAHPI_CAPABILITY_POWER in the resource's RPT entry." A Full/Partial-5 will
never have SAHPI_CAPABILITY_POWER set.
SAHPI_HS_ACTION_INSERTION/EXTRACTION should be used instead for Full/Partial-5
entities. Also, some changes were made to facilitate debugging. The code is
printing out SaErrorT as an unsigned int, but it is a signed int, so the return
codes from these HPI API calls are not properly printing out.
diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
--- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
+++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
@@ -266,6 +266,7 @@ static SaUint32T hrb_process_hpi_req( PL
PLMS_INV_DATA inv_data;
SaHpiRptEntryT rpt_entry;
SaUint32T rc = NCSCC_RC_SUCCESS;
+ SaErrorT hpirc = SA_OK;
TRACE_ENTER();
@@ -318,21 +319,21 @@ static SaUint32T hrb_process_hpi_req( PL
case PLMS_HPI_CMD_ACTION_REQUEST:
/* insertion or extraction request depending upon
the hpi_req->arg type */
- rc = saHpiHotSwapActionRequest(cb->session_id,
+ hpirc = saHpiHotSwapActionRequest(cb->session_id,
resourceid,hpi_req->arg);
break;
case PLMS_HPI_CMD_RESOURCE_ACTIVE_SET:
/* Transition from INSERTION PENDING or
EXTRACTION PENDING state to ACTIVE */
- rc = saHpiResourceActiveSet(cb->session_id,
+ hpirc = saHpiResourceActiveSet(cb->session_id,
resourceid);
break;
case PLMS_HPI_CMD_RESOURCE_INACTIVE_SET:
/* Transition from INSERTION PENDING or
EXTRACTION PENDING state to INACTIVE */
- rc = saHpiResourceInactiveSet(cb->session_id,
+ hpirc = saHpiResourceInactiveSet(cb->session_id,
resourceid);
break;
@@ -340,41 +341,41 @@ static SaUint32T hrb_process_hpi_req( PL
case PLMS_HPI_CMD_RESOURCE_POWER_OFF:
/* Perform power control operation
be based on the value of hpi_req->arg*/
- rc = saHpiResourcePowerStateSet(cb->session_id,
+ hpirc = saHpiResourcePowerStateSet(cb->session_id,
resourceid, hpi_req->arg);
break;
case PLMS_HPI_CMD_RESOURCE_RESET:
- rc = saHpiResourceResetStateSet(
- cb->session_id,
- resourceid,
- (SaHpiResetActionT)hpi_req->arg);
- if (SA_OK != rc && hpi_req->arg == SAHPI_WARM_RESET ){
- TRACE("warm reset failed ret val:%u so \
- attempting cold reset",rc);
- rc = saHpiResourceResetStateSet(
+ hpirc = saHpiResourceResetStateSet(
+ cb->session_id,
+ resourceid,
+ (SaHpiResetActionT)hpi_req->arg);
+ if (SA_OK != hpirc && hpi_req->arg == SAHPI_WARM_RESET
){
+ TRACE("warm reset failed ret val:%i so \
+ attempting cold reset",hpirc);
+ hpirc = saHpiResourceResetStateSet(
cb->session_id,
resourceid,
(SaHpiResetActionT)
SAHPI_COLD_RESET);
TRACE("cold reset saHpiResourceResetStateSet \
- ret val:%u",rc);
+ ret val:%i",hpirc);
}
break;
case PLMS_HPI_CMD_RESOURCE_IDR_GET:
/* Retrieve IDR info */
- rc = hsm_get_idr_info(&rpt_entry,&inv_data);
+ hpirc = hsm_get_idr_info(&rpt_entry,&inv_data);
break;
default:
LOG_ER("HRB:Invalid request from PLMS");
return NCSCC_RC_FAILURE;
}
- TRACE("Processing Status for hpi request for res:%u HPI resp:%u",
- resourceid,rc);
+ TRACE("Processing Status for hpi request for res:%u HPI resp:%i",
+ resourceid,hpirc);
- if(rc)
+ if(hpirc != SA_OK)
response->ret_val = NCSCC_RC_FAILURE;
else
response->ret_val = NCSCC_RC_SUCCESS;
diff --git a/osaf/services/saf/plmsv/plms/plms_he_pres_fsm.c
b/osaf/services/saf/plmsv/plms/plms_he_pres_fsm.c
--- a/osaf/services/saf/plmsv/plms/plms_he_pres_fsm.c
+++ b/osaf/services/saf/plmsv/plms/plms_he_pres_fsm.c
@@ -3734,8 +3734,8 @@ SaUint32T plms_he_deactivate(PLMS_ENTITY
ent->entity.he_entity.saPlmHEPresenceState){
if (!ent->deact_in_pro){
ret_err = plms_hrb_req(ent,
- PLMS_HPI_CMD_RESOURCE_POWER_OFF,
- SAHPI_POWER_OFF/*arg*/);
+ PLMS_HPI_CMD_ACTION_REQUEST,
+ SAHPI_HS_ACTION_EXTRACTION/*arg*/);
if (NCSCC_RC_SUCCESS == ret_err)
ent->deact_in_pro = true;
}else{
@@ -3864,8 +3864,8 @@ SaUint32T plms_he_activate(PLMS_ENTITY *
ent->entity.he_entity.saPlmHEPresenceState){
if (!ent->act_in_pro){
ret_err = plms_hrb_req(ent,
- PLMS_HPI_CMD_RESOURCE_POWER_ON,
- SAHPI_POWER_ON/*arg*/);
+ PLMS_HPI_CMD_ACTION_REQUEST,
+ SAHPI_HS_ACTION_INSERTION/*arg*/);
if (NCSCC_RC_SUCCESS == ret_err){
ent->act_in_pro = true;
}
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel