Hello!
I run into an issue that the serial device keeps on blocking on read after closing. I have investigated the issue. Here is what I have found. 1) The device being opened in blocking mode hangs on uart_takesem(&dev->recvsem, true); 2) On close uart_reset_sem function is called. 3) Where the dev->recvsem is reset by nxsem_reset(&dev->recvsem, 0); 4) Here comes a question: Why is it called with zero as the second argument? Because with 0 the semaphore will not be posted. 5) The semaphore will not be posted and the read function keeps on blocking. Maybe I don't quite understand why nxsem_reset is called with 0. So I have changed it to 1 to make a try. Now uart_takesem unblocks on close. But the read function still doesn't exit because it isn't aware of the closing of the device. One thing that comes to mind is to check struct file *filep What is the member of struct file which can be checked for? Best regards, Alexander Vasiljev