lkml.org 
[lkml]   [2017]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: mcu_tty: Trying to open /dev/ttyUSB0 and lock access from a kernel driver
On Mon, 25 Sep 2017 15:01:13 +0200
Ulf Samuelsson <linux-kernel@emagii.com> wrote:

> Trying to open /dev/ttyUSB from a kernel driver (which works), but
> locking the
> serial port so noone else can access it does not work.
> Any advice would be appreciated.

File locks are advisory only.

For the rest of it you might want to take a look at how the gsm mux
driver works (the protocol stuff is scary but you can ignore that end).
It plugs a line discipline into a tty and that muxes out as a collection
of ttys and shows how it's meant to be done.

That also means you have an owning process with the port open that can do
locking on it and/or route any raw read/writes to the master port into
the bit bucket.

Alan

\
 
 \ /
  Last update: 2017-09-26 01:06    [W:0.035 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site