public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* st.ko with usb-storage problems
@ 2003-09-15  0:41 Matthew Dharm
  2003-09-15 18:08 ` Kai Makisara
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Dharm @ 2003-09-15  0:41 UTC (permalink / raw)
  To: USB Developers, Linux SCSI list, USB Storage List

[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]

(NOTE: Cross-posted to several lists.  Watch your replies.)

For a while now in 2.5 and 2.6, I've been getting reports of an
incompatibility between st.ko and the usb-storage driver.  I've finally
managed to figure out the problem; it only affects certain hardware, and
only on certain operations.

USB is a packet-oriented protocol.  Important to the protocol is the
concept of a packet being full or not -- in a given transfer, all packets
should be full except the last one.  Since usb-storage maps the SCSI
command's scatter-gather list for direct I/O, each scatter-gather segment
(except for the last one) must be a multiple of the packet size.  That
value can vary, but is always a power of 2 (I've personally seen up to
512 bytes).

When st.ko goes to do a read, it will create a scatter-gather list with
(what looks like) a mapping of the user-space buffer.  This often results
in not-so-nicely sized segments, which are often a multiple of 8, but not
64, 128, or 512 (which are the common USB packet sizes).  This causes a
problem for the USB host-controller hardware, and the transfer fails.

Why this doesn't happen on a write is something of a mystery to me, but it
doesn't seem to happen.

If the module flag 'try_direct_io' is set to 0 (not the default), then
st.ko doesn't generate scatter-gather lists at all, and all is well.

It's not immediately clear to me how to fix this.  First, I need to figure
out why 2.4 kernels don't show this problem, I think.  Help from people who
understand st.ko would be appreciated.

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

THEY CASTRATED MY QUAKE BITS! I WANT THEM BACK!!!!
					-- Greg
User Friendly, 3/27/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-16 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-15  0:41 st.ko with usb-storage problems Matthew Dharm
2003-09-15 18:08 ` Kai Makisara
2003-09-15 19:52   ` serial_number and serial_number_at_timeout in 2.4 Charlie Brett
2003-09-15 21:09     ` Mike Anderson
2003-09-16 14:08       ` Charlie Brett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox