OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 3:05 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: OHCI stops generating WritebackDoneHead after some time
PostPosted: Sat Oct 21, 2023 6:13 am 
Offline

Joined: Wed Oct 18, 2023 3:28 pm
Posts: 2
I started to write ohci driver, and after some time playing with it I got to the point where I can’t identify the issue.
after I do basic ohci configuration, I setup interrupts and do next reads when HccaDoneHead flag is triggered. The problem is that after a few successful request-responses it stops it does not receive next interrupt.
For simplicity I made it now to send same package every time and I can reproduce the issue every time after 3 successful control requests. The log shows 2 last interrupt routings that sends same package, but last never generated interrupt.

(it is running in qemu, simulating allwinner h3)

Code:
---[USB] Interrupt 00000006
StartOfFrame
WritebackDoneHead
after TD[0](4003bf10), 3e00000, 0, 0, 4003bf57
after TD[1](4003bf20), 2f00000, 0, 4003bf10, 4003bf61
after TD[2](4003bf30), 2080000, 0, 4003bf20, 0
Response: 0a 03
HccaFrameNumber: 3
HccaDoneHead: 4003bf30
—get_descriptor_string 00000001 2                        <— here it start a new request, attempt 3
Control ED: 00082000, 4003bf10, 4003bf40, 00000000
Setup TD[0](4003bf10), e2e00000, 4003bf50, 4003bf20, 4003bf57
Setup TD[1](4003bf20), e3f00000, 4003bf60, 4003bf30, 4003bf61
Setup TD[2](4003bf30), e3080000, 0, 4003bf40, 0
Setup Request: 80 06 01 03 09 04 02 00
HcControl: 00000090                                 <— printing regs at the end of ira routing
HcControlHeadED: 4003bf00
HcControlCurrentED: 00000000
HcInterruptEnable: 8000007b
HcInterruptStatus: 00000000


---[USB] Interrupt 00000006
StartOfFrame
WritebackDoneHead
after TD[0](4003bf10), 3e00000, 0, 0, 4003bf57
after TD[1](4003bf20), 2f00000, 0, 4003bf10, 4003bf61
after TD[2](4003bf30), 2080000, 0, 4003bf20, 0
Response: 0a 03
HccaFrameNumber: 5
HccaDoneHead: 4003bf30
—get_descriptor_string 00000001 2                        <— here it start a new request, attempt 4
Control ED: 00082000, 4003bf10, 4003bf40, 00000000
Setup TD[0](4003bf10), e2e00000, 4003bf50, 4003bf20, 4003bf57
Setup TD[1](4003bf20), e3f00000, 4003bf60, 4003bf30, 4003bf61
Setup TD[2](4003bf30), e3080000, 0, 4003bf40, 0
Setup Request: 80 06 01 03 09 04 02 00
HcControl: 00000090                                 <— printing regs at the end of ira routing
HcControlHeadED: 4003bf00
HcControlCurrentED: 00000000
HcInterruptEnable: 8000007b
HcInterruptStatus: 00000000


Top
 Profile  
 
 Post subject: Re: OHCI stops generating WritebackDoneHead after some time
PostPosted: Wed Oct 25, 2023 10:22 am 
Offline

Joined: Wed Oct 18, 2023 3:28 pm
Posts: 2
Moderating my post took so much time that I found the problem few days before post was published here. So I am answering to my question:

The problem was that I simply was not settings HcCommandStatus |= 2 to tell controller that Control List Filled since first package. I am not sure why it actually worked until 5 packages received, whether it is a qemu bug or confusing explanation of this bit in datasheet plays its role, where it says that controller switches it off but at the same time can turn it on back if finds something.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: akasei, DotBot [Bot], Majestic-12 [Bot] and 86 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group