Commit 610a82c4 authored by Sasha Levin's avatar Sasha Levin Committed by Will Deacon
Browse files

kvm tools: Fix serial port probing



The process of probing the 8250 serial port is as follows:

1. Start detecting IRQs

2. Enable the IER register [At this point, the port is supposed to light
   the INTR].

3. Stop detecting IRQs [At this point, the driver detects which IRQ
   belongs to that port].

4. Disable IER register.

Since we weren't enabling and disabling the IRQ based on IER writes, we
would often fail the probing since the driver couldn't detect which IRQ
is used by the port, and would just default that to 0.

This would cause slowness and may have caused hangs. For me there is a
significant increase in speed of the terminal after this patch.

Signed-off-by: default avatarSasha Levin <levinsasha928@gmail.com>
[ penberg@kernel.org: whitspace cleanup ]
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 90c05188
......@@ -233,6 +233,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
break;
case UART_IER:
dev->ier = ioport__read8(data) & 0x3f;
kvm__irq_line(kvm, dev->irq, dev->ier ? 1 : 0);
break;
case UART_LCR:
dev->lcr = ioport__read8(data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment