Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5981

systemd-getty-generator acts too early and does not detect MMIO based serial ports

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-9.1.0
    • systemd
    • None
    • Low
    • rhel-systemd
    • ssg_core_services
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      Customer has a machine with the Synopsys DesignWare APB UART. The serial ports
      are MMIO based:

      [ 4.587543] dw-apb-uart.6: ttyS0 at MMIO 0x4017006000 (irq = 33, base_baud = 6250000) is a 16550A
      [ 4.599879] dw-apb-uart.7: ttyS1 at MMIO 0x4017007000 (irq = 16, base_baud = 6250000) is a 16550A

      Kernel is configured to use ttyS0 as console:

      BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/rhel-root ro rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS0,115200n8

      So on system boot, a serial-getty@ttyS0 should be be started automatically by
      systemd-getty-generator but it fails to do it.

      Version-Release number of selected component (if applicable):

      RHEL 9.1

      How reproducible:

      Always

      Steps to Reproduce:
      1. Install RHEL 9.1 on a machine whose serial ports are MMIO-based.
      2. Reboot the system
      3. Check if a serial-getty@ttyS0 is started

      Actual results:

      serial-getty@ttyS0 is not started

      Expected results:

      serial-getty@ttyS0 should be started

      Additional info:

      From the system sosreport:

      $ fgrep w -e ttyS0 -e getty sos_commands/logs/journalctl_no-pager_catalog_-boot
      Mar 08 09:17:25 localhost kernel: Command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/rhel-root ro rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS0,115200n8
      Mar 08 09:17:25 localhost kernel: Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/rhel-root ro rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS0,115200n8
      Mar 08 09:17:25 localhost kernel: printk: console [ttyS0] enabled
      Mar 08 09:17:25 localhost dracut-cmdline[353]: Using kernel command line parameters: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-162.6.1.el9_1.x86_64 root=/dev/mapper/rhel-root ro rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap console=ttyS0,115200n8
      Mar 08 09:17:27 localhost systemd[1]: Created slice Slice /system/getty.
      Mar 08 09:17:28 localhost kernel: printk: console [ttyS0] disabled
      Mar 08 09:17:28 localhost kernel: dw-apb-uart.6: ttyS0 at MMIO 0x4017006000 (irq = 33, base_baud = 6250000) is a 16550A
      Mar 08 09:17:28 localhost kernel: printk: console [ttyS0] enabled
      – Subject: A start job for unit getty@tty1.service has finished successfully
      – A start job for unit getty@tty1.service has finished successfully.
      – Subject: A start job for unit getty.target has finished successfully
      – A start job for unit getty.target has finished successfully.

      As can be seen, ttyS0 is enabled too late. Because of this, the getty service
      generator (systemd-getty-generator) does not create getty@ttyS0.service. I have
      seen a similar problem on RHEL 8 and filed a bug report for it:

      MMIO-based serial port does not work during the installation but works later
      https://bugzilla.redhat.com/show_bug.cgi?id=2162741

      The behavior on RHEL 9 is better, since it is still possible to install the OS.

      It's possible to circumvent the problem by enabling the service explicitly:

      1. systemctl enable --now serial-getty@ttyS0.service

              msekleta@redhat.com Michal Sekletar
              rhn-support-casantos Carlos Santos
              Michal Sekletar Michal Sekletar
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: