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

ensure ehci and ohci compatibility #4

Open
stefanklug opened this issue Oct 23, 2015 · 1 comment
Open

ensure ehci and ohci compatibility #4

stefanklug opened this issue Oct 23, 2015 · 1 comment

Comments

@stefanklug
Copy link

Zerocopy should also be supported for ehci controllers. At least ehci and ohci controllers must be detected and ensured that everything still works on these devices.

Idea:
check if devices's dma_mask is > physical memory of the system. If yes, we can unconditionally use any memory from userspace. Otherwise we disable zerocopy completely for this device. This way we don't have to switch between copying and zerocopy based on the buffer we got from userspace. And newer controllers should support dma to the whole physical memory anyway.

@parafin
Copy link

parafin commented Oct 26, 2015

As far as I understood both xHCI and EHCI come in both variants - 32 and 64 bit capable. But with xHCI it's common (very likely) that it supports 64 bit, with EHCI I'm not sure exactly, but 64 bit support isn't as common. Having said that, I don't see any other way but to disable zerocopy in case dma mask is less than memory size. Another question is buffer alignment. With xHCI there are no requirements (if I read the spec correctly), with others I'm not sure (at least 32 bytes alignment requirement exists in some) - didn't investigate yet. I'm guessing to require the buffer to be aligned to page boundary would be enough and reasonable, if for some controller it's not enough, then disable zero copy.

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

No branches or pull requests

2 participants