Skip to content

fix(rp2): misc spinlock-related fixes - #5041

Merged
deadprogram merged 4 commits into
tinygo-org:devfrom
mikesmitty:ms/disable-dbgpause
Sep 19, 2025
Merged

deadprogram merged 4 commits into
tinygo-org:devfrom
mikesmitty:ms/disable-dbgpause

Conversation

@mikesmitty

@mikesmitty mikesmitty commented Sep 16, 2025 •

Copy link
Copy Markdown
Contributor

DBGPAUSE pauses the timer used for sleep pauses when a debugger is attached, which gets annoying to debug. Might be related to https://github.com/tinygo-org/tinygo/blob/v0.39.0/src/runtime/runtime_rp2.go#L314

Comment thread src/machine/machine_rp2_timer.go Outdated
Comment thread src/machine/machine_rp2_timer.go Outdated

@eliasnaur eliasnaur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but you probably want to change the PR title to reflect that you're fixing multiple issues.

Comment thread src/machine/machine_rp2_timer.go
@mikesmitty

Copy link
Copy Markdown
Contributor Author

LGTM, but you probably want to change the PR title to reflect that you're fixing multiple issues.

Ah yeah, good point. I ended up adding more things than I planned originally

@mikesmitty mikesmitty changed the title fix(rp2): disable DBGPAUSE on startup fix(rp2): misc spinlock-related fixes Sep 17, 2025
@mikesmitty

mikesmitty commented Sep 17, 2025 •

Copy link
Copy Markdown
Contributor Author

I thought I was done, but here's one more. schedulerLock can stay held through a soft reset, especially if the reset happens while all tasks are sleeping, and since spinlocks don't get reset during a soft reset it will hang the scheduler before runtime.init() is called

@eliasnaur eliasnaur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/runtime/runtime_rp2.go Outdated
@deadprogram

Copy link
Copy Markdown
Member

Thank you for the fixes here @mikesmitty and to @eliasnaur for review. Now merging.

@deadprogram
deadprogram merged commit 310df7a into tinygo-org:dev Sep 19, 2025
18 of 19 checks passed
@mikesmitty
mikesmitty deleted the ms/disable-dbgpause branch September 22, 2025 19:05
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.

3 participants