From: Johan Hovold <johan@kernel.org>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: "johan@kernel.org" <johan@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] cdc-acm: acm_init: Set initial BAUD to B0
Date: Mon, 13 Jul 2020 14:29:20 +0200 [thread overview]
Message-ID: <20200713122920.GX3453@localhost> (raw)
In-Reply-To: <4bf0e060e72c4f1c7c53da6bbd5aa883028d1bc3.camel@infinera.com>
On Fri, Jul 10, 2020 at 04:05:29PM +0000, Joakim Tjernlund wrote:
> On Fri, 2020-07-10 at 14:41 +0200, Johan Hovold wrote:
> > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> >
> >
> > On Fri, Jul 10, 2020 at 10:46:19AM +0000, Joakim Tjernlund wrote:
> > > On Fri, 2020-07-10 at 12:34 +0200, Greg KH wrote:
> > > >
> > > > On Fri, Jul 10, 2020 at 11:35:18AM +0200, Joakim Tjernlund wrote:
> >
> > > > > tty_set_operations(acm_tty_driver, &acm_ops);
> > > > >
> > > > > - retval = tty_register_driver(acm_tty_driver);
> > > > > + retval = usb_register(&acm_driver);
> > > > > if (retval) {
> > > > > put_tty_driver(acm_tty_driver);
> > > > > return retval;
> > > > > }
> > > > >
> > > > > - retval = usb_register(&acm_driver);
> > > > > + retval = tty_register_driver(acm_tty_driver);
> > > > > if (retval) {
> > > > > - tty_unregister_driver(acm_tty_driver);
> > > > > + usb_deregister(&acm_driver);
> > > >
> > > > Why are you switching these around? I think I know, but you don't
> > > > really say...
> > >
> > > I wrote:
> > > For initial termios to reach USB core, USB driver has to be
> > > registered before TTY driver.
> > > Found out that by trial and error. Isn't that clear enough?
> >
> > No, that makes no sense at all since USB core does not care about
> > init_termios.
>
> But you install acm_ops into tty:
> tty_set_operations(acm_tty_driver, &acm_ops);
> Perhaps there is a call into acm_ops?
No, not until the tty device has been registered by the USB driver.
> Anyhow, does it not make sense to have usb before tty as tty uses usb?
Nope, it's the other way round, and your change is therefore broken.
> Can I ask this too:
> what is the difference between acm_tty_install and acm_tty_open ?
> Both seems to be called at open(2)
> seems to me that install could be folded into open ?
No, their purposes are distinct and they cannot be merged.
Johan
next prev parent reply other threads:[~2020-07-13 12:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 9:35 [PATCH] cdc-acm: acm_init: Set initial BAUD to B0 Joakim Tjernlund
2020-07-10 9:54 ` Johan Hovold
2020-07-10 10:16 ` Joakim Tjernlund
2020-07-10 10:36 ` Greg KH
2020-07-10 10:48 ` Joakim Tjernlund
2020-07-10 12:37 ` Johan Hovold
2020-07-10 10:34 ` Greg KH
2020-07-10 10:40 ` Joakim Tjernlund
2020-07-10 10:46 ` Joakim Tjernlund
2020-07-10 12:41 ` Johan Hovold
2020-07-10 16:05 ` Joakim Tjernlund
2020-07-10 16:08 ` Joakim Tjernlund
2020-07-13 12:29 ` Johan Hovold [this message]
2020-07-13 10:08 ` Oliver Neukum
2020-07-13 20:26 ` Joakim Tjernlund
2020-07-14 7:02 ` Oliver Neukum
2020-07-14 9:06 ` Joakim Tjernlund
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=20200713122920.GX3453@localhost \
--to=johan@kernel.org \
--cc=Joakim.Tjernlund@infinera.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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).