Skip to content

mx4sio: resume partial transfers at the next sector - #936

Open
PS2HomeDeveloper wants to merge 2 commits into
ps2dev:masterfrom
PS2HomeDeveloper:patch-1
Open

PS2HomeDeveloper wants to merge 2 commits into
ps2dev:masterfrom
PS2HomeDeveloper:patch-1

Conversation

@PS2HomeDeveloper

Copy link
Copy Markdown
Contributor

Summary

Fix the sector position used by MX4SIO when retrying a partially completed multi-sector transfer.

After a partial read or write, the driver advances the buffer to the remaining data but previously reused the original starting sector for the next CMD18 or CMD25 attempt. This could cause a retry to process the wrong sectors.

Advance the sector position by the number of sectors already transferred. For writes, also pass the remaining sector count to the multi-block write setup so the ACMD23 pre-erase hint matches the remaining request.

This does not change the public API or the successful full-transfer path.

Testing

  • Built the MX4SIO module with the PS2SDK toolchain.
  • [Add the PS2/MX4SIO and SD-card tests actually performed, if available.]

A deterministic partial-transfer hardware-failure test was not available.

## Summary

Fix the sector position used by MX4SIO when retrying a partially completed multi-sector transfer.

After a partial read or write, the driver advances the buffer to the remaining data but previously reused the original starting sector for the next CMD18 or CMD25 attempt. This could cause a retry to process the wrong sectors.

Advance the sector position by the number of sectors already transferred. For writes, also pass the remaining sector count to the multi-block write setup so the ACMD23 pre-erase hint matches the remaining request.

This does not change the public API or the successful full-transfer path.

## Testing

- Built the MX4SIO module with the PS2SDK toolchain.
- [Add the PS2/MX4SIO and SD-card tests actually performed, if available.]

A deterministic partial-transfer hardware-failure test was not available.
Fix missing newline at the end of the file.

This branch has not been deployed

No deployments
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