Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2178292

Summary: systemd-getty-generator acts too early and does not detect MMIO based serial ports
Product: Red Hat Enterprise Linux 9 Reporter: Carlos Santos <casantos>
Component: systemdAssignee: Michal Sekletar <msekleta>
Status: CLOSED MIGRATED QA Contact: Frantisek Sumsal <fsumsal>
Severity: high Docs Contact:
Priority: medium    
Version: 9.1CC: dtardon, mschibli, msekleta, systemd-maint-list
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 12:32:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Carlos Santos 2023-03-14 18:21:33 UTC
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 has finished successfully
-- A start job for unit getty 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. 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:

   # systemctl enable --now serial-getty

Comment 1 Carlos Santos 2023-03-15 12:29:27 UTC
Additional information from the customer: "When I do the same with RHEL 9.0,
it works all fine and I can update the system to RHEL 9.1 with everything
working. So I assume there must be a solution."

Comment 2 David Tardon 2023-03-16 12:57:11 UTC
(In reply to Carlos Santos from comment #1)
> Additional information from the customer: "When I do the same with RHEL 9.0,
> it works all fine and I can update the system to RHEL 9.1 with everything
> working. So I assume there must be a solution."

This looks like a race, so I assume they were just lucky.

Comment 3 Markus Schibli 2023-03-22 08:31:37 UTC
(In reply to David Tardon from comment #2)
> (In reply to Carlos Santos from comment #1)
> > Additional information from the customer: "When I do the same with RHEL 9.0,
> > it works all fine and I can update the system to RHEL 9.1 with everything
> > working. So I assume there must be a solution."
> 
> This looks like a race, so I assume they were just lucky.
Hi, I'm the TAM for the customer. Customer asked me to stress out, that installing RHEL 9.0 from scratch with a working login prompt on the serial console, works always. So something has changed in RHEL 9.1.

Comment 6 RHEL Program Management 2023-09-21 12:27:27 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 7 RHEL Program Management 2023-09-21 12:32:31 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.