Uart custom driver works on Centos7 but not on Centos8

Issues related to hardware problems
Post Reply
gvorraro
Posts: 9
Joined: 2021/10/01 11:05:02

Uart custom driver works on Centos7 but not on Centos8

Post by gvorraro » 2021/10/01 13:49:59

Hi,
I have a custom uart driver source code that works with Centos7.5 but noy with Centos8.2
I'm not an expert of Linux Kernel system.
Basically, on Centos8 system,

Linux hostname.xxx.com 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Static hostname: hostname.xxx.com
Icon name: computer-server
Chassis: server
Machine ID: xxxxxxxxxxxxx
Boot ID: bxxxxxxxxxxxxxxxxx2
Operating System: CentOS Linux 8
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-193.el8.x86_64
Architecture: x86-64
CentOS Linux release 8.4.2105


after increasing the number of uart ports to 8 with

- adding to the /etc/default/grub file the "8250.nr_uarts=8" to the line starting GRUB_CMDLINE_LINUX=...
- running "grub2-mkconfig -o /boot/grub2/grub.cfg"
- rebooting

I was able to "install" the custom uart port. In fact using

sudo setserial -g /dev/ttyS[0123456789]

I see my port at ttyS7

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 7
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 7
/dev/ttyS4, UART: 16550A, Port: 0x02f0, IRQ: 7
/dev/ttyS5, UART: 16550A, Port: 0x02e0, IRQ: 7
/dev/ttyS6, UART: 16550A, Port: 0x0000, IRQ: 20
/dev/ttyS7, UART: 16550A, Port: 0x0000, IRQ: 16, Flags: spd_vhi

The problem is that sending (using python script) commands on custom uart

import serial
ser = serial.Serial(port = /dev/ttyS7, baudrate = 115200, timeout = 1)
ser.write(myCommand)
c = ser.read(16)


the system doesn't respond.
Using the same source code built on Centos7.5, it works.

Using the command

sudo lspci -d 1344: -vvvv

I see two additional module related to the IRQ 16, both reporting the

Interrupt: pin A routed to IRQ 16

The first one is another custom driver (A), the secodnm one should be the SSD controller.
I'm wondering if this IRQ 16 sharing (expecially) with SSD is masking the interrupt coming from custom uart (which it's using/sharing the same IRQ 16).
I have been having debug and I figured out that in case of Centos7.5 when the user sends the data on custom uart, since the IRQ 16 sharing, also the custom driver (A) gets the interrupt and serves it (doing nothing since the caller refers to uart). In case of Centos8 the custom driver irq service routine doesn't start (I expect it starts instead).

Can anyone help me?
Thanks in advance.
Giovanni

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Uart custom driver works on Centos7 but not on Centos8

Post by TrevorH » 2021/10/01 14:59:25

Kernel: Linux 4.18.0-193.el8.x86_64
Architecture: x86-64
CentOS Linux release 8.4.2105
There is a mismatch there. It says it's 8.4 but that is not an 8.4 kernel which would be 4.18.0-305-something.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gvorraro
Posts: 9
Joined: 2021/10/01 11:05:02

Re: Uart custom driver works on Centos7 but not on Centos8

Post by gvorraro » 2021/10/04 07:08:00

Yes, I know. The system is a development system so it as other stuff installed.
Anyway I also tried a different system with a pure CentOS Linux release 8.2.2004 (Core).
Same result. It doesn't work.
Thoughts ?

gvorraro
Posts: 9
Joined: 2021/10/01 11:05:02

Re: Uart custom driver works on Centos7 but not on Centos8

Post by gvorraro » 2021/10/05 07:52:27

Can anyone help me?
Thanks

BShT
Posts: 584
Joined: 2019/10/09 12:31:40

Re: Uart custom driver works on Centos7 but not on Centos8

Post by BShT » 2021/10/05 13:43:18

try to find a driver compatible with centos 8, contact de manufacturer.

drivers are kernel dependent, you have to have the compatible driver or make it compatible if you have the source.

nobody can help you to make a driver compatible

bbusacker
Posts: 1
Joined: 2021/11/17 03:37:22

Re: Uart custom driver works on Centos7 but not on Centos8

Post by bbusacker » 2021/11/17 03:41:45

Another clue about this issue is that setserial does not work on CentOS 8 but does on CentOS 7

CENTOS 7
[ufs@herc2prod12 ~]$ sudo setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

CENTOS 8
[ufs@herc4proto01 dev]$ sudo setserial -g /dev/ttyS[0123]
Cannot get serial info: Inappropriate ioctl for device
Cannot get serial info: Inappropriate ioctl for device
Cannot get serial info: Inappropriate ioctl for device
Cannot get serial info: Inappropriate ioctl for device


Can anyone else confirm they have this problem on CentOS 8?

Because setserial is not operative it may be stopping the serial ports from getting configured properly. Thoughts?

Post Reply