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

Remove extra _deselect to prevent possible hard fault #8587

Merged
merged 1 commit into from Nov 7, 2018

Conversation

Projects
None yet
6 participants
@jarlamsa
Contributor

jarlamsa commented Oct 30, 2018

Description

If read timeout happens, the _deselect will get called twice causing a hard fault happening when mutex is released without being locked.
The SDBlockDevice::read is calling the _deselect in every case.

Pull request type

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

@cmonr cmonr requested a review from ARMmbed/mbed-os-storage Oct 30, 2018

@cmonr cmonr added the needs: review label Oct 30, 2018

@jarlamsa

This comment has been minimized.

Contributor

jarlamsa commented Nov 5, 2018

@ARMmbed/mbed-os-storage please review

@dannybenor

This comment has been minimized.

dannybenor commented Nov 5, 2018

@deepikabhavnani Can you help on this review?

@0xc0170 0xc0170 requested a review from deepikabhavnani Nov 5, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 5, 2018

If read timeout happens, the _deselect will get called twice causing a hard fault happening when mutex is released without being locked.
The SDBlockDevice::read is calling the _deselect in every case.

@jarlamsa This should be part of the commit message to explain why we are removing it, please update

@jarlamsa

This comment has been minimized.

Contributor

jarlamsa commented Nov 5, 2018

@0xc0170 Do we have some length constraint for the commit message?

@kjbracey-arm

This comment has been minimized.

Contributor

kjbracey-arm commented Nov 5, 2018

Just stick to the usual open-source commit message guidelines:

https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

Summary should be short, body can be as many paragraphs as you like.

Remove extra _deselect to prevent possible hard fault
If read timeout happens, the _deselect will get called twice causing
a hard fault happening when mutex is released without being locked.
The SDBlockDevice::read is calling the _deselect in every case.

@jarlamsa jarlamsa force-pushed the jarlamsa:sdblockdevice_deselect branch from 3caf9e2 to 36f1fa0 Nov 5, 2018

@jarlamsa

This comment has been minimized.

Contributor

jarlamsa commented Nov 5, 2018

Thanks @kjbracey-arm, updated

@deepikabhavnani

This comment has been minimized.

Contributor

deepikabhavnani commented Nov 5, 2018

If read timeout happens, the _deselect will get called twice

_deselect is called once here https://github.com/ARMmbed/mbed-os/pull/8587/files#diff-fab2d13deb54b56303334ba4f340d4deL895 as per the code change, which is the other location it is called from ?

Never mind, I got confused between _read and _read_bytes earlier. Got the answer _read does not need _deselect on any return, it is taken care of here

@deepikabhavnani

Good catch.. Looks good to me 👍

@cmonr

This comment has been minimized.

Contributor

cmonr commented Nov 7, 2018

Note: This PR is now a part of a rollup PR (#8663).

No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged.

If any more commits are made in this PR, this PR will remain open and have to go through CI on its own.

@0xc0170 0xc0170 merged commit 36f1fa0 into ARMmbed:master Nov 7, 2018

14 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/unittests Success
Details
travis-ci/astyle Passed, 545 files (+0 files)
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 10327 cycles (+400 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@0xc0170 0xc0170 removed the needs: CI label Nov 7, 2018

@jarlamsa jarlamsa deleted the jarlamsa:sdblockdevice_deselect branch Nov 7, 2018

@cmonr cmonr removed the rollup PR label Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment