From: Benjamin Cherian <benjamin.cherian.kernel@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Bug with USB proc_bulk in 2.4 kernel and possibly bug in proc_ioctl in 2.6
Date: Fri, 7 Jul 2006 17:24:56 -0700 [thread overview]
Message-ID: <200607071724.57216.benjamin.cherian.kernel@gmail.com> (raw)
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 code has changed a
little since 2.4.28, but the device is still locked before proc_bulk is
called.
In the 2.6 kernel,the device is locked before proc_bulk, or any other USB
operation for that matter, is called (see line 1419 in
drivers/usb/core/devio.c); however, the device is unlocked in proc_bulk
before usb_bulk_msg is called, and is locked after usb_bulk_msg is completed.
(See lines 716-718 & 746-748 of v2.6 devio.c)
Additionally, in 2.4.32 one of the comments says that for some ioctls, the
device does not need to be locked because they don't touch the device (e.g.
USBDEVFS_REAPURB or USBDEVFS_GETDRIVER, see 2.4.32 for more). However, in 2.6
the device is locked for all ioctls. Shouldn't this be changed?
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.
Thanks,
Ben
next reply other threads:[~2006-07-08 0:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-08 0:24 Benjamin Cherian [this message]
[not found] <mailman.1152332281.24203.linux-kernel2news@redhat.com>
2006-07-08 20:28 ` Bug with USB proc_bulk in 2.4 kernel and possibly bug in proc_ioctl in 2.6 Pete Zaitcev
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=200607071724.57216.benjamin.cherian.kernel@gmail.com \
--to=benjamin.cherian.kernel@gmail.com \
--cc=linux-kernel@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