public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: George McCollister <george.mccollister@gmail.com>
Cc: Johan Hovold <johan@kernel.org>,
	linux-usb@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] USB: serial: add nt124 usb to serial driver
Date: Mon, 15 Dec 2014 10:42:06 +0100	[thread overview]
Message-ID: <20141215094206.GA6778@localhost> (raw)
In-Reply-To: <CAFSKS=PnDa+_2eBk0M7xiE5me-7muo2ddVzhk=gHWMYoXhZtmw@mail.gmail.com>

On Fri, Dec 12, 2014 at 09:01:03AM -0600, George McCollister wrote:
> On Wed, Dec 10, 2014 at 7:04 AM, Johan Hovold <johan@kernel.org> wrote:
> > On Mon, Dec 08, 2014 at 05:24:17PM -0600, George McCollister wrote:

> >> +     switch (termios->c_cflag & CSIZE) {
> >
> > C_CSIZE(tty)
> Okay
> >
> >> +     case CS5:
> >> +             newline.bDataBits = 5;
> >> +             break;
> >> +     case CS6:
> >> +             newline.bDataBits = 6;
> >> +             break;
> I should probably just remove CS5 and CS6 since I don't think they
> will work anyway.

Ok. Remember to update the passed termios with the settings that you
actually end up using (i.e. settings from old_termios).

> >> +static int nt124_open(struct tty_struct *tty,
> >> +                   struct usb_serial_port *port)
> >> +{
> >> +     struct nt124_private *priv = usb_get_serial_port_data(port);
> >> +     int result = 0;
> >> +     unsigned long flags;
> >> +
> >> +     spin_lock_irqsave(&port->lock, flags);
> >> +     port->throttled = 0;
> >> +     port->throttle_req = 0;
> >> +     spin_unlock_irqrestore(&port->lock, flags);
> >> +
> >> +     priv->flowctrl = 0;
> >
> > Drop this and keep the current settings.
> Okay
> >
> >> +     nt124_set_termios(tty, port, NULL);
> >> +     nt124_set_flowctrl(port, priv->flowctrl);
> >
> > Drop this. This is handled by tty and dtr_rts().
> Okay
> >
> >> +
> >> +     if (port->bulk_in_size)
> >> +             result = usb_serial_generic_submit_read_urbs(port, GFP_KERNEL);
> >
> > Call usb_serial_generic_open() instead (and skip the throttle-flags bit
> > above).
> Okay, so looks like the only thing I will do in this function is call
> nt124_set_termios() followed by usb_serial_generic_open().

Yes, that should do it.

> >> +static struct usb_serial_driver nt124_device = {
> >> +     .driver = {
> >> +             .owner =        THIS_MODULE,
> >> +             .name =         "nt124",
> >> +     },
> >> +     .id_table =             id_table,
> >> +     .num_ports =            1,
> >> +     .bulk_in_size =         32,
> >> +     .bulk_out_size =        32,
> >
> > Why do you reduce these buffer sizes? They can be bigger than the
> > endpoint size for increased throughput.
> I'll leave them out like most of the other drivers (and retest) unless
> you have another suggestion.

That's perfectly fine, and means that the buffer sizes will match the
endpoint sizes (they will in fact never be smaller than that).

Johan

      parent reply	other threads:[~2014-12-15  9:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 23:24 [PATCH] USB: serial: add nt124 usb to serial driver George McCollister
2014-12-09  0:29 ` Jeremiah Mahler
2014-12-09  0:51   ` George McCollister
2014-12-10 13:04 ` Johan Hovold
2014-12-11  9:05   ` Karl Palsson
2014-12-12 15:01   ` George McCollister
2014-12-14 17:51     ` George McCollister
2014-12-15  9:52       ` Johan Hovold
2014-12-15 16:09         ` George McCollister
2014-12-16 12:52           ` Johan Hovold
2014-12-15  9:42     ` Johan Hovold [this message]

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=20141215094206.GA6778@localhost \
    --to=johan@kernel.org \
    --cc=george.mccollister@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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