kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Jeffrey Walton <noloader@gmail.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: How to make /dev/ttyACM0 (and friends) exclusive?
Date: Sun, 3 Mar 2019 12:00:11 +0100	[thread overview]
Message-ID: <20190303110011.GA10485@kroah.com> (raw)
In-Reply-To: <CAH8yC8nQeWTDSPwAhQMGB9rhrQoT3kb9Fg4mFGqO5TUPVDY1hw@mail.gmail.com>

On Sun, Mar 03, 2019 at 03:55:44AM -0500, Jeffrey Walton wrote:
> On Sun, Mar 3, 2019 at 12:55 AM <valdis.kletnieks@vt.edu> wrote:
> >
> > On Sat, 02 Mar 2019 14:36:12 -0500, Jeffrey Walton said:
> >
> > > I feel like I am missing something... Does Linux consider the modem a
> > > shared resource instead of an exclusive resource? What use cases
> > > support two different programs sending commands to the modem at the
> > > same time?
> >
> > The Linux kernel has exactly zero clue what a "modem" is.  It's talking to a
> > serial port, and doesn't care where the other end of the serial cable is. If
> > you have a onboard modem, that cable may be all of 2 mm long and consist of a
> > bunch of traces between two chips on a PCB, or even internal connections
> > between two sides of a chip, but it's still there.
> >
> > So the correct question is "what use cases have two programs talking to the
> > same serial port"?
> 
> I agree about the general case of serial lines and /dev/ttySn. However...
> 
> /dev/ttyACMn are modems, not serial lines. For whatever reason the
> kernel made a special case for the devices. The kernel knows exactly
> what they are.

The kernel has no idea that this is a "modem".  It doesn't even know
what a modem is.  All it knows is that this is a tty device, and then
there happens to be a driver that knows how to speak the USB ACM class
protocol bound to it.

Again, go delete modem manager off of your system, it is the thing that
keeps opening the port up to see if you have made a valid connection on
the device or not.  If you write your own program to talk to the device,
modem manager is not needed at all, and is known to cause this problem.

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2019-03-03 11:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  4:29 How to make /dev/ttyACM0 (and friends) exclusive? Jeffrey Walton
2019-03-02  7:50 ` Greg KH
2019-03-02 18:45 ` valdis.kletnieks
2019-03-02 19:36   ` Jeffrey Walton
2019-03-03  5:55     ` valdis.kletnieks
2019-03-03  8:55       ` Jeffrey Walton
2019-03-03 11:00         ` Greg KH [this message]
2019-03-04 13:04           ` Jeffrey Walton
2019-03-04 13:20             ` Greg KH
2019-03-04 15:38             ` Yann Droneaud
2019-03-04 22:01               ` valdis.kletnieks
2020-10-06 20:41                 ` Daniel Santos
2020-10-11 14:52                   ` linux lover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190303110011.GA10485@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=noloader@gmail.com \
    --cc=valdis.kletnieks@vt.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).