How to handle interrupts in OHCI

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
amosfuegel
Posts: 1
Joined: Tue May 06, 2025 8:06 pm

How to handle interrupts in OHCI

Post by amosfuegel »

Hello, I am implementing OHCI to support a basic USB device. When configuring interrupts, the endpoint does not appear in hcca.headDone and does not generate hardware interrupts. The simple drivers I have seen all check the entire interrupt_table periodically. Is it correct to check the table 1000 times/second, or am I missing some practical implementation? Does EHCI work similarly?

Thanks.
rdos
Member
Member
Posts: 3379
Joined: Wed Oct 01, 2008 1:55 pm

Re: How to handle interrupts in OHCI

Post by rdos »

In my experience, some OHCI implementations do not generate the expected interrupts, so I use a 1 ms timer as a backup strategy. In fact, I think it would be reasonable to always use a 1 ms timer and ignore the interrupts.
nullplan
Member
Member
Posts: 1889
Joined: Wed Aug 30, 2017 8:24 am

Re: How to handle interrupts in OHCI

Post by nullplan »

According to the Linux source code, you should just read and handle the interrupt status register. However, the function just in front of the one I linked also exists to handle host controllers that don't update the done queue at all. So that seems to be a common problem.
Carpe diem!
User avatar
BenLunt
Member
Member
Posts: 969
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: How to handle interrupts in OHCI

Post by BenLunt »

It has been quite a while since I did anything with the OHCI, though I do remember something about some controllers not handling interrupts correctly, especially with the DoneQueue mechanism. I would have to find my notes to be more specific.

Have you tried Bochs? Setting the config to write DEBUG lines to your log file, might help.

Ben
- https://www.fysnet.net/the_universal_serial_bus.htm
Post Reply