summary refs log tree commit diff
path: root/arch/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-05-20 13:33:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-23 02:14:10 -0700
commitaf00eb7e26116180ab19dcd840e981b532916afd (patch)
tree51d8bd887308e92bfb7cc22f1186fdd17f54f335 /arch/src/lib.rs
parent03b238bcc09ff386650c54708a3b8bf713a058b2 (diff)
downloadcrosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar.gz
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar.bz2
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar.lz
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar.xz
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.tar.zst
crosvm-af00eb7e26116180ab19dcd840e981b532916afd.zip
arch: initialize 4th serial port
Fix an off by one in the loop range so that all 4 UARTs are initialized.

Note that the 4th serial port (/dev/ttyS3) still doesn't work in Linux;
this is because our UART doesn't correctly emulate the loopback mode,
which is tested by the Linux serial driver.  This test is skipped for
the first three ports due to the UPF_SKIP_TEST flag in STD_COMX_FLAGS,
whereas STD_COM4_FLAGS does not set UPF_SKIP_TEST (and fails the test).
This will need to be resolved separately.

BUG=chromium:953983
TEST=`echo test > /dev/ttyS3` inside VM

Change-Id: Ic768584820e8b532ee4241df79ef8b9c17c4657a
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1620703
Tested-by: kokoro <noreply+kokoro@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Trent Begin <tbegin@chromium.org>
Diffstat (limited to 'arch/src/lib.rs')
-rw-r--r--arch/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/src/lib.rs b/arch/src/lib.rs
index 433d89a..4c5fbed 100644
--- a/arch/src/lib.rs
+++ b/arch/src/lib.rs
@@ -237,7 +237,7 @@ pub fn add_serial_devices(
     let mut stdio_serial_num = None;
     let mut stdio_serial = None;
 
-    for x in 0..3 {
+    for x in 0..=3 {
         let com_evt = match x {
             0 => com_evt_1_3,
             1 => com_evt_2_4,