8infy wrote:Hi! No problem.
I haven't looked into it any further.
May I ask if you interact with the port in any way or does it issue status change right after HCI reset
and interrupter/schedule enable?
Thanks
Here is was happens in my driver from time of initialize (unmasking the interrupt) and the Port Change Event:
Code: Select all
131904021959: XHCI: Unmasking IRQ 22
131904021969: XHCI: irq fired
131904021969: XHCI: ED = 0, Type 48, Status 0x00000001
Found NEC/Renesas firmware version: 30.25
131904021969: XHCI: USB_IRQ_DONE
131904021969: XHCI: irq fired
131904021969: XHCI: USB_IRQ_DONE
NEC verification via vendor specific command NEC_TRB_TYPE_GET_UN: 131904021971: XHCI: NEC Verification
131904021971: XHCI: irq fired
131904021971: XHCI: ED = 0, Type 48, Status 0x00000001
131904021971: XHCI: USB_IRQ_DONE
131904021971: XHCI: irq fired
131904021971: XHCI: USB_IRQ_DONE
TRUE
131904021971: XHCI: irq fired
131904021971: XHCI: ED = 0, Type 33, Status 0x00000001
131904021971: XHCI: Command Completion Event
131904021971: XHCI: Command 21 Completion: 0x01000000
131904021971: XHCI: USB_IRQ_DONE
131904021971: XHCI: irq fired
131904021971: XHCI: USB_IRQ_DONE
131904021974: XHCI: irq fired
131904021974: XHCI: ED = 0, Type 33, Status 0x00000001
131904021974: XHCI: Command Completion Event
131904021974: XHCI: Command 21 Completion: 0x01000000
131904021974: XHCI: USB_IRQ_DONE
131904021974: XHCI: irq fired
131904021974: XHCI: USB_IRQ_DONE
131904021974: XHCI: irq fired
131904021974: XHCI: ED = 0, Type 33, Status 0x00000001
131904021974: XHCI: Command Completion Event
131904021974: XHCI: Command 21 Completion: 0x01000000
131904021974: XHCI: USB_IRQ_DONE
131904021974: XHCI: irq fired
131904021974: XHCI: USB_IRQ_DONE
131904021976: XHCI: irq fired
131904021976: XHCI: ED = 0, Type 33, Status 0x00000001
131904021976: XHCI: Command Completion Event
131904021976: XHCI: Command 21 Completion: 0x01000000
131904021976: XHCI: USB_IRQ_DONE
131904021976: XHCI: irq fired
131904021976: XHCI: USB_IRQ_DONE
131904021977: XHCI: irq fired
131904021977: XHCI: ED = 0, Type 34, Status 0x00000001
131904021977: XHCI: Port Status Change Event
131904021977: XHCI: USB_IRQ_DONE
However, please note that I check for the NEC card and get its version, as well as the bandwidth command, before the
Port Status Change Event takes place.
...
After looking over my code some more, at the point that QEMU fires the
Port Status Change Event might be where I start to enumerate the attached devices, which means I reset a port. If this is the case, then the Event might be because of the port reset.
I haven't looked into it very far. Something I will need to look into I guess. There is a possibility that QEMU isn't firing the Event as you stated before.
...
Yep, you are correct. I commented out the code that creates the root hub device, which is the driver that enumerates the attached devices. The code still resets the controller.
QEMU is not firing the
Port Status Change Event after the controller reset.
I tried my code in DEBUG mode on an actual machine and right after allowing the interrupts, the card initiates the
Port Status Change Event as the first thing it does.
I will have a look at QEMU's code and see if I can come up with and submit a patch.
Ben