xhci: Workaround for missing interrupts

This commit is contained in:
Jeremy Soller
2023-02-15 11:47:48 -07:00
parent 625064004d
commit a86f32e67a
3 changed files with 13 additions and 1 deletions
+2
View File
@@ -209,6 +209,8 @@ fn get_int_method(pcid_handle: &mut PcidServerHandle, address: usize) -> (Option
method
} else if pci_config.func.legacy_interrupt_pin.is_some() {
info!("Legacy IRQ {}", irq);
// legacy INTx# interrupt pins.
(Some(File::open(format!("irq:{}", irq)).expect("xhcid: failed to open legacy IRQ file")), InterruptMethod::Intx)
} else {
+1 -1
View File
@@ -162,7 +162,7 @@ impl IrqReactor {
return Ok(None);
}
debug!("IRQ reactor received an IRQ");
trace!("IRQ reactor received an IRQ");
let _ = self.irq_file.as_mut().unwrap().write(&buffer);
+10
View File
@@ -253,6 +253,16 @@ impl Xhci {
&self,
f: F,
) -> (Trb, Trb) {
{
// If ERDP EHB bit is set, clear it before sending command
//TODO: find out why this bit is set earlier!
let mut run = self.run.lock().unwrap();
let mut int = &mut run.ints[0];
if int.erdp.readf(1 << 3) {
int.erdp.writef(1 << 3, true);
}
}
let next_event = {
let mut command_ring = self.cmd.lock().unwrap();
let (cmd_index, cycle) = (command_ring.next_index(), command_ring.cycle);