mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: Benjamin Cherian <benjamin.cherian.kernel@gmail.com>
Cc: zaitcev@redhat.com, linux-kernel@vger.kernel.org, mtosatti@redhat.com
Subject: Re: Bug with USB proc_bulk in 2.4 kernel and possibly bug in proc_ioctl in 2.6
Date: Sat, 8 Jul 2006 13:28:56 -0700	[thread overview]
Message-ID: <20060708132856.41644999.zaitcev@redhat.com> (raw)
In-Reply-To: <mailman.1152332281.24203.linux-kernel2news@redhat.com>

On Fri, 7 Jul 2006 17:24:56 -0700, Benjamin Cherian <benjamin.cherian.kernel@gmail.com> wrote:

> I believe that there is a bug in the proc_bulk function in drivers/usb/devio.c 
> in the current 2.4 kernel. In the 2.4.28 proc_ioctl was changed so that the 
> device would be locked before proc_bulk was called (See line 1275 of 
> devio.c). In 2.4.27, no locking occurred. However, this leads to problems if 
> one thread is continuously attempting to read and another one needs to write 
> because the write thread can never access the device. []

The decision to cripple the devio in this way was conscious. The problem
scenario with 2.4.27 and earlier was how many devices would fail if
a control and other transfer were submitted simultaneously. In other
words, when desktop components (e.g. HAL) rescanned /proc/bus/usb/devices,
some other devices would throw errors. The most notorious example
would be TEAC CD-210PU, because of how widespread and popular it is.

In other words, I crippled your application for the sake of a bunch
of users of other devices. You have to realize though, that your
concerns weren't voiced in the time and it was widely believed that
user-mode drivers did not submit several URBs at once (primarily
because the queueing in HCDs of 2.4 was a suspect).

> I would have submitted a patch, but it seems like the locking/unlocking 
> mechanism is different in 2.4 and 2.6 and I wasn't sure if I would break 
> other stuff.

If you do send a patch, you need to account for the serialization
somehow. The linux-usb-devel people considered a few ideas, such
as per-device blacklists and locking flags, backport of string caching
from 2.6 (to alleviate the most common case of /proc/usb/usb/devices).

But it seems to me that the best approach would be if you made
a special case for bulk+bulk and locked out control transfers somehow.

Another option is to look at an in-kernel driver architecture for
your device. What is it, anyway?

-- Pete

       reply	other threads:[~2006-07-08 20:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1152332281.24203.linux-kernel2news@redhat.com>
2006-07-08 20:28 ` Pete Zaitcev [this message]
2006-07-10 19:58   ` Bug with USB proc_bulk in 2.4 kernel Benjamin Cherian
2006-07-10 20:40     ` Pete Zaitcev
2006-07-17 21:35       ` Benjamin Cherian
2006-07-17 22:19         ` Pete Zaitcev
2006-07-18 17:04           ` Benjamin Cherian
2006-07-19  1:33             ` Pete Zaitcev
2006-07-20 17:43               ` Benjamin Cherian
2006-07-25  6:07                 ` Pete Zaitcev
2006-07-25 19:31                   ` Willy Tarreau
2006-07-27 22:21                   ` Benjamin Cherian
2006-07-27 23:49                     ` Pete Zaitcev
2006-07-28 17:37                       ` Benjamin Cherian
2006-07-30  7:35                     ` Pete Zaitcev
2006-07-31 18:41                       ` Benjamin Cherian
2006-08-02 19:51                         ` Willy Tarreau
2006-08-03  1:02                           ` Pete Zaitcev
2006-08-03  2:33                             ` Willy Tarreau
2006-08-03  6:00                               ` Pete Zaitcev
2006-08-03  6:29                                 ` Willy Tarreau
2006-08-04 16:57                                   ` Benjamin Cherian
2006-08-04 16:55                                     ` Willy Tarreau
2006-08-09 17:01                                       ` Benjamin Cherian
2006-08-09 17:02                                         ` Willy Tarreau
2006-08-12  0:14                                           ` Marcelo Tosatti
2006-08-12  3:21                                             ` Willy Tarreau
2006-07-08  0:24 Bug with USB proc_bulk in 2.4 kernel and possibly bug in proc_ioctl in 2.6 Benjamin Cherian

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=20060708132856.41644999.zaitcev@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=benjamin.cherian.kernel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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

Powered by JetHome