Bug 1264383 - Inconsistent serial UART settings in Fedora kernelc configuration
Inconsistent serial UART settings in Fedora kernelc configuration
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-09-18 06:39 EDT by Rainer Koenig
Modified: 2016-05-26 15:34 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-26 15:34:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rainer Koenig 2015-09-18 06:39:02 EDT
Description of problem:
Ran into this wiile testing a 4 port serial PCIe plugin card (EXAR_XR17V354).
Fedora kernel reports an error message for the first serial port of the card.

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

How reproducible:

Steps to Reproduce:
1. Install 4 port serial card in PC that has already an onboard adapter
2. Install Fedora 22
3. Check if all serial ports of the card are configrued correctly.

Actual results:
I just see 3 of the for ports of the 4 port card (000:02:00.0).

# dmesg | grep tty

[    0.000000] console [tty0] enabled
[    0.521991] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.522507] 0000:02:00.0: ttyS1 at MMIO 0xf7c00000 (irq = 16, base_baud = 7812500) is a XR17V35X
[    0.522619] 0000:02:00.0: ttyS2 at MMIO 0xf7c00400 (irq = 16, base_baud = 7812500) is a XR17V35X
[    0.522714] 0000:02:00.0: ttyS3 at MMIO 0xf7c00800 (irq = 16, base_baud = 7812500) is a XR17V35X

But I see an error:
[    0.522748] serial 0000:02:00.0: Couldn't register serial port 0, irq 16, type 2, error -28

Expected results:
All 4 ports of the card get registered and can be used.

Additional info:
The problem is a inconsistency between the following settings in the kernel:

config SERIAL_8250_NR_UARTS
        int "Maximum number of 8250/16550 serial ports"
        depends on SERIAL_8250
        default "4"
          Set this to the number of serial ports you want the driver
          to support.  This includes any ports discovered via ACPI or
          PCI enumeration and any ports that may be added at run-time
          via hot-plug, or any ISA multi-port serial cards.

        int "Number of 8250/16550 serial ports to register at runtime"
        depends on SERIAL_8250
        range 0 SERIAL_8250_NR_UARTS
        default "4"
          Set this to the maximum number of serial ports you want
          the kernel to register at boot time.  This can be overridden
          with the module parameter "nr_uarts", or boot-time parameter

For the Fedora kernel those settings are:

So the number of serial ports is more than the default while the runtime setting is still the default. But since there is a COM port on the mainboard already, the kernel tries to register port 0 twice which leads to the error message (ENOSPC) on the second try. 

Recompiling the kernel with CONFIG_SERIAL_8250_RUNTIME_UARTS=32 makes the problem disappear. 

Of course there would be also the option of using the module parameter, but I think that the average user won't find this possibility. So to make more than 4 serail ports running "out-of-the-box" Fedora should change the kernel config.
Comment 1 Josh Boyer 2015-10-07 09:33:44 EDT
Thanks for the report and apologies for the delay.  I've made your suggested change on the Fedora 23 and rawhide branches.  Fedora 22 should inherit that change when it is rebased to the 4.2.y kernel series.

Note You need to log in before you can comment on or make changes to this bug.