From: Jason Wessel <jason.wessel@windriver.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Alan Stern <stern@rowland.harvard.edu>,
gregkh@suse.de, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] usb console,usb-serial: pass initial console baud on to first tty open
Date: Thu, 17 Sep 2009 09:17:04 -0500 [thread overview]
Message-ID: <4AB244E0.1060109@windriver.com> (raw)
In-Reply-To: <20090917141913.47f9451b@lxorguk.ukuu.org.uk>
Alan Cox wrote:
> On Thu, 17 Sep 2009 14:08:28 +0100
> Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
>
>>> - memset(&dummy, 0, sizeof(struct ktermios));
>>> - tty->termios = termios;
>>> + tty->termios = &usb_serial_tty_driver->init_termios;
>>>
>> That will corrupt the master one which is a reference used for many ports.
>>
>>
I agree.
>> You need the serial_install stuff or something similar resurrecting to do
>> this properly.
>>
>
> Here's a suggestion on how to do it.
>
> Add a tty->ops->init_termios()
>
> Make tty_init_termios() read
>
> if (tp == NULL) {
> tp = kzalloc(sizeof(struct ktermios[2]), GFP_KERNEL);
> if (tp == NULL)
> return -ENOMEM;
> memcpy(tp, &tty->driver->init_termios,
> sizeof(struct ktermios));
> if (tty->ops->init_termios)
> tty->ops->init_termios(tty);
> tty->driver->termios[idx] = tp;
> }
>
> Thats a good deal cleaner than the ->install override in the USB patches
> Greg inherited and will be usable for cleaning up USB stuff too.
>
>
Sure we can add another layer of init_termios callbacks, but where is
the right place to store the termios per console?
Should the "struct console co*" get a new member for the baud, or should
it get a termios? The source of the problem is how to inherit the
termios setting from the first user (the console code in this case).
Before making several more implementations it is probably worth
discussing few more of the details. In the current code the ->install
override has the opportunity to apply the fixup by copying something
from a "struct console co* termios" if one existed.
Certainly you could do the same thing with the proposed call back you
mentioned, but then the serial_install() needs to be removed from the
usb code and the power management setup would need to find a new home...
or a copy of the new call back would need to go into the
serial_install() as well.
Jason.
next prev parent reply other threads:[~2009-09-17 14:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 3:08 [PATCH 0/3] usb console: 2.6.32 regression fixes Jason Wessel
2009-09-17 3:08 ` [PATCH 1/3] usb console: fix mutex lock regression Jason Wessel
2009-09-17 3:08 ` [PATCH 2/3] usb console,usb-serial: fix regression use of serial->console Jason Wessel
2009-09-17 3:08 ` [PATCH 3/3] usb console,usb-serial: pass initial console baud on to first tty open Jason Wessel
2009-09-17 3:32 ` Alan Stern
2009-09-17 3:40 ` Jason Wessel
2009-09-17 3:46 ` Alan Stern
2009-09-17 4:17 ` Jason Wessel
2009-09-17 9:14 ` Alan Cox
2009-09-17 12:16 ` Jason Wessel
2009-09-17 13:08 ` Alan Cox
2009-09-17 13:19 ` Alan Cox
2009-09-17 14:17 ` Jason Wessel [this message]
2009-09-17 16:02 ` Alan Cox
2009-09-22 20:54 ` Jason Wessel
2009-09-29 17:24 ` How to handle console devices Alan Stern
2009-09-29 22:47 ` Alan Cox
2009-09-17 3:30 ` [PATCH 2/3] usb console,usb-serial: fix regression use of serial->console Alan Stern
2009-09-17 3:32 ` Jason Wessel
2009-09-17 3:25 ` [PATCH 1/3] usb console: fix mutex lock regression Alan Stern
2009-09-17 3:32 ` Jason Wessel
2009-09-18 17:16 ` Greg KH
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=4AB244E0.1060109@windriver.com \
--to=jason.wessel@windriver.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.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