linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	linux1394-devel@lists.sourceforge.net,
	linux-serial@vger.kernel.org,
	Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH v2 0/1] staging: Add firewire-serial driver
Date: Fri,  2 Nov 2012 08:16:32 -0400	[thread overview]
Message-ID: <cover.1351817601.git.peter@hurleysoftware.com> (raw)
In-Reply-To: <1350565015.23730.4.camel@thor>

v2 of this driver submission builds and runs cleanly against Greg KH's
tty-next and (hopefully) addresses the concerns raised regarding the
dependence on tty_buffer internals; specifically with the workarounds to fix
1) data loss on hangup and 2) throttling before the flip buffers are full.

1) Data loss on hangup
Although I experimented with alternative solutions as Alan suggested, none
were practical. For example, this sequence (which is almost identical to
what the n_tty ldisc does in input_available_p()):

     tty_flush_to_ldisc(tty);
     n = ldisc->ops->chars_in_buffer(tty);

suffers from a race that the ldisc could have _just_ emptied the read
buffer between these calls, so that n == 0 but data is still in the
flip buffers.

For now, the driver v2 delays the hangup on carrier loss by a fixed timeout.

2) Flip buffers full before throttle received from ldisc
Because driver throttling is performed by the ldisc, and not by the
tty_buffer, the flip buffers can be filled before receiving a throttle
request.

For now, the driver v2 pre-buffers in front of the tty_buffer; ie, rx data
which is not accepted by tty_insert_flip_string...() is buffered in the
driver, the sender is throttled and when ldisc unthrottles, normal operation
resumes by feeding the tty_buffer from the pre-buffered data.

This driver v2 also fixes the occasionally flaky auto-connect, 2 (valid)
lockdep warnings, racy line status changes, and delays fifo allocation
until .activate() to minimize memory footprint.

As before, the TODO file notes the remaining issues.

Regards,
Peter

Peter Hurley (1):
  staging: fwserial: Add TTY-over-Firewire serial driver

 drivers/staging/Kconfig             |    2 +
 drivers/staging/Makefile            |    1 +
 drivers/staging/fwserial/Kconfig    |    9 +
 drivers/staging/fwserial/Makefile   |    2 +
 drivers/staging/fwserial/TODO       |   37 +
 drivers/staging/fwserial/dma_fifo.c |  310 ++++
 drivers/staging/fwserial/dma_fifo.h |  130 ++
 drivers/staging/fwserial/fwserial.c | 2946 +++++++++++++++++++++++++++++++++++
 drivers/staging/fwserial/fwserial.h |  387 +++++
 9 files changed, 3824 insertions(+)
 create mode 100644 drivers/staging/fwserial/Kconfig
 create mode 100644 drivers/staging/fwserial/Makefile
 create mode 100644 drivers/staging/fwserial/TODO
 create mode 100644 drivers/staging/fwserial/dma_fifo.c
 create mode 100644 drivers/staging/fwserial/dma_fifo.h
 create mode 100644 drivers/staging/fwserial/fwserial.c
 create mode 100644 drivers/staging/fwserial/fwserial.h

-- 
1.7.12.3


  parent reply	other threads:[~2012-11-02 12:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1350565015.23730.4.camel@thor>
     [not found] ` <20121022224505.GD24489@kroah.com>
     [not found]   ` <1350959679.2621.55.camel@thor>
     [not found]     ` <20121023105140.5996c3a5@pyramind.ukuu.org.uk>
2012-10-23 16:30       ` [PATCH 0/1] staging: Add firewire-serial driver Peter Hurley
2012-10-23 18:41         ` Stefan Richter
2012-10-24 13:41   ` Stefan Richter
2012-10-24 15:56     ` Peter Hurley
2012-11-02 12:16 ` Peter Hurley [this message]
2012-11-02 12:16   ` [PATCH v2 1/1] staging: fwserial: Add TTY-over-Firewire serial driver Peter Hurley
2012-11-12 23:33     ` Stefan Richter
2012-11-12 23:51       ` Greg Kroah-Hartman
2012-11-13 19:37         ` Peter Hurley
2012-11-13 19:47           ` Greg Kroah-Hartman
2012-11-13 19:14       ` Peter Hurley
2012-11-14  1:25         ` Stefan Richter
2012-11-27 18:33           ` Peter Hurley
2012-11-27 23:58             ` Stefan Richter
2012-11-28  1:00               ` Peter Hurley

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=cover.1351817601.git.peter@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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).