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

Fix one byte UART transmissions for lowrisc (maybe) #1817

Merged
merged 1 commit into from May 11, 2020

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented May 1, 2020

Pull Request Overview

This pull request attempts to fix #1736. The issue is that the lowrisc UART TX driver can call a callback directly after a request is made, but for Tock's concurrency model that callback must be issued in response to an interrupt being handled so that the original caller can complete before the callback executes.

This change forces a TX interrupt to always happen, and only issues the callback in the handle_interrupt call if all bytes have been transmitted.

Testing Strategy

This is where I need help. I don't have an open titan setup, so this PR needs to be tested.

TODO or Help Wanted

Help with someone checking if this is a valid fix.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

@bradjc bradjc added the WG-OpenTitan In the purview of the OpenTitan working group. label May 1, 2020
Copy link
Contributor

@alistair23 alistair23 left a comment

Choose a reason for hiding this comment

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

I tested this patch and don't see any regressions. I never saw the original issue so I'm unable to confirm it's fixed.

Copy link
Contributor

@phil-levis phil-levis left a comment

Choose a reason for hiding this comment

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

Looks good to me. I can't test the code, but conceptually making every write behave identically is a good idea, and issuing reentrant callbacks is a no-no.

@alistair23
Copy link
Contributor

Ping! I hit this issue and this PR does fix it.

Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

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

bors r+

@bors
Copy link
Contributor

bors bot commented May 11, 2020

@bors bors bot merged commit 53ae5db into master May 11, 2020
@bors bors bot deleted the lowrisc-uart-callback-fix branch May 11, 2020 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WG-OpenTitan In the purview of the OpenTitan working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

single-byte console writes never complete
4 participants