Skip to content

Commit cd4b58c

Browse files
committed
Fix hangs while quering HW context report
Fix hangs while quering HW context report on platforms that do not support app health. Signed-off-by: Nishad Saraf <[email protected]>
1 parent be90de6 commit cd4b58c

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/driver/amdxdna/aie2_message.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,19 @@ int aie2_register_asyn_event_msg(struct amdxdna_dev_hdl *ndev, struct aie2_mgmt_
682682
return xdna_mailbox_send_msg(ndev->mgmt_chann, &msg, TX_TIMEOUT);
683683
}
684684

685+
void aie2_reset_app_health_report(struct app_health_report *r)
686+
{
687+
if (!r)
688+
return;
689+
690+
r->fatal_info.exception_type = AIE2_APP_HEALTH_RESET_FATAL_INFO;
691+
r->fatal_info.exception_pc = AIE2_APP_HEALTH_RESET_FATAL_INFO;
692+
r->fatal_info.app_module = AIE2_APP_HEALTH_RESET_FATAL_INFO;
693+
r->fatal_info.fatal_type = AIE2_APP_HEALTH_RESET_FATAL_INFO;
694+
r->txn_op_id = AIE2_APP_HEALTH_RESET_TXN_OP_ID;
695+
r->ctx_pc = AIE2_APP_HEALTH_RESET_CTX_PC;
696+
}
697+
685698
int aie2_get_app_health(struct amdxdna_dev_hdl *ndev, struct aie2_mgmt_dma_hdl *mgmt_hdl,
686699
u32 context_id, u32 size)
687700
{

src/driver/amdxdna/aie2_pci.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,14 +1285,9 @@ static int aie2_query_ctx_status_array(struct amdxdna_client *client,
12851285
ctx->priv->id, sizeof(*r));
12861286
mutex_unlock(&xdna->dev_handle->aie2_lock);
12871287
if (ret)
1288-
return ret;
1288+
aie2_reset_app_health_report(r);
12891289
} else {
1290-
r->fatal_info.exception_type = AIE2_APP_HEALTH_RESET_FATAL_INFO;
1291-
r->fatal_info.exception_pc = AIE2_APP_HEALTH_RESET_FATAL_INFO;
1292-
r->fatal_info.app_module = AIE2_APP_HEALTH_RESET_FATAL_INFO;
1293-
r->fatal_info.fatal_type = AIE2_APP_HEALTH_RESET_FATAL_INFO;
1294-
r->txn_op_id = AIE2_APP_HEALTH_RESET_TXN_OP_ID;
1295-
r->ctx_pc = AIE2_APP_HEALTH_RESET_CTX_PC;
1290+
aie2_reset_app_health_report(r);
12961291
}
12971292

12981293
tmp[hw_i].fatal_error_exception_type = r->fatal_info.exception_type;

src/driver/amdxdna/aie2_pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ int aie2_query_aie_telemetry(struct amdxdna_dev_hdl *ndev, struct aie2_mgmt_dma_
511511
u32 type, u32 size, struct aie_version *version);
512512
int aie2_get_app_health(struct amdxdna_dev_hdl *ndev, struct aie2_mgmt_dma_hdl *mgmt_hdl,
513513
u32 context_id, u32 size);
514+
void aie2_reset_app_health_report(struct app_health_report *r);
514515
int aie2_query_aie_version(struct amdxdna_dev_hdl *ndev, struct aie_version *version);
515516
int aie2_query_aie_metadata(struct amdxdna_dev_hdl *ndev, struct aie_metadata *metadata);
516517
int aie2_query_aie_firmware_version(struct amdxdna_dev_hdl *ndev,

0 commit comments

Comments
 (0)