Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdr: PDR loop fix #33

Merged
merged 1 commit into from
Jul 17, 2024
Merged

pdr: PDR loop fix #33

merged 1 commit into from
Jul 17, 2024

Conversation

ArchanaKakani
Copy link
Contributor

While creating the Entity association PDRs, same record handle is used multiple time to create PDR. Because of which 2 PDRs with same record handle are added to the repo. Adding the fix to resolve the duplicate record handle issue.

Tested:
Power on/off and reset reload on mex and non mex systems.

While creating the Entity association PDRs, same record handle
is used multiple time to create PDR. Because of which 2 PDRs
with same record handle are added to the repo causing loop.
Adding the fix to resolve the duplicate record handle issue.

Tested:
Power on/off and reset reload on mex and non mex systems.

Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
@@ -976,9 +979,9 @@ int pldm_entity_association_pdr_add_check(pldm_entity_association_tree *tree,
if (!tree || !repo) {
return 0;
}

uint32_t record_handle = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when we send a record_handle from caller API? it will be set to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pldm_entity_association_pdr_add_check does not take record handle as an argument. So user can not send record_handle to this function and record handle is defaulted to 0 inside the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so that record_handle variable is redundant right?, we can directly pass 0 as how it was earlier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier entity_association_pdr_add was taking "uint32_t record_handle" as argument now I have changed it to take pointer to record handle "uint32_t *record_handle". So we are expected to pass the address of the variable and not the value. To get the address of variable, created a variable record_handle and passing address of this variable to function entity_association_pdr_add.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acknowledged

@@ -976,9 +979,9 @@ int pldm_entity_association_pdr_add_check(pldm_entity_association_tree *tree,
if (!tree || !repo) {
return 0;
}

uint32_t record_handle = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so that record_handle variable is redundant right?, we can directly pass 0 as how it was earlier?

@rfrandse rfrandse merged commit eeb0840 into ibm-openbmc:1110 Jul 17, 2024
1 check passed
ArchanaKakani added a commit to ArchanaKakani/libpldm that referenced this pull request Sep 6, 2024
While creating the Entity association PDRs, same record handle
is used multiple time to create PDR. Because of which 2 PDRs
with same record handle are added to the repo causing loop.
Adding the fix to resolve the duplicate record handle issue.

Tested:
Power on/off and reset reload on mex and non mex systems.

Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
ArchanaKakani added a commit to ArchanaKakani/libpldm that referenced this pull request Sep 6, 2024
While creating the Entity association PDRs, same record handle
is used multiple time to create PDR. Because of which 2 PDRs
with same record handle are added to the repo causing loop.
Adding the fix to resolve the duplicate record handle issue.

Tested:
Power on/off and reset reload on mex and non mex systems.

Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants