Bug 1264383 - Inconsistent serial UART settings in Fedora kernelc configuration
Summary: Inconsistent serial UART settings in Fedora kernelc configuration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 22
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-18 10:39 UTC by Rainer Koenig
Modified: 2016-05-26 19:34 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-05-26 19:34:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Rainer Koenig 2015-09-18 10:39:02 UTC
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):
kernel-4.1.6-201.fc22.x86_64


How reproducible:
always

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"
        help
          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.

config SERIAL_8250_RUNTIME_UARTS
        int "Number of 8250/16550 serial ports to register at runtime"
        depends on SERIAL_8250
        range 0 SERIAL_8250_NR_UARTS
        default "4"
        help
          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
          8250.nr_uarts

For the Fedora kernel those settings are:
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4

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 13:33:44 UTC
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.