Serial port hangs on close()
Serial port hangs on close() I developed this simple kernel module, which emulates a serial port by using a FIFO queue and a timer (read from hardware : out from the queue, write to hardware : insert in the queue). Source code is shown next. #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/serial.h> #include <linux/serial_core.h> #include <linux/module.h> #define TINY_SERIAL_DEBUG #define pr_fmt(fmt) "tiny_serial: " fmt #if defined(TINY_SERIAL_DEBUG) #define DBG(fmt, ...) printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) #else #define DBG(fmt, ...) no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #endif #define DRIVER_AUTHOR "Me Me <me@me.com>" #define DRIVER_DESC "Tiny serial driver" /* Module information */ MODULE_AUTHOR( DRIVER_AUTHOR ); ...