David Brownell [Mon, 15 Dec 2003 05:38:28 +0000 (21:38 -0800)]
[PATCH] USB: <linux/usb_ch9.h> new descriptor codes, types
This patch adds definitions:
- New "video" class, for video cameras and more complicated devices;
- New "Interface association" descriptor type, used by video class,
along with two other assigned desciptor type codes (OTG, "debug")
listed in the same ECN to the USB 2.0 spec;
- Type declarations for "Interface association" and OTG descriptors.
It also replaces three copies of USB_DT_CS_* declarations in audio
support with one in <linux/usb_ch9.h>, and uses the newly exposed
symbol in "usbnet". (Near as I can tell, the convention for those
"class specific" descriptor types started with audio, and was then
adopted by several other class specifications.)
David Brownell [Fri, 12 Dec 2003 06:36:36 +0000 (22:36 -0800)]
[PATCH] USB: usb driver binding fixes
There are problems lurking in the driver binding code for usb,
with highlights being disagreements about:
(a) locks: usb bus writelock v. BKL v. driver->serialize
(b) driver: interface.driver v. interface.dev.driver
Fixing those is going to take multiple patches, and I thought
I'd start out with a small one that's relatively simple. This:
- Cleans up locking.
* Updates comments and kerneldoc to reflect that the
usb bus writelock is what protects against conflicts
when binding/unbinding drivers to devices.
* Removes driver->serialize ... not needed, since
it's only gotten when the bus writelock is held.
* Removes incorrect "must have BKL" comments, and one
bit of code that tried to use BKL not the writelock.
- Removes inconsistencies about what driver is bound to the
interface ... for now "interface.driver" is "the truth".
* usb_probe_interface() will no longer clobber bindings
established with usb_driver_claim_interface().
* usb_driver_release_interface() calls device_release_driver()
for bindings established with probe(), so the driver model
updates (sysfs etc) are done as expected.
* usb_unbind_interface() doesn't usb_driver_release_interface(),
since release() should eventually _always_ call unbind()
(indirectly through device_release_driver).
Essentially there are two driver binding models in USB today,
and this patch makes them start to cooperate properly:
- probe()/disconnect(), used by most drivers. This goes
through the driver model core.
- claim()/release(), used by CDC drivers (ACM, Ethernet)
and audio to claim extra interfaces and by usbfs since it
can't come in through probe(). Bypasses driver model.
That interface.driver pointer can be removed by changing the
claim()/release() code to use the driver model calls added
for that purpose: device_{bind,release}_driver(). I didn't
do that in this patch, since it'll have side effects like
extra disconnect() calls that drivers will need to handle.
A separate usbfs patch is needed to fix its driver binding;
mostly just to use the right lock, but those changes were
more extensive and uncovered other issues. (Like, I think,
some that Duncan has been noticing ...)
David T. Hollis [Fri, 12 Dec 2003 06:31:42 +0000 (22:31 -0800)]
[PATCH] USB: Mark AX8817x usbnet driver as non-experimental
Trivial patch to remove the Experimental mark on the AX8817x driver
portion of usbnet. The driver seems to have made the rounds enough and
is working quite well.
Linus Torvalds [Fri, 12 Dec 2003 06:20:08 +0000 (22:20 -0800)]
Fix subtle bug in "finish_wait()", which can cause kernel stack
corruption on SMP because of another CPU still accessing a waitqueue
even after it was de-allocated.
Use a careful version of the list emptiness check to make sure we
don't de-allocate the stack frame before the waitqueue is all done.
Nemosoft Unv. [Fri, 12 Dec 2003 06:13:03 +0000 (22:13 -0800)]
[PATCH] USB: PWC 8.12 driver update
Attached you will find patches that will bring the Philips Webcam driver
(PWC) up to version 8.12. The most important new feature is support for
the motorized pan & tilt feature of the new Logitech QuickCam
Orbit/Sphere, which I don't think is in the stores yet (at least it's
not on Logitech's website), but should be there soon. In addition, the
documentation in the kernel about the cams is updated.
Alan Stern [Fri, 12 Dec 2003 03:57:12 +0000 (19:57 -0800)]
[PATCH] USB: Allow configuration #0
This patch helped Jon Wilson. It allows devices to have a configuration
numbered 0, in spite of the standard convention that config #0 really
means unconfigured.
Matthew Dharm [Fri, 12 Dec 2003 01:35:24 +0000 (17:35 -0800)]
[PATCH] USB: don't send any MODE SENSE commands to usb mass storage devices
This patch basically eliminates the use of MODE_SENSE or MODE_SENSE_10 for
direct-access USB storage devices. That $&%*! command has caused us more
trouble than all the others combined, and after more than a year we still
don't have a good way of handling/using them.
I constantly get complaints about devices which don't work because of the
way 2.5/6 uses MODE_SENSE and MODE_SENSE_10 -- this patch will greatly
increase compatiblity with devices. As with the patch to limit transfer
sizes, I'd like to see this applied as soon as possible.
Matt
> ----- Forwarded message from Patrick Mansfield <patmans@us.ibm.com> -----
>
> Date: Thu, 20 Nov 2003 08:28:27 -0800
> From: Patrick Mansfield <patmans@us.ibm.com>
> Subject: [PATCH] don't send any MODE SENSE commands to usb mass storage devices
> To: mdharm-scsi@one-eyed-alien.net
Matthew -
Is this patch in your queue? I don't see it in Linus' tree yet.
Don't send any MODE SENSE commands to usb mass storage devices.
Alan Stern [Thu, 11 Dec 2003 09:06:32 +0000 (01:06 -0800)]
[PATCH] USB storage: Another unusual_devs.h update
On Thu, 20 Nov 2003, Stefan J. Betz wrote:
> Hello People,
>
> i have some Mitsumi USB Floppy Drive with the following Data:
> Manufactur: Mitsumi
> Typ : D353FUE
>
> When i plug this Device into my Linux Box (Kernel 2.6.0-test9), i get
> the following messages in my Syslog:
>
> Nov 20 22:17:57 mobileone kernel: hub 1-0:1.0: new USB device on port 1, assigned address 2
> Nov 20 22:17:57 mobileone kernel: usb-storage: This device (03ee,6901,0100 S 04 P 00) has unneeded SubClass and Protocol entries in unusual_devs.h
> Nov 20 22:17:57 mobileone kernel: Please send a copy of this message to <linux-usb-devel@lists.sourceforge.net>
> Nov 20 22:17:57 mobileone kernel: scsi2 : SCSI emulation for USB Mass Storage devices
> Nov 20 22:17:57 mobileone kernel: Vendor: MITSUMI Model: USB FDD Rev: 1039
> Nov 20 22:17:57 mobileone kernel: Type: Direct-Access ANSI SCSI revision: 02
> Nov 20 22:17:57 mobileone kernel: Attached scsi generic sg2 at scsi2, channel 0, id 0, lun 0, type 0
> I that is enough information to Support that drive (or how can i use ist
> today?)
>
> Greeting Betz Stefan
Thank you for sending this in. The usb-storage driver will be updated
sometime after 2.6.0-final is released.
Alexander Oltu [Thu, 11 Dec 2003 08:35:03 +0000 (00:35 -0800)]
[PATCH] USB storage: patch for unusual_devs.h
I send a patch and copy of /proc/bus/usb/devices for my 5`25 external
USB enclosure. I don't know exactly manufacturer of this device, but
model is CD-509.
It will be nice if it helps somebody else.
Alan Stern [Thu, 11 Dec 2003 08:24:48 +0000 (00:24 -0800)]
[PATCH] USB storage: unusual_devs.h entry revision
Here is another update for unusual_devs.h in both 2.6 and 2.4. No
urgency.
On Wed, 12 Nov 2003, Aris Basic wrote:
> Device Sony Memory Stick Reader MSAC-US1
> usb-storage: This device (054c,002d,0100 S 04 P 01) has unneeded SubClass and Protocol entries in unusual_devs.h
> Please send a copy of this message to <linux-usb-devel@lists.sourceforge.net>
Martin Pool [Thu, 11 Dec 2003 03:55:55 +0000 (19:55 -0800)]
[PATCH] USB storage: add unusual storage device entry for Minolta DiMAGE
Yes, it seems to work OK on the 7i with this updated patch. I don't
have a 7 or 7Hi to try, but everything on the web seems to say the USB
firmware works the same way.
Stephane Galles [Thu, 11 Dec 2003 03:51:43 +0000 (19:51 -0800)]
[PATCH] USB storage: patch for Kyocera S5 camera
I've seen some entries in 2.4.22 and 2.6.0 unusual_devs.h
for Kyocera Finecam S3 et S4 cameras and I own a Finecam S5
that does not work out of the box either
(here is the beast : http://www.yashica.com/digital/finecams5/finecams5.html)
so I found the unusual_devs.h entry and submitted it some month
ago at http://www.qbik.ch/usb/devices/showdev.php?id=1626
for the 2.4 kernels
I thought It would be nice to have the whole Finecam family
in Unusual_devs.h for 2.6.0
The patch for the 2.6.0-test9 is attached with this mail
It differs from the entry I submitted at www.qbik.ch
as I used the new SC/PR_DEVICE flags and got rid of the
IGNORE_SER flag from 2.4
Do you want a patch for 2.4 too ? If so, I should test my
old 2.4 entry with the lastest 2.4 Kernels, coz on a daily
basis I use a 2.4.20, which is rather old. Moreover, I could
used the SC/PR_DEVICE flags too for 2.4.22 (keeping the IGNORE_SER flag
though)
By the way, several entries with the running patch :
David Brownell [Tue, 9 Dec 2003 10:05:06 +0000 (02:05 -0800)]
[PATCH] USB: usb_hcd_unlink_urb() test for list membership
This is a minor cleanup that replaces a test for non-null urb->hcpriv
with "is the urb on this list". HCDs don't need to use hcpriv in that
way, and in general this is a safer way to test that. (AIO does much
the same thing in its kiocb cancelation paths.)
Alan Stern [Tue, 9 Dec 2003 03:48:52 +0000 (19:48 -0800)]
[PATCH] USB storage: Add comments explaining new s-g usage
On Sun, 30 Nov 2003, Matthew Dharm wrote:
> I'm going to pass this one along to Greg, but I think some places in this
> could really use some better comments. Especially the way you use a single
> buffer inside the loop -- it took me a few minutes to figure out how your
> logic to refresh the buffer with new data worked.
>
> I'm also wondering if the access_xfer_buf() function could use some more
> header comments, stating why this is needed (i.e. spelling out the
> kmap()-isms).
Okay, here it is. This patch basically just adds comments. Each routine
that uses the new scatter-gather function gets a brief explanation of
what's going on, and access_xfer_buf() itself gets detailed comments
saying what it's doing and why it's necessary. You may even want to cut
some of it back; I was pretty verbose.
Alan Stern [Tue, 9 Dec 2003 03:46:03 +0000 (19:46 -0800)]
[PATCH] USB storage: Convert sddr55 to use the new s-g routines
This patch changes the sddr55 driver to make it use the new scatter-gather
routines. It has not been tested, but perhaps Andries Brouwer will be
able to try it out.
Alan Stern [Tue, 9 Dec 2003 03:44:56 +0000 (19:44 -0800)]
[PATCH] USB storage: Update scatter-gather handling in the shuttle-usbat
This patch updates the shuttle_usbat driver to use the new scatter-gather
transfer routines. The small set of changes needed speaks well for the
original organization of the code.
Alan Stern [Tue, 9 Dec 2003 03:43:57 +0000 (19:43 -0800)]
[PATCH] USB storage: Update scatter-gather handling in the isd200 driver
This patch fixes the scatter-gather handling in isd200, replacing an
incorrect routine there with calls to the new routine added in the
previous patch. It also removes a couple of places where the driver
returned data for commands that shouldn't get any (TEST-UNIT-READY and
START-STOP).
Alan Stern [Tue, 9 Dec 2003 03:42:16 +0000 (19:42 -0800)]
[PATCH] USB storage: Convert datafab to use the new s-g routines
This patch updates the datafab driver to the new scatter-gather handling,
which makes it safe for systems with >1GByte of memory.
It has been tested by Eduard Hasenleithner.
Jens Axboe [Tue, 9 Dec 2003 01:03:05 +0000 (17:03 -0800)]
[PATCH] scsi_ioctl memcpy'ing user address
James reported a bug in scsi_ioctl.c where it mem copies a user pointer
instead of using copy_from_user(). I inadvertently introduced this one
when getting rid of CDROM_SEND_PACKET. Here's a trivial patch to fix it.
Alan Stern [Mon, 8 Dec 2003 09:45:52 +0000 (01:45 -0800)]
[PATCH] USB storage: Change sddr09 to use the new s-g access routine
This patch updates the sddr09 driver to use the new scatter-gather access
routine. After installing it, the user who experienced memory access
violations says everything is now working properly.
Alan Stern [Mon, 8 Dec 2003 09:45:21 +0000 (01:45 -0800)]
[PATCH] USB storage: Fix scatter-gather buffer access in usb-storage core
This patch adds a routine to protocol.c that correctly transfers data to
or from a scatter-gather buffer. According to Jens Axboe, we've been
using page_address() incorrectly -- it's necessary to use kmap() instead
-- and in fact it doesn't give the desired result when the buffers are
located in high memory. This could affect anyone using a system with 1 GB
or more of RAM, and one user has already reported such a problem (as you
know).
The three fixup routines in protocol.c and usb.c have been changed to use
the new s-g access routine. When similar adjustments have been made to
all the subdrivers, we will be able to eliminate the raw_bulk.c source
file entirely.
Alan Stern [Mon, 8 Dec 2003 09:45:04 +0000 (01:45 -0800)]
[PATCH] USB storage: Remove dead code from debug.c
This patch removes an uncalled subroutine from debug.c. I only noticed it
when tracking down scatter-gather usage; there didn't seem to be any
reason to repair it since it wasn't being used anywhere.
Alan Stern [Mon, 8 Dec 2003 09:44:49 +0000 (01:44 -0800)]
[PATCH] USB storage: Enhance sddr09 to work with 64 MB SmartMedia cards
This patch was written by Andries Brouwer. It adds to sddr09 the ability
to use 64 MB SmartMedia cards. I have added a few minor alterations to
make it fit in with my sequence of other patches.
Alan Stern [Mon, 8 Dec 2003 09:44:31 +0000 (01:44 -0800)]
[PATCH] USB storage: Remove unneeded scatter-gather operations in sddr09
This patch removes some unnecessary scatter-gather code from the sddr09
driver. In its place a single smaller buffer is re-used each time through
an I/O loop, as opposed to transferring all the data at once.
Andries Brouwer kindly tested this and suggested some improvements to get
it working right.
Added vendor/product ids for Epson, Genius, Microtek, Plustek,
Reflecta, and Visioneer scanners. Removed ids for HP PSC devices as
these are supported by the hpoj userspace driver.
Alan Stern [Mon, 8 Dec 2003 09:08:03 +0000 (01:08 -0800)]
[PATCH] USB: Fix khubd synchronization
It improves synchronization with hub_irq() and guarantees that the hub
disconnect() routine doesn't exit until the URB's completion routine has
finished.
Alan Stern [Mon, 8 Dec 2003 08:54:38 +0000 (00:54 -0800)]
[PATCH] USB: khubd optimization
It changes spin_lock_save() to spin_lock() within the completion routine
and list_del()/INIT_LIST_HEAD() to list_del_init(). It's nothing more
than a minor optimization.
James McMechan [Sun, 7 Dec 2003 13:57:40 +0000 (05:57 -0800)]
[PATCH] tmpfs oops fix
The problem was that the cursor was in the list being walked, and when
the pointer pointed to the cursor the list_del/list_add_tail pair would
oops trying to find the entry pointed to by the prev pointer of the
deleted cursor element.
The solution I found was to move the list_del earlier, before the
beginning of the list walk. since it is not used during the list walk and
should not count in the list enumeration it can be deleted, then the
list pointer cannot point to it so it can be added safely with the
list_add_tail without oopsing, and everything works as expected.
I am unable to oops this version with any of my test programs.
Jeff Garzik [Fri, 5 Dec 2003 15:34:00 +0000 (07:34 -0800)]
[PATCH] fix oops on unload in pcnet32
The driver was calling pci_unregister_driver for each _device_, and then
again at the end of the module unload routine. Remove the call that's
inside the loop, pci_unregister_driver should only be called once.
David Brownell [Fri, 5 Dec 2003 03:14:07 +0000 (19:14 -0800)]
[PATCH] USB: ohci, fix iso "bad entry" bug + misc
A while back there were some reports of ohci reporting a "bad entry"
diagnostic, mostly with ISO transfers, which were mysterious until
I recently found an easy way to reproduce it.
This patch:
- Fixes at least one cause of that "bad entry" diagnostic by
waiting for INTR_WDH before completing ED unlink processing.
(Else URB unlinking could free TDs on the donelist, so the
WDH processing would see those entries as "bad".)
- Merges the patch from Darwin Rambo <drambo@broadcom.com>,
coping with CPUs that can't do 16 bit accesses (MIPS).
- Renames a function as start_ed_unlink(), matching its role.
- Fixes minor debug output issues, including a FIXME to tell
more info about TDs on the periodic schedule. And adding
some missing newlines (makes this patch seem big).
Nobody's complained much about that "bad entry" issue lately, but
if necessary that part would be particularly easy to split out.
Please merge to the next kernel that gets USB patches.
Alan Stern [Fri, 5 Dec 2003 03:06:53 +0000 (19:06 -0800)]
[PATCH] USB storage: Issue CBI clear_halt and fix BBB residue
This patch does 2 things (bad, I know -- but they're both pretty small
and pretty obscure).
The CBI specification states in section 2.4.3.1.3 that
... the host shall also issue Clear Feature for Endpoint Halt
to the Bulk In pipe if the device reports that the Data In
command block has Failed.
along with a note in section 2.5.3 that Data Out commands should work
analogously. This patch does that, along with cleaning up the status
detection logic a little.
For Bulk-only transfers we currently ignore the dResidue field in the CSW,
except for reporting it (without byte-swapping!) in a debug message. The
patch uses it to compute the residue value returned to the SCSI layer.
Note that the Bulk-only spec allows devices to transfer more data than
they actually use (i.e., they may add padding or ignore stuff) and then
inform the host of this by means of the dResidue value. The logic used is
simple: our reported residue is the larger of what the device claims and
what we didn't transfer, except that it can't be larger than the total
transfer length.
Ulrich Drepper [Thu, 4 Dec 2003 14:26:06 +0000 (06:26 -0800)]
[PATCH] Fix 'noexec' behaviour
We should not allow mmap() with PROT_EXEC on mounts marked "noexec",
since otherwise there is no way for user-supplied executable loaders
(like ld.so and emulator environments) to properly honour the
"noexec"ness of the target.
Pete Zaitcev [Thu, 4 Dec 2003 07:14:51 +0000 (23:14 -0800)]
[PATCH] USB: fix comment in usblp
I know Linus is not taking cleanups at this point, but perhaps
you can delete it in your tree. Seems like someone (Oliver?)
fixed all the garbage in old printer.c, so the comment is not
needed anymore.
I reviewed changes, and usblp.c looks correct. I'm doing backport
to 2.4 for Fedora right now.
Jean Delvare [Thu, 4 Dec 2003 06:14:33 +0000 (22:14 -0800)]
[PATCH] I2C: fix i2c_smbus_write_byte() for i2c-nforce2
This patch fixes i2c_smbus_write_byte() being broken for i2c-nforce2.
This causes trouble when that module is used together with eeprom (which
is also in 2.6). We have had three user reports about the problem.
Credits go to Mark D. Studebaker for finding and fixing the problem.
Jens Axboe [Wed, 3 Dec 2003 23:53:31 +0000 (15:53 -0800)]
[PATCH] fix broken x86_64 rdtscll
The scheduler is completed b0rked on x86_64, and I finally found out
why. sched_clock() always returned 0, because rdtscll() always returned
0. The 'a' in the macro doesn't agree with the 'a' in the function,
yippe :-)
Ingo Molnar [Wed, 3 Dec 2003 04:59:12 +0000 (20:59 -0800)]
[PATCH] Fix /proc access to dead thread group list oops
The pid_alive() check within the loop is incorrect. If we are within
the tasklist lock and the thread group leader is valid then the thread
chain will be fully intact.
Instead, the check should be _outside_ the loop, since if the group
leader no longer exists, the whole list is gone and we must not try
to access it.
Hirofumi Ogawa [Mon, 1 Dec 2003 02:40:47 +0000 (18:40 -0800)]
[PATCH] Missing initialization of /proc/net/tcp seq_file
We need to initialize st->state in tcp_seq_start(). Otherwise
tcp_seq_stop() is run with previous st->state, and it calls the unneeded
unlock etc, causing a kernel crash.
Ben Collins [Wed, 26 Nov 2003 04:15:46 +0000 (20:15 -0800)]
[PATCH] Lastminute IEEE-1394 fixes
I've got a lot more changes than what's included here. I've put this
down to the bear minimum to get things working sanely.
Mainly, I just want to get all the people hit by this a chance to use
2.6.0 without having to get our tree. Changes itemized:
- Fix deadlock possibility in csr.c:read_maps()
- Fix kmalloc to use ATOMIC in highlevel.c.
- s/in_interrupt/irqs_disabled/ in ieee1394_transactions.c to fix
warnings when transactions occured.
- Introduce a release callback for the host driver and use it correctly.
- Reorganize the nodemgr probe so we do an initial scan to discover
devices, check IRM/CycleMaster, then do a final full probe when things
are kosher. Fixes a problem where device registration and hotplug
would cause some serious problems when a bus reset was forced in the
middle of the probe.
[PATCH] prevent oops from read of proc entry for tty drivers
There are /proc handles there setup by proc_tty_register_driver, but there is
no module ownership association, so anything that reads after module unload
will blow.
The trivial fix is to propagate the owner of tty_driver to proc entry.