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

Remove extra _deselect to prevent possible hard fault #8587

Merged
merged 1 commit into from
Nov 7, 2018

Conversation

jarlamsa
Copy link
Contributor

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 a team October 30, 2018 13:48
@jarlamsa
Copy link
Contributor Author

jarlamsa commented Nov 5, 2018

@ARMmbed/mbed-os-storage please review

@dannybenor
Copy link

@deepikabhavnani Can you help on this review?

@0xc0170
Copy link
Contributor

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
Copy link
Contributor Author

jarlamsa commented Nov 5, 2018

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

@kjbracey
Copy link
Contributor

kjbracey 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.

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
Copy link
Contributor Author

jarlamsa commented Nov 5, 2018

Thanks @kjbracey-arm, updated

@deepikabhavnani
Copy link

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

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Good catch.. Looks good to me 👍

@cmonr
Copy link
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
@0xc0170 0xc0170 removed the needs: CI label Nov 7, 2018
@jarlamsa jarlamsa deleted the sdblockdevice_deselect branch November 7, 2018 08:15
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants