lkml.org 
[lkml]   [2004]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2.4] usb serial write fix
    On Mon, 01 Nov 2004 08:51:08 -0600, Paul Fulghum <paulkf@microgate.com> wrote:

    Not a bad idea. I must admit that I thought about that, but then I had
    concerns about monopolizing keventd, decided to think later about it, and
    forgot about the issue.

    > +++ b/drivers/usb/serial/usbserial.c 2004-11-01 08:29:07.000000000 -0600
    > + if (port->tty != NULL) {
    > + int rc;
    > + int sent = 0;
    > + while (sent < job->len) {
    > + rc = __serial_write(port, 0, job->buff + sent, job->len - sent);
    > + if ((rc < 0) || signal_pending(current))
    > + break;

    Why testing for signals? Do you expect any?

    > + sent += rc;
    > + if ((sent < job->len) && current->need_resched)
    > + schedule();

    That's the main problem here, isn't it. Serial communications are slow.
    Tying up a shared thread just because of this just does not look right.
    And in such CPU intensive way, too.

    Looking at pl2303 in 2.4, I do not see any difference between its ->write
    method and generic_write which would be specific to pl2303. The key
    difference is that generic_write participates in the protocol governed by
    port->write_busy. So why don't you simply drop pl2303_write?

    -- Pete
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:07    [W:0.019 / U:32.000 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site