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

SPI: Prime asynch transaction buffer on construction #10480

Merged
merged 1 commit into from May 14, 2019

Conversation

Projects
None yet
6 participants
@kjbracey-arm
Copy link
Contributor

commented Apr 25, 2019

Description

SPI peripherals' asynch transaction buffers are now wrapped by SingletonPtr, which needs to take the singleton_lock Mutex when first accessed. If it was first accessed by an asynch transaction started from IRQ, that would not be possible.

Add a SingletonPtr::get() call to the SPI construction process so that the peripheral's buffer is fully constructed before any SPI methods can be called, meaning asynch methods won't fail from IRQ.

(Other pre-existing synchronisation issues with async remain, but this avoids a new trap in Mbed OS 5.12).

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@stevew817

SPI: Prime asynch transaction buffer on construction
SPI peripherals' asynch transaction buffers are now wrapped by
SingletonPtr, which needs to take the singleton_lock Mutex when first
accessed. If it was first accessed by an asynch transaction started from
IRQ, that would not be possible.

Add a SingletonPtr::get() call to the SPI construction process so that
the peripheral's buffer is fully constructed before any SPI methods can
be called, meaning asynch methods won't fail from IRQ.

(Other pre-existing synchronisation issues with async remain, but this
avoids a new trap in Mbed OS 5.12).

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:spi_prime branch from 9ca367c to 3fbad10 Apr 25, 2019

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Apr 25, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@kjbracey-arm, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 2, 2019

@adbridge

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

Ci started

@mbed-ci

This comment has been minimized.

Copy link

commented May 7, 2019

Test run: FAILED

Summary: 2 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_dynamic-memory-usage
  • jenkins-ci/mbed-os-ci_greentea-test
@0xc0170

This comment has been minimized.

Copy link
Member

commented May 10, 2019

Ci restarted

@mbed-ci

This comment has been minimized.

Copy link

commented May 13, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test
@0xc0170

This comment has been minimized.

Copy link
Member

commented May 14, 2019

CI was restarted, now all green

@0xc0170 0xc0170 merged commit 64575fe into ARMmbed:master May 14, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8590 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details

@kjbracey-arm kjbracey-arm deleted the kjbracey-arm:spi_prime branch May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.