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

ps3disk.c: Rewrite ps3disk_transfer #1414

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aomsin2526
Copy link
Contributor

This function is bugged since the beginning, but it never hit because its variable doesn't allow.

However, since commit a77e1f0 it happen now.

First, it assume that ds_len will always equal to real user requested size. So it being used for sector count calculation.

This is no longer true, and will fail if attempt to read last few sectors.

Use bp->bio_length instead.

Second, this being a loop is pointless because nsegs will never be > 1 as specified at bus_dma_tag_create() call.

And all it doing is to repeat very same command again but with different ds_addr. Since bio_driver2 tag ident pointer are being reused, the result will be discarded at ps3disk_intr().

@pkubaj
Copy link
Contributor

pkubaj commented Sep 11, 2024

While I'm not sure about the contents of the patch, permissions seem to change from 644 to 755. C source files should definitely be 644.

@aomsin2526
Copy link
Contributor Author

Fixed, thanks.

sys/powerpc/ps3/ps3disk.c Outdated Show resolved Hide resolved
@bsdimp bsdimp self-assigned this Oct 4, 2024
@bsdimp
Copy link
Member

bsdimp commented Oct 4, 2024

This may be ready, but I think @amotin 's comments need a response at the very least.

@bsdimp
Copy link
Member

bsdimp commented Oct 4, 2024

I think at the least, we should remove the assert since we have code to handle when it fails and we usually do one or the other.

@pkubaj
Copy link
Contributor

pkubaj commented Oct 16, 2024

There is a CI failure:
do not set execute permissions for source files

While in the end, there are no execute permissions for source files, one of your commits introduces those and then another one removes it. Can you squash those commits so that there are no execute permissions set at all?
Then the CI failure should go away.

@aomsin2526
Copy link
Contributor Author

Should be good now

This function is bugged since the beginning, but it never hit because its variable doesn't allow.

However, since commit a77e1f0 it happen now.

First, it assume that ds_len will always equal to real user requested size.
So it being used for sector count calculation.

This is no longer true, and will fail if attempt to read last few sectors.

Use bp->bio_length instead.

Second, this being a loop is pointless because nsegs will never be > 1
as specified at bus_dma_tag_create() call.

And all it doing is to repeat very same command again but with different ds_addr.
Since bio_driver2 tag ident pointer are being reused, the result will be discarded at ps3disk_intr().

Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th>
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.

4 participants