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

Refactor and Update the tcti-x-helper #2899

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wxleong
Copy link
Member

@wxleong wxleong commented Sep 24, 2024

  • Moved common transmit/receive FIFO protocol code to tcti-helper-common.
  • Refined the FIFO protocol implementation.
  • Updated unit test implementation so that changes to the FIFO protocol no longer require modifications to all dependent unit tests.

Resolves #2891, resolves #2620

src/tss2-tcti/tcti-helper-common.c Fixed Show fixed Hide fixed
src/tss2-tcti/tcti-helper-common.c Fixed Show fixed Hide fixed
src/tss2-tcti/tcti-helper-common.c Fixed Show fixed Hide fixed
@wxleong wxleong force-pushed the fix-tcti-helper branch 7 times, most recently from 6a34882 to 96e137c Compare October 1, 2024 01:18
@wxleong wxleong force-pushed the fix-tcti-helper branch 3 times, most recently from 4f76b2c to 9682496 Compare October 4, 2024 02:04
- Moved common transmit/receive FIFO protocol code to tcti-helper-common.
- Refined the FIFO protocol implementation.
- Updated unit test implementation so that changes to the FIFO protocol
  no longer require modifications to all dependent unit tests.

Signed-off-by: wenxin.leong <[email protected]>
LOG_ERROR ("Failed to send the command");
return rc;
}

Copy link
Member

Choose a reason for hiding this comment

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

Here we should check for STS_VALID | EXPECT, not ?

LOG_ERROR ("Failed to send the command");
return rc;
}

Copy link
Member

Choose a reason for hiding this comment

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

Here we should again check for STS_VALID | EXPECT

}

/* Await TPM readiness */
expected_status_bits = TCTI_HELPER_COMMON_TPM_STS_VALID | TCTI_HELPER_COMMON_TPM_STS_DATA_EXPECT;
Copy link
Member

Choose a reason for hiding this comment

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

Here, the expected status should be STS_VALID | !EXPECT

I wonder why this still works ?

return TSS2_RC_SUCCESS;
}

TSS2_RC Tcti_Helper_Common_Transmit (TCTI_HELPER_COMMON_CONTEXT *ctx, size_t size, const uint8_t *cmd_buf)
Copy link
Member

Choose a reason for hiding this comment

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

We are missing the retry-logic in this function.
It always goes directly to "return error"

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.

SPI-Helper: Checking expect bit requires checking stsValid as well Improve Robustness of tcti-spi-helper
2 participants