Skip to content

spi: add non-blocking bus acquisition - #126

Merged
floitsch merged 1 commit into
patch-head-5.4.2from
floitsch/spi-try-acquire
Aug 10, 2026
Merged

spi: add non-blocking bus acquisition#126
floitsch merged 1 commit into
patch-head-5.4.2from
floitsch/spi-try-acquire

Conversation

@floitsch

@floitsch floitsch commented Aug 6, 2026

Copy link
Copy Markdown
Member

Adds an explicit non-blocking SPI bus-acquisition API for asynchronous runtimes. A failed try does not leave a pending lock request behind, while success has the same release contract as spi_device_acquire_bus.

This is needed by the stacked Toit asynchronous SPI controller change: primitives must never wait on an RTOS semaphore.

Validated through two-device Toit hardware tests on ESP32 and ESP32-S3, including repeated acquisition attempts while an interrupt-driven transaction owns the bus.

Stacked on #125.

@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from a8a6c03 to 6aa66fa Compare August 10, 2026 12:42
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch 2 times, most recently from 57b4b78 to 87ff296 Compare August 10, 2026 14:28
@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from 6aa66fa to 33e8d49 Compare August 10, 2026 14:28
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch from 87ff296 to d591fb4 Compare August 10, 2026 16:02
@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from a759c0a to c96237a Compare August 10, 2026 17:58
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch from d591fb4 to 5dbd37e Compare August 10, 2026 17:58
@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from c96237a to c574357 Compare August 10, 2026 20:04
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch 2 times, most recently from 6f51f7f to e36931a Compare August 10, 2026 21:39
@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from c574357 to ee96ee8 Compare August 10, 2026 21:39
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch from e36931a to 9b402a6 Compare August 10, 2026 21:48
@floitsch
floitsch force-pushed the floitsch/spi-target-fixes branch from ee96ee8 to 0e068a0 Compare August 10, 2026 21:48
@floitsch
floitsch marked this pull request as ready for review August 10, 2026 22:41
@floitsch

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@floitsch, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ca1103c5-0659-44c9-9b35-ed77ff019909

📥 Commits

Reviewing files that changed from the base of the PR and between 0e068a0 and 9b402a6.

📒 Files selected for processing (4)
  • components/esp_driver_spi/include/driver/spi_master.h
  • components/esp_driver_spi/src/gpspi/spi_master.c
  • components/esp_hw_support/include/esp_private/spi_share_hw_ctrl.h
  • components/esp_hw_support/spi_bus_lock.c

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from floitsch/spi-target-fixes to floitsch/i2c-async-controller August 10, 2026 22:52
@floitsch
floitsch force-pushed the floitsch/spi-try-acquire branch from 9b402a6 to 6cfc76d Compare August 10, 2026 22:55
@floitsch
floitsch changed the base branch from floitsch/i2c-async-controller to patch-head-5.4.2 August 10, 2026 22:55
@floitsch
floitsch merged commit 9d41f3a into patch-head-5.4.2 Aug 10, 2026
1 of 2 checks passed
@floitsch
floitsch deleted the floitsch/spi-try-acquire branch August 10, 2026 22:55
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.

1 participant