From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, slapin@ossfans.org,
maxim.osipov@siemens.com, dmitry.baryshkov@siemens.com,
oliver.fendt@siemens.com
Subject: Re: [PATCH 09/10] ieee802154: add serial dongle driver
Date: Mon, 1 Jun 2009 22:52:05 +0100 [thread overview]
Message-ID: <20090601225205.1e7e8944@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20090601202946.GB7143@doriath.ww600.siemens.net>
> > > + return _send_pending_data(zbdev);
> >
> > Where do you check that the tty has enough space ?
>
> Basically that means checking for ->write result, doesn't it?
You should check write_room before writing if you want some control - you
can also then respect internal flow control via the wakeup mechanism.
Something like:
/* Wait for space */
while ((space = tty_write_room(tty)) < len) {
if (file->f_flags & O_NONBLOCK) {
err = -EAGAIN;
break;
}
interruptible_sleep_on(&tty->write_wait);
if (signal_pending(current)) {
err = -EINTR;
break;
}
}
/* Shove the entire frame down */
tty->ops->write(tty, data, len);
> > In all these ERR cases what stops a remote device from having fun spewing
> > garbage at you and filling the log ?
>
> And what stops your precious IDE controller from spewing garbage and
> filling the log? Nothing I think. I'll lower the priority of the
> messages though.
The fact the drive is entirely under my control and not potentially being
spewed at from a hostile network. Also the fact that it takes about 30
seconds to spank a misbehaving drive and reset it. The network laye
generally uses time checks (search for ratelimit()).
> any RS-232 device which implements IEEE 802.15.4 PHY layer and doesn't
> follow this protocol, we can extend the ldisc to be more like hci-uart:
> a multiplexor of protocols.
Ok
> > > + zbdev->tty = tty;
> >
> > Refcounting ?
>
> Sample code? SLIP, hci-uart, ppp don't do it.
No I'm still running around clobbering them all - and slip needed a
partial rewrite first.
zbdev->tty = tty_kref_get(tty);
tty_kref_put(foo);
> > You can't go around mashing driver internal values - many drivers don't
> > support low_latency mode and this will make them crash.
>
> C&P from drivers/bluetooth/hci-ldisc.c, around line 466. We had problems
> working with low-latency unset.
The bluetooth one needs killing too. I will do that tomorrow ...
How many releases ago - the entire tty buffering layer has been rewritten
over time. tty->low_latency requires driver specific support that most
don't have. Also as of 2.6.30rc you'll get debug spew if you misuse it.
If you still need it we need to know why.
> That's not a 'no, I won't do it', but rather 'wait, all those are also
> buggy ?!'
The tty layer has a lot of "yes, those are also buggy" - which is why I'm
currently half way through systematically brutalising it.
> > > + default:
> > > + pr_debug("Unknown ioctl cmd: %u\n", cmd);
> > > + return -EINVAL;
> >
> > This will break default ioctl processing. You probably want to call into
> > some of the generic handlers at this point depending upon your hardware.
> > Either way -EINVAL is wrong.
>
>
> n_tty_ioctl_helper ?
That depends what you need. tty_mode_ioctl() gives you all the mode
stuff, n_tty_ioctl_helper adds things like software flow management which
don't actually look relevant to your ldisc ?
Any other queries let me know, and if the tty->low_latency is still
needed let me know and we'll figure out why between us, as it should not
be.
Alan
next prev parent reply other threads:[~2009-06-01 21:52 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-01 14:54 [RFC][WIP] IEEE 802.15.4 implementation for Linux v1 Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 01/10] crc-itu-t: add bit-reversed calculation Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 02/10] Add constants for the ieee 802.15.4/ZigBee stack Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 03/10] net: add IEEE 802.15.4 socket family implementation Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 04/10] net: add NL802154 interface for configuration of 802.15.4 devices Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 05/10] ieee802154: add simple HardMAC driver sample Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 06/10] mac802154: add a software MAC 802.15.4 implementation Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 07/10] ieee802154: add virtual loopback driver Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 08/10] tty_io: export tty_class Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 09/10] ieee802154: add serial dongle driver Dmitry Eremin-Solenikov
2009-06-01 14:54 ` [PATCH 10/10] ieee802154: add at86rf230/rf231 spi driver Dmitry Eremin-Solenikov
2009-06-01 16:21 ` Gábor Stefanik
2009-06-01 20:33 ` Dmitry Eremin-Solenikov
2009-06-02 8:10 ` Holger Schurig
2009-06-02 8:21 ` Marcel Holtmann
2009-06-02 8:29 ` Ответ: " Dmitry Eremin-Solenikov
2009-06-02 8:36 ` Marcel Holtmann
2009-06-02 8:46 ` Florian Fainelli
2009-06-02 8:49 ` Maxim Osipov
2009-06-02 9:15 ` Holger Schurig
2009-06-02 9:29 ` ?????: " Jonathan Cameron
2009-06-02 11:42 ` Dmitry Eremin-Solenikov
2009-06-02 8:52 ` Ответ: " Sergey Lapin
2009-06-01 15:27 ` [PATCH 09/10] ieee802154: add serial dongle driver Alan Cox
2009-06-01 20:29 ` Dmitry Eremin-Solenikov
2009-06-01 21:52 ` Alan Cox [this message]
2009-06-02 14:43 ` Sergey Lapin
2009-06-01 15:07 ` [PATCH 08/10] tty_io: export tty_class Alan Cox
2009-06-01 15:10 ` Dmitry Eremin-Solenikov
2009-06-01 15:34 ` Alan Cox
2009-06-02 14:22 ` Dmitry Eremin-Solenikov
2009-06-02 14:35 ` Alan Cox
2009-06-05 12:24 ` [PATCH 06/10] mac802154: add a software MAC 802.15.4 implementation Pavel Machek
2009-06-04 0:32 ` [PATCH 03/10] net: add IEEE 802.15.4 socket family implementation Andrew Morton
2009-06-04 11:16 ` Dmitry Eremin-Solenikov
2009-06-04 13:46 ` John W. Linville
2009-06-04 14:10 ` Dmitry Eremin-Solenikov
2009-06-04 14:15 ` Johannes Berg
2009-06-04 0:05 ` [PATCH 01/10] crc-itu-t: add bit-reversed calculation Andrew Morton
2009-06-05 4:03 ` [RFC][WIP] IEEE 802.15.4 implementation for Linux v1 Jon Smirl
2009-06-05 4:49 ` Dmitry Eremin-Solenikov
2009-06-05 12:58 ` Jon Smirl
2009-06-13 3:21 ` Jon Smirl
2009-06-13 5:37 ` Maxim Osipov
2009-06-13 12:39 ` Jon Smirl
2009-06-21 6:40 ` Pavel Machek
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=20090601225205.1e7e8944@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=dbaryshkov@gmail.com \
--cc=dmitry.baryshkov@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=maxim.osipov@siemens.com \
--cc=netdev@vger.kernel.org \
--cc=oliver.fendt@siemens.com \
--cc=slapin@ossfans.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
all inboxes | Powered by JetHome®