myriadrf / xtrx_linux_pcie_drv

XTRX PCI driver for linux
Apache License 2.0
16 stars 22 forks source link

xrtx: Don't hardcode UART major #11

Closed Keno closed 7 months ago

Keno commented 3 years ago

Currently thedriver hardcodes the UART major as 234. However, this is VERY BAD (TM) as 234 is reserved for dynamic allocation BY THE KERNEL. Trying to use 234 in this way in the driver will cause conflicts with other dynamically major-allocated drivers in the kernel. Fortunately, simply leaving out the .major/.minor field will cause the kernel to dynamically allocate a proper major/minor number for the UART device.

Fixes: https://github.com/xtrx-sdr/images/issues/102 Signed-off-by: Keno Fischer keno@juliacomputing.com

@sergforce is there userspace that depends on this hardcoding? If so, we might want to fix that as well.

cyber-murmel commented 2 years ago

Very helpful PR. Without the changes I got Device or resouce busy and xtrx: Unable to initialize UART driver: -16 in kernel debug messages when loading the module. Applying the diff as a patch fixed the problem for me.