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

disk: fixing the sending of commands with r1 response #15790

Closed

Conversation

lucaspeixotot
Copy link
Contributor

The sdhc_cmd_r1_raw() function doesn't take into account the existence
of commands with data response. Because of this, some datas were being
lost.

The commands that return a r1 response and a data are: SDHC_SEND_CSD,
SDHC_SEND_CID, SDHC_READ_SINGLE_BLOCK, SDHC_READ_MULTIPLE_BLOCK,
SDHC_WRITE_BLOCK, SDHC_WRITE_MULTIPLE_BLOCK.

In order to solve this, was juts necessary skip the byte discard when
the command is one of these.

This problem was affecting, for example, the sdhc initialization. The
token returned from SDHC_SEND_CSD was being lost and the initialization
was broken.

Fixes #15444.

Signed-off-by: Lucas Peixoto [email protected]

@nashif
Copy link
Member

nashif commented May 7, 2019

do we have a PR against master? Can you please open an issue for 1.14.

@nashif nashif requested review from nordic-krch and nzmichaelh May 28, 2019 17:32
@lucaspeixotot
Copy link
Contributor Author

do we have a PR against master? Can you please open an issue for 1.14.

Do I need to create another PR, this time against master, beyond this?

@ioannisg ioannisg changed the base branch from v1.14-branch to master June 18, 2019 17:45
@ioannisg
Copy link
Member

Needs a rebase onto master

The sdhc_cmd_r1_raw() function doesn't take into account the existence
of commands with data response. Because of this, some datas were being
lost.

The commands that return a r1 response and a data are: SDHC_SEND_CSD,
SDHC_SEND_CID, SDHC_READ_SINGLE_BLOCK, SDHC_READ_MULTIPLE_BLOCK,
SDHC_WRITE_BLOCK, SDHC_WRITE_MULTIPLE_BLOCK.

In order to solve this, was juts necessary skip the byte discard when
the command is one of these.

This problem was affecting, for example, the sdhc initialization. The
token returned from SDHC_SEND_CSD was being lost and the initialization
was broken.

Fixes zephyrproject-rtos#15444.

Signed-off-by: Lucas Peixoto <[email protected]>
Copy link
Collaborator

@pabigot pabigot left a comment

Choose a reason for hiding this comment

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

Needs to be rebased (the file was renamed, as was the function), but this works and needs to go in.

@pabigot
Copy link
Collaborator

pabigot commented Jul 18, 2019

Needs to be rebased (the file was renamed, as was the function), but this works and needs to go in to fix #17657.

I can push the rebase if necessary.

@pabigot pabigot added this to the v2.0.0 milestone Jul 19, 2019
@lucaspeixotot
Copy link
Contributor Author

Needs to be rebased (the file was renamed, as was the function), but this works and needs to go in to fix #17657.

I can push the rebase if necessary.

Please, push the rebase. Thanks in advance.

@pabigot
Copy link
Collaborator

pabigot commented Jul 22, 2019

@lucaspeixotot Sorry, turns out I can't push to this PR. So I added a new PR to replace this, and will handle the backport as well. Thanks for providing the fix.

@pabigot pabigot closed this Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error initiating sdhc disk
4 participants