From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Joey Oravec <joravec@drewtech.com>
Cc: linux-input@vger.kernel.org
Subject: Re: linux raw serio driver 32 byte maximum
Date: Tue, 30 Aug 2011 15:50:18 -0700 [thread overview]
Message-ID: <20110830225017.GA2405@core.coreip.homeip.net> (raw)
In-Reply-To: <4E5D5D55.5060207@drewtech.com>
Hi Joey,
On Tue, Aug 30, 2011 at 05:59:49PM -0400, Joey Oravec wrote:
> Dmitry -
>
> In serio_raw.c function serio_raw_write() there's a check:
>
> if (count > 32)
> count = 32;
>
> which coerces any call to write a maximum of 32 bytes. Do you know
> why this limitation is in the code? Characters get written
> one-by-one to the tty layer so I don't understand why it's there.
The driver was trying to mimic behavior of 2.4 psaux device as close as
possible so 32 bytes limit came from there. Besides I think it is a good
idea to not allow one process hog serio port for too long...
>
> I'm not sure which section of the manpage defines write for a serial
> port. In the ordinary case I expected this function to keep
> transmitting until complete or an error occurs. If O_NONBLOCK was
> specified then I might expect EAGAIN. Right now my calling code
> doesn't expect a successful partial write. Do you think this module
> is doing the right thing? Can you comment on what the caller must
> expect?
I think you should handle partial writes. Even if driver honored
O_NONBLOCK you could get a partial write and not necessarily EAGAIN.
May I ask you what you are using serio_raw for?
Thanks.
--
Dmitry
next prev parent reply other threads:[~2011-08-30 22:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-30 21:59 linux raw serio driver 32 byte maximum Joey Oravec
2011-08-30 22:50 ` Dmitry Torokhov [this message]
2011-08-31 0:40 ` Joey Oravec
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=20110830225017.GA2405@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=joravec@drewtech.com \
--cc=linux-input@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