Re: [Linux-usb-users] Mass storage on nokia phones with ehci+ohci : not working ?!

2007-12-11 Thread Alan Stern
On Tue, 11 Dec 2007, Eric Estievenart wrote:

 Hello there,
 
 I wanted to know if someone had any idea on why
 some nokia phones don't setup properly as mass storage
 devices in some configurations, before I start
 digging with usbmon  the kernel code.
 
 * Working configuration: x86/2.6.23.1, with ehci + uhci
The phone (N73) sets up properly, but gets bound to
the uhci driver.
 
 * Not working configuration: mipseb/2.6.21.5, ehci+ohci
Appears transiently in usb/devices then gets removed
after the following kernel errors:
 
 usb 2-1: new full speed USB device using ohci_hcd and address 3
 usb 2-1: config index 0 descriptor too short (expected 9, got 0)
 usb 2-1: can't read configurations, error -22
 usb 2-1: new full speed USB device using ohci_hcd and address 4
 usb 2-1: no configurations
 usb 2-1: can't read configurations, error -22
 usb 2-1: new full speed USB device using ohci_hcd and address 5
 usb 2-1: device descriptor read/8, error -62
 usb 2-1: device not accepting address 5, error -62
 usb 2-1: new full speed USB device using ohci_hcd and address 6
 usb 2-1: device descriptor read/8, error -62
 usb 2-1: device not accepting address 6, error -62
 
 
 The questions are:
 - The phone itself declares to be usb 2.0:
 
 T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
 D:  Ver= 2.00 Cls=00(ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
 P:  Vendor=0421 ProdID=0487 Rev= 1.00
 S:  Product=Nokia N73
 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
 I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
 E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
 E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
 
 Why does it get bound to the uhci driver at full speed,
 whereas it should (for me) be bound to the ehci at high speed ?

What makes you think the phone should run at high speed?  Does it run 
at high speed when you plug it into any other computers?

 When I plug other devices (e.g. flash key), on the same port,
 they are properly recognized as 2.0 and bound to the ehci
 driver, not its companion ohci/uhci.
 I don't feel it is normal...

You need to understand that there are USB 2.0 devices which don't run 
at high speed.  USB 2.0 is backwards compatible with USB 1.1; a USB 2.0 
device is allowed to run at any speed it wants.

 Where does the ehci/companion driver selection occur, and
 what is the logic behind that ?

Speed selection occurs in the hardware.  The phone has to send a
special chirp  signal to connect at high speed; if it doesn't send
that signal then it connects at full speed.

Following that, EHCI/companion selection occurs in the driver.  If the
connection was made at high speed then the EHCI controller is used,
otherwise the port is switched over to the companion controller.

 - Did someone test such devices in mass storage mode with
 ohci drivers ? May this be an endianness issue on the ohci driver ?

The OHCI drivers work just fine on PowerPC machines, which are 
big-endian.  Have you tried using a 2.6.23 kernel?

 Note that I have tested almost all userland possibilities:
 - with/without the ohci/ehci drivers
 - old_scheme_first
 - other cable/device
 
 Hoping anybodyhas a clue, I may provide any additional
 info you may find relevant.

It sounds like the phone works perfectly on the x86 system.  The mipseb
system has some problem, but it's hard to tell what.  Have you tried 
plugging other USB devices into that computer?

Alan Stern


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Mass storage on nokia phones with ehci+ohci : not working ?!

2007-12-11 Thread Alan Stern
On Tue, 11 Dec 2007, Eric Estievenart wrote:

  - Did someone test such devices in mass storage mode with
  ohci drivers ? May this be an endianness issue on the ohci driver ?
  
  The OHCI drivers work just fine on PowerPC machines, which are 
  big-endian.  Have you tried using a 2.6.23 kernel?
 
 Not yet, this is a very specific embedded hardware prototype, and I
 don't want to brick it in the next few days. Furthermore
 it probably requires specific kernel patches to run properly
 and I am not sure to have the exact source tree...
 
  It sounds like the phone works perfectly on the x86 system.  The mipseb
  system has some problem, but it's hard to tell what.  Have you tried 
  plugging other USB devices into that computer?
 
 Yes. ehci mass storage devices seem to work fine. Many other 1.1 mass
 storage (at least 3-4) fail.
 
 Thank you for the explanation, I'll feel less dumb tonight.
 For now I'll have a look at the diff between the usb tree of
 my device and a recent kernel one, to see if somethings looks
 plausibly fixing the bug. Maybe then I'll recompile just the modules.

It could still be an endianness problem.  Some OHCI hardware uses one 
byte ordering for the register access and a different byte ordering for 
the in-memory data structures.  If you look through the Kconfig file in 
drivers/usb/host you'll see some of the options.  Also check out ohci.h 
in the same directory.

Alan Stern


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] scanner works on OHCI, but not UHCI

2007-12-11 Thread Alan Stern
On Tue, 11 Dec 2007, tj wrote:

 I have a Canon FB630U USB scanner I and I am having trouble getting 
 consistant operation with it on a UHCI system vs an OHCI system both 
 running Ubuntu 7.10 2.6 kernel..
 
 The system that uses the Via chipset exhibits a strange problem. When 
 you plug in the scanner, or boot witht he scanner already plugged in, 
 and you try your first scan, either with scanimage or xsane it just 
 hangs for an indeterminate amount of time. Sometimes it will start the 
 scan after a minute or two and sometmes it will never start the scan. 
 Sometimes you can here the scanner recalibrate, but thne nothing more 
 happens.  Here is what scanimage -L reveals
 
 $ scanimage -L
 device `canon630u:/dev/usb/scanner0' is a CANON Canoscan FB630U flatbed 
 scanner
 
 Now I try the same scanner on a Compag system, OHCI, and it works first 
 time every time. No hesitation. Works perfectly.
 
 I also have a Slackware 12 installation on the Via UCHI system and it 
 exibits the exact same problem as the Ubuntu installation.
 
 So, why is it working on one system and not the other?

There could be hardware issues on the VIA system.

Alan Stern


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] scanner works on OHCI, but not UHCI

2007-12-11 Thread Alan Stern
Please use Reply-To-All; otherwise people reading the mailing list 
will never benefit from what you have learned.

On Tue, 11 Dec 2007, tj wrote:

 Alan Stern wrote:
 
 On Tue, 11 Dec 2007, tj wrote:
 
   
 
 I have a Canon FB630U USB scanner I and I am having trouble getting 
 consistant operation with it on a UHCI system vs an OHCI system both 
 running Ubuntu 7.10 2.6 kernel..
 
 The system that uses the Via chipset exhibits a strange problem. When 
 you plug in the scanner, or boot witht he scanner already plugged in, 
 and you try your first scan, either with scanimage or xsane it just 
 hangs for an indeterminate amount of time. Sometimes it will start the 
 scan after a minute or two and sometmes it will never start the scan. 
 Sometimes you can here the scanner recalibrate, but thne nothing more 
 happens.  Here is what scanimage -L reveals
 
 $ scanimage -L
 device `canon630u:/dev/usb/scanner0' is a CANON Canoscan FB630U flatbed 
 scanner
 
 Now I try the same scanner on a Compag system, OHCI, and it works first 
 time every time. No hesitation. Works perfectly.
 
 I also have a Slackware 12 installation on the Via UCHI system and it 
 exibits the exact same problem as the Ubuntu installation.
 
 So, why is it working on one system and not the other?
 
 
 
 There could be hardware issues on the VIA system.
 
 Alan Stern
 
 
   
 
 Works perfectly when running Windows. And, like I said after it finally 
 makes the first scan ( if it ever does ),  it works great after that. No 
 scan starting hesitation.

It still could be hardware issues.  The VIA parts are known to have 
strange bugs.  Windows uses drivers supplied by VIA, so presumably it 
is able to cope with the bugs.  But VIA has been very unhelpful about 
providing information on their hardware to Linux developers.

There's no way to tell from your description what the real reason is;  
you'll have to provide more information.  It would help to know what
version of the kernel you are using (uname -r).

Also, you should collect a usbmon log showing everything, starting from
the time you plug in the scanner, up to and including when you try to
collect the first scan.  Instructions for usbmon are in the kernel
source file Documentation/usb/usbmon.txt.

Alan Stern


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] dead device - usb mass storage

2007-12-08 Thread Alan Stern
On Sat, 8 Dec 2007, Cédric Villemain wrote:

 Hello,
 
 I have an hard drive which is dying. So I use the great tool
 dd_rescue to recover it.
 
 The main issue is that after few error, I have the following from
 syslog (which obviously stop the dd_rescue).
 
 How can I prevent usb to detach the mass storage device even if there
 is lot of errors ? (actually i unplug/replug the device to continue
 the test)

 Dec  8 12:57:34 agecanonix kernel: usb 4-6: reset high speed USB
 device using ehci_hcd and address 14
 Dec  8 12:57:39 agecanonix kernel: usb 4-6: device descriptor read/64, error 
 -71
 Dec  8 12:57:39 agecanonix kernel: usb 4-6: device descriptor read/64, error 
 -71

 Dec  8 12:57:41 agecanonix kernel: sd 5:0:0:0: scsi: Device offlined -
 not ready after error recovery

It's not possible to prevent the detach, because the detach is done by 
the device itself rather than by Linux.  That's why you have to unplug 
the device to make it start working again.

Alan Stern


-
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Concatanated Packets

2007-12-06 Thread Alan Stern
On Thu, 6 Dec 2007, Gadi Tunes wrote:

 Thanks for the quick reply.
 
 The device can transmit more than 64 bytes.
 Each packet is broken into 64 bytes fragments while transmitted.
 
 At normal operation, the device generated data every 4-5ms, while the
 host usually polls every 1ms.
 The issue occurs when there is one delayed poll from the host, which is
 100ms after its last poll. In this case the data is generated faster
 than the host polls, but this is not normal behavior. We cannot work
 with 100msec rates. It's too slow.

In that case you need to fix the host, not the peripheral.  Get rid of 
those 100-ms gaps.

 I also assume that there is some sort of TXFifo in the USB to overcome
 such a situation.
 
 There is nothing wrong in sending to packets in the same frame, except
 it's not supposed to be this way, and eventually the concatenation
 causes packets to get lost.
 If I will be able to overcome the concatenation issue, and force each
 packet to be transmitted in its own frame, data won't be lost.
 I tried to busy wait on the transmit status register, to verify that the
 previous packet was already sent, but it didn't help.

Why didn't it help?

 In the FW code I
 can only trigger the poll by setting the POLL_DEMAND bit in the control
 register. 

Trigger what poll?  Are you talking about the polls sent by the host?  
If you are then your statement is completely wrong -- nothing you do in 
the peripheral's firmware can cause the host to sent a poll.

 If the poll doesn't arrive, the data will still accumulate.

Why?  If you don't submit the data until after the previous packet has 
been sent, then the data can't accumulate.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Concatanated Packets

2007-12-05 Thread Alan Stern
On Wed, 5 Dec 2007, Gadi Tunes wrote:

 Hi,
 
 My device is connected to the host by 3 IN endpoints (USB 1.1).
 Two of them are interrupt HID eps and the third is bulk.
 I have an issue with packets being concatenated while sent from the
 device to the host, if the polling from the host isn't quick enough.
 For instance, in my bulk ep, I can transfer 64 bytes in each frame. I
 usually send 16 byte packages.
 If the polling was delayed from some reason, the 4 packets will be
 transferred to the host the next time it polls, and 64 bytes will be
 transferred.
 If there were more than 4 packets concatenated, the rest will be lost,
 as only 64 bytes can be passed in a frame

Why can't the device transmit more than 64 bytes in a frame?

 (but if I had a packet larger
 than 64 bytes in will be fragmented into 64-bytes fragments and all the
 data will pass).
 I had this issue also with the interrupt HID eps. I was supposed to send
 8 bytes reports, and the EP could have transferred 16 bytes, so
 sometimes I had concatenations. The reports which arrived to the host
 were illegal (incompatible with the report descriptor, awaiting 8-byte
 reports) and I got resets on the USB line. As a workaround I enlarged
 the reports into 10 bytes, which prevented the possibility of
 concatenation (the ep could not transfer 20 bytes), but with the bulk ep
 I can't do that as anything is allowed on the bulk ep, and the maximum
 package size is much bigger and I don't want to overload the USB line.

What you're saying isn't entirely clear.  It sounds like you are
submitting data to the firmware faster than the host will accept it,
and as a result some of your data is getting lost.  Is that right?

 My questions are:
 How do prevent this concatenation? I want each packet to be sent in its
 own frame.

Why do you want each packet sent in its own frame?  What's wrong with 
sending two packets in the same frame?

If you really want to prevent the device from sending more than one
packet per frame, you shouldn't submit them so fast.  After submitting
a packet, wait until the packet has been sent to the host and a frame
boundary has occurred before submitting the next packet.

 What is causing this issue?

You are.

 Should I config something in the FW related
 to the USB and DMA registers?

It's pretty hard to answer that without knowing anything about the 
device's USB and DMA registers.

 Is this a babble condition?

No.  Babble means the device transmitted more data than the host 
expected.

 Can I force the host to poll every time I have data?

No.  The host polls when it wants to; you can't affect it.

 It polls every 1ms
 anyway on the interrupt eps. I use a Poll Demand trigger every time I
 have data available for the DMA to transfer to the USB TxFifo, but these
 concatenations still happen.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Self modifying ms device

2007-12-04 Thread Alan Stern
On Mon, 3 Dec 2007, Brad Schick wrote:

 Looking for some input on the following problem that I realized isn't
 really usb specific:
 
 My goal is to display an html page that resides on a usb mass-storage
 device and changes over time. The mass-storage device will be
 read-only from the host OS, but needs to self modify its own data. The
 end-user will view an html page that periodically refreshes itself and
 hopefully changes over time. My concern is how caching in the host OS
 may hide these changes.

Sounds more like you're concerned about preventing caching in the host 
from hiding the changes.

 The usb device's MCU is very small and doesn't have space for a FAT
 driver. To modify its data I was planning to just poke changes
 directly to hard-coded offsets (the files can be pre-allocated since
 data is not created, just modified). Perhaps I could also poke the FAT
 file date, but would that be enough to cause Linux to reload the file?

No.

 Or will the kernel assume all changes to local file-systems must pass
 through the kernel and miss even that?

It will.  So will Windows or any other OS.

 Maybe there is a better approach? One big limitation is that nothing
 can be installed on the host. And I'll have to figure out Windows
 eventually as well.

If you want to use the mass-storage protocols then you're stuck.  
The only choice is to make the peripheral read-only and to go through a 
disconnect/reconnect cycle whenever the data changes.  Or else you 
could have a program on the host that flushes the cached pages.

A less clumsy approach might be to avoid being a mass-storage device.  
But I don't know what other protocol would be more suitable.  Does PTP 
support dynamic updating?

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] high-speed usb doesn't work

2007-12-04 Thread Alan Stern
On Mon, 3 Dec 2007, David Griffith wrote:

 On Mon, 3 Dec 2007, Alan Stern wrote:
  These are low-level hardware errors.  Maybe in the device, maybe caused
  by the USB cable, maybe in your EHCI controller.
 
  Some tests to try:
 
  Does the device work at high speed in a different computer?
 
 My Thinkpad T42 appears to have no trouble with it or a brand new thumb
 drive.
 
  Does it work in other ports on your computer or with a different
  USB cable?
 
 No.
 
  Do other high-speed devices work on your computer?
 
 No.
 
  Go back and look at that bug report again.  It had error -110, not
  error -71.  The two are very different.
 
 The output of lspci -v|grep HCI is the following:
 
 00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 
 (prog-if 10 [OHCI])
 00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 
 (prog-if 10 [OHCI])
 00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4) 
 (prog-if 20 [EHCI])
 
 I found a post somewhere about support for this being provided as a patch
 against 2.6.22.  I guess the solution here is to get a USB card and make
 sure the chip isn't by nVidia.

Could be.  Or maybe you could improve matters by changing some of the 
BIOS's USB settings.  You might even find that a BIOS update fixes the 
problem.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB bus unique ID

2007-12-04 Thread Alan Stern
On Tue, 4 Dec 2007, Alessio Sangalli wrote:

 Hi, do you know a way to read a unique ID for a USB bus? I would like to
 assign a given USB port to some application; I now
 read /sys/bus/usb/devices/usb* but it seems the bus* links can be
 assigned to different entities from a boot to another.
 
 Is there some kind of unique bus ID inside /sys/bus/usb/devices/usb* so
 that I can safely assign the given bus to the application?
 
 Am I confused enough :) ??

There is an almost unique bus ID you can use, given by the target of
the usbN symbolic link.  It doesn't change unless you alter the
hardware in your PC.

For example, on my system the usb1 bus currently corresponds to:

$ ls -l /sys/bus/usb/devices/usb1
lrwxrwxrwx 1 root root 0 Dec  4 14:16 /sys/bus/usb/devices/usb1 - 
../../../devices/pci:00/:00:1d.0/usb1/

Now that bus's label may change from one boot to another, sometimes 
usb1, sometimes usb5, and so on.  But whatever the label is, that bus 
will always be associated with devices/pci:00/:00:1d.0/.

You can get at the same information in reverse.  Now that I know the
path, it's enough to do this:

$ echo /sys/devices/pci:00/:00:1d.0/usb*
/sys/devices/pci:00/:00:1d.0/usb1 
/sys/devices/pci:00/:00:1d.0/usb_host:usb_host1

This says that right now, that particular bus is labelled usb1.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Linux 2.4.29 URB timeout question

2007-12-04 Thread Alan Stern
On Tue, 4 Dec 2007, B Seeger wrote:

 Howdy, 
 
 I've looked through the archives and couldn't find an answer to my
 questions, so 
 
 I have an embedded system where I use a hotplug script to automount a
 USB stick.  Sometimes it fails and the error I see is (via dmesg): 
  
 hub.c: new USB device 00:0e.0-1, assigned address 2
 scsi0 : SCSI emulation for USB Mass Storage devices
   Vendor: SanDisk   Model: U3 Cruzer Micro   Rev: 3.21
   Type:   Direct-Access  ANSI SCSI revision: 02
 usb_control/bulk_msg: timeout
 host/usb-ohci.c: unlink URB timeout
 
 The script will not run at this point as the stick doesn't appear to be
 mounted.

Is it possible that you have some other program running and trying to 
access the stick?  You could try booting into single-user mode to see 
if that's the problem.  Or kill all your daemon processes.

Another possibility is to unmount /proc/bus/usb.  That should prevent 
other programs from interfering.

 It's a linux 2.4.29 kernel (Debian distro) with basic USB support (snip
 of config file below).  The hardware we have for the USB is a USB 1.1
 port.  The vendor for the USB stick (as shown above) is SanDisk - U3
 Cruzer Micro model.  Some of their sticks work in this system, others
 don't (same exact model sticks).  

Does each stick behave consistently?

 I've had more and more of these issues over the past year with this
 system and I'm wondering if it's the fact that USB 1.1 (which this
 system is using) is not really supported by USB 2.0 sticks (though the
 manufacturer says it is).  

The manufacturer is right.

 My question's are - can anyone tell me more about this URB timeout and
 what it's caused by?  Could the USB stick be misbehaving or the kernel
 simply not up to date enough for these 2.0 sticks? 

It's not possible to tell what's causing the timeout from the 
information you have provided.

Have you tried plugging the non-working sticks into a machine running a 
more-recent 2.6 kernel?

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] high-speed usb doesn't work

2007-12-03 Thread Alan Stern
On Mon, 3 Dec 2007, David Griffith wrote:

 I'm running 2.6.22, specifically Ubuntu Gutsy.  When I plug in a usb 2.0
 masss storage device, I get this in dmesg:
 
 [ 131.646942] usb 2-3: new high speed USB device using ehci_hcd and address 5
 [ 131.758810] usb 2-3: device descriptor read/64, error -71
 [ 131.974536] usb 2-3: device descriptor read/64, error -71
 [ 132.190286] usb 2-3: new high speed USB device using ehci_hcd and address 6
 [ 132.302148] usb 2-3: device descriptor read/64, error -71
 [ 132.517889] usb 2-3: device descriptor read/64, error -71
 [ 132.733653] usb 2-3: new high speed USB device using ehci_hcd and address 7
 [ 133.141157] usb 2-3: device not accepting address 7, error -71
 [ 133.253029] usb 2-3: new high speed USB device using ehci_hcd and address 8
 [ 133.660542] usb 2-3: device not accepting address 8, error -71

These are low-level hardware errors.  Maybe in the device, maybe caused 
by the USB cable, maybe in your EHCI controller.

Some tests to try:

Does the device work at high speed in a different computer?

Does it work in other ports on your computer or with a different
USB cable?

Do other high-speed devices work on your computer?

 The drive does not appear to be recognized, nor does /dev/bus/usb/devices
 say anything about it. If I do modprobe -r ehci_hcd, the drive is
 recognized as a USB 1.1 device. Not surprisingly, the throughput is a
 horrid 1 megabyte per second or worse. This problem seems to crop up a lot
 and then the bug report is closed when the problem mysteriously vanishes.
 For example
 https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/52551

Go back and look at that bug report again.  It had error -110, not 
error -71.  The two are very different.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] usb-stick

2007-11-30 Thread Alan Stern
On Sat, 1 Dec 2007 [EMAIL PROTECTED] wrote:

 Dear list,
 
 I was trying to install a usb-stick on vaio 1998 with debian woody
 linux version 2.2.20. After creating a new kernel and some BIOS
 changes I have the impression -- it is recognised. I worked through
 the usb-guide and I had the impression it worked nicely. But I don
 not know how to mount (so that I can copy data on the stick or so).

 So if anybody could give a hint what to do next. 

Upgrade to 2.6.23.

Seriously.  2.2 never had fully working USB mass storage support.  If 
you can't manage to install 2.6 on that old machine, at least go to 
2.4.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Adjust USB 2.0 device speed in userspace

2007-11-29 Thread Alan Stern
On Thu, 29 Nov 2007, Allardyce, Joel B. wrote:

 Fellow Engineers,
 
 Is there any way to adjust the speed of one USB 2.0 device without
 affecting other USB devices attached to the same Root Hub?

Yes.  Provided the device you want to adjust is connected to a root 
hub and not an external hub.

 I have a USB mass storage device that is USB 2.0 compatible.  It
 enumerates correctly, and generally works fine at High Speed (480 mbps).
 
 For a variety of EMI related reasons, I find that it is necessary for me
 to run this device at Full Speed (12 mbps).  In my application, speed is
 not an issue, but EMI is.
 
 I know that the simple solution is to bind the UHCI driver to the Root
 Hub, instead of the EHCI driver, but this has the unfortunate side
 effect of forcing all USB devices to work in 1.1 mode.  I would like to
 avoid this since there is another USB mass storage device for which
 there are no EMI issue that I would like to continue to run at High
 Speed.
 
 I don't mind kernel hacking to get this to work, but I was hoping
 someone out there already had a simple sysfs patch, or some such, that
 would allow simple user space adjustment of a device's speed.
 
 To throw one more complication into the mix, I would, in the end, like
 to find a way to force any device connected to a particular physical USB
 port to run at Full Speed instead of High Speed.
 
 Note that I am running Debian Etch (kernel 2.6.18).  If a feature like
 this is already implemented in a later kernel, or one of the
 experimental branches, then please let me know, and point out the
 relevant source files.  I could likely backport the changes as necessary
 for my kernel.

The feature was added in 2.6.21.  The patch for it is here:

http://marc.info/?l=linux-usb-develm=117089528503119w=2

Most likely it will be easier for you to upgrade to a current kernel 
than to backport the patch.

Alan Stern


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] [PATCH] Add allow_restart usb_storage quirk

2007-11-27 Thread Alan Stern
On Tue, 27 Nov 2007, Kyle McMartin wrote:

 This Seagate FreeAgent external USB disk I just purchased seems to need
 allow_restart enabled to spin back up; otherwise I just get a pile of
 read errors when I try to access it. Add a new unusual flag for devices
 needing scsi_device-allow_restart set, and add this Seagate drive to
 the unusual devs table.

There already is a patch in Greg's USB development tree turning on 
allow_restart unconditionally for all USB mass-storage devices:

http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-03-usb/usb-storage-always-set-the-allow_restart-flag.patch

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-11-24 Thread Alan Stern
On Sat, 24 Nov 2007, RTE wrote:

 On Sat, 24 Nov 2007 07:39:13 +0300, Alan Stern wrote:
 
  You might also want to test this patch.  It should automatically set
  max_sectors to 64 -- that's lower than you need but it should work
  without errors.  (The patch is against 2.6.24-rc3, so you may have to
  merge it by hand into the source for an earlier kernel.)
 
 Yes, it works.
 cat /sys/block/sdc/device/max_sectors returns 64.
 In the copied data errors are not present.
 Tested on 2.6.23

Okay, I'll submit both patches.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Cowon iAudio D2: trouble recognizing size and partitions

2007-11-24 Thread Alan Stern
On Sat, 24 Nov 2007, Stefan Richter wrote:

 I haven't done this yet, but someone reminded me to switch
 CONFIG_SCSI_MULTI_LUN on.  Now the following happens under 2.6.22 as
 well as 2.6.24-rc3:
 
 The built-in 4GB flash is recognized as LUN 0 and gets an sd device, but
 no valid partition table is found on it.
 
 An 8GB SDHC card, if inserted into the iAudio D2, is recognized as LUN 1
 and gets an sd device.  Its partition table is recognized and the
 filesystem on the card can be mounted.  A lot of attempt to access
 beyond end of device errors are logged though, something which does not
 happen if I read this card in a separate card reader.
 
 So, CONFIG_SCSI_MULTI_LUN is what I missed when I wrote the initial
 posting.  The partition table problem on the built-in flash and the size
 problem of the extension card happened without that option too.  When I
 had a way older firmware on the iAudio D2, I was able to access the
 built-in flash and mount its 4GB partition though.

Different card readers don't always agree on the total number of
sectors available on a flash card.  Have you compared the values
reported by the kernel for the total number of sectors with the two
different card readers?  Repartitioning the device to use the smaller
number of sectors ought to fix the beyond end of device problem.

As for LUN 0 missing a partition table -- you can find out what's in
the partition sector by doing:

dd if=/dev/sdb count=1 | hexdump -C

Maybe for some reason it just needs to be repartitioned.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Multiconfiguration and mutil-interface

2007-11-23 Thread Alan Stern
On Fri, 23 Nov 2007, Anil Yadav wrote:

 Thanks Alan,
 
 I will see configuration descriptor properly.
 
 The first para of my e-mail says if the gadget with 2 configurations
 and  multiple interfaces got attached to the Host, following things
 must be done -
 
 1. all the respective interface drivers get loaded for a particular
 configuration.(e.g. if a device supports audio as well video, then
 both audio class interface driver and video driver should get loaded )

The host will load those drivers automatically if your gadget driver
behaves correctly.

 2.  if i do cat /proc/bus/usb/devices  audio class driver and video
 driver of Host should detect the gadget.

This doesn't make sense.  First of all, /proc/bus/usb/devices has
nothing to do with it -- the gadget will be detected whether you cat
that file or not.  Second, gadget detection isn't handled by audio or
video class drivers; it is handled by the hub driver.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-11-23 Thread Alan Stern
On Fri, 23 Nov 2007, RTE wrote:

 On Wed, 21 Nov 2007 00:26:26 +0300, Alan Stern wrote:
  Okay, here's a version of the patch for 2.6.23 and without the
  debugging information.
 
 Many thanks to you for the help! :)
 In 2.6.23 patch works perfectly. Errors are not present.
 
  My guess is that if you decrease max_sectors to 184 (to make it a
  multiple of 8) then the device will work without errors, even when the
  patch isn't present.
 
 Yes, you are right.
 max_sectors=184 is safe for my device even without the patch.
 With the patch errors are not present at any max_sectors.

Okay, I'll submit the patch.

You might also want to test this patch.  It should automatically set
max_sectors to 64 -- that's lower than you need but it should work
without errors.  (The patch is against 2.6.24-rc3, so you may have to
merge it by hand into the source for an earlier kernel.)

Alan Stern


Index: usb-2.6/drivers/usb/storage/unusual_devs.h
===
--- usb-2.6.orig/drivers/usb/storage/unusual_devs.h
+++ usb-2.6/drivers/usb/storage/unusual_devs.h
@@ -731,6 +731,13 @@ UNUSUAL_DEV(  0x0584, 0x0008, 0x0102, 0x
US_SC_SCSI, US_PR_ALAUDA, init_alauda, 0 ),
 #endif
 
+/* Reported by RTE [EMAIL PROTECTED] */
+UNUSUAL_DEV(  0x058f, 0x6387, 0x0141, 0x0141,
+   JetFlash,
+   TS1GJF2A/120,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_MAX_SECTORS_64 ),
+
 /* Fabrizio Fellini [EMAIL PROTECTED] */
 UNUSUAL_DEV(  0x0595, 0x4343, 0x, 0x2210,
Fujifilm,


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Multiconfiguration and mutil-interface

2007-11-22 Thread Alan Stern
On Thu, 22 Nov 2007, Anil Yadav wrote:

 Hi,
 
 I have a gadget with 2 configurations. The default configuration
 supposed to expose 2 interfaces and the other configuration supposed
 to expose a different set of interfaces. If I choose any configuration
 e.g. config 2 how should I invoke the two interfaces so that their
 respective gadget interface drivers get loaded and at host if #cat
 /proc/bus/usb/devices done it should display all the interfaces
 exposed by the gadget.

Sorry, I can't understand that last sentence.

 I guess composite devices work in same fashion.
 
 I have studied the zero.c source and tried with different options but
 only one interface driver is getting exposed. Do I need to do
 something in the device controller ?

You do not need to change the device controller driver.  You just have 
to make sure your gadget driver sends the correct descriptors to the 
host.  In the reply to a Get-Config-Descriptor request, you have to 
send the configuration descriptor followed by all the interface and 
endpoint descriptors for that configuration.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-11-20 Thread Alan Stern
On Tue, 20 Nov 2007, RTE wrote:

 On Mon, 19 Nov 2007 23:17:17 +0300, Alan Stern wrote:
 
  Below is another test patch for 2.6.17-git22.  It includes new code to
  try and fix the problem.
 
 it works :)
 no errors in the copied data

Great!

Okay, here's a version of the patch for 2.6.23 and without the 
debugging information.  It ought to work just as well as the previous 
patch.  If it does work, I will submit it for inclusion in 2.6.24.

However after testing this patch there's something else you should try.
In the logs it looks as though your device wants to have max_sectors
= 188, instead of the default value 240.  To learn more about
max_sectors, see

http://www.linux-usb.org/FAQ.html#i5

My guess is that if you decrease max_sectors to 184 (to make it a 
multiple of 8) then the device will work without errors, even when the 
patch isn't present.

Alan Stern


--- 2.6.23/drivers/scsi/sd.c2   2007-11-20 16:14:04.0 -0500
+++ 2.6.23/drivers/scsi/sd.c2007-11-20 16:16:05.0 -0500
@@ -962,7 +962,17 @@
/* This computation should always be done in terms of
 * the resolution of the device's medium.
 */
-   good_bytes = (bad_lba - start_lba)*SCpnt-device-sector_size;
+   if (start_lba = bad_lba  bad_lba  start_lba +
+   (xfer_size / SCpnt-device-sector_size))
+   good_bytes = SCpnt-device-sector_size *
+   (unsigned int) (bad_lba - start_lba);
+
+   /* If the bad_lba value is no good, maybe the residue value
+* is better.
+*/
+   else if (SCpnt-resid  0  SCpnt-resid  xfer_size)
+   good_bytes = (xfer_size - SCpnt-resid) 
+   (- SCpnt-device-sector_size);
break;
case RECOVERED_ERROR:
case NO_SENSE:


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-11-19 Thread Alan Stern
On Mon, 19 Nov 2007, RTE wrote:

 On Fri, 16 Nov 2007 22:31:20 +0300, Alan Stern wrote:
 
  Okay, that's good.  Now here's a comparable patch for 2.6.17-git22
 
 
 2.6.17-git22 with patch
 after copying 700 MB file from flash to HDD
 the copied file contains errors
 /var/log/kernel/info:

 19:49:14 localhost kernel: driver_byte 8, sense key 3
 19:49:14 localhost kernel: error_sector 0, req_sector 33116, resid 26624, 
 underflow 122880
 19:49:14 localhost kernel: Adjusted good_bytes from 122880 to -16955392

Good work.  This shows exactly where the problem is.

Below is another test patch for 2.6.17-git22.  It includes new code to 
try and fix the problem.  If it works, I'll make an analogous patch for 
you to try with 2.6.23.

Alan Stern



--- 2.6.17/drivers/scsi/sd.c1   2007-10-11 15:53:20.0 -0400
+++ 2.6.17/drivers/scsi/sd.c2007-11-19 15:15:04.0 -0500
@@ -904,6 +904,8 @@ static void sd_rw_intr(struct scsi_cmnd 
sense_valid = scsi_command_normalize_sense(SCpnt, sshdr);
if (sense_valid)
sense_deferred = scsi_sense_is_deferred(sshdr);
+printk(KERN_INFO driver_byte %x, sense key %x\n, driver_byte(result),
+sshdr.sense_key);
}
 #ifdef CONFIG_SCSI_LOGGING
SCSI_LOG_HLCOMPLETE(1, printk(sd_rw_intr: %s: res=0x%x\n, 
@@ -953,7 +955,20 @@ static void sd_rw_intr(struct scsi_cmnd 
/* This computation should always be done in terms of
 * the resolution of the device's medium.
 */
-   good_bytes = (bad_lba - start_lba)*SCpnt-device-sector_size;
+   if (start_lba = bad_lba  bad_lba  start_lba +
+   (xfer_size / SCpnt-device-sector_size))
+   good_bytes = SCpnt-device-sector_size *
+   (unsigned int) (bad_lba - start_lba);
+
+   /* If the bad_lba value is no good, maybe the residue value
+* is better.
+*/
+   else if (SCpnt-resid  0  SCpnt-resid  xfer_size)
+   good_bytes = (xfer_size - SCpnt-resid) 
+   (- SCpnt-device-sector_size);
+printk(KERN_INFO error_sector %d, req_sector %d, resid %d, underflow %d\n,
+(int) bad_lba, (int) start_lba, (int) SCpnt-resid,
+(int) SCpnt-underflow);
break;
case RECOVERED_ERROR:
case NO_SENSE:
@@ -979,6 +994,9 @@ static void sd_rw_intr(struct scsi_cmnd 
break;
}
  out:
+if (good_bytes != xfer_size)
+printk(KERN_INFO Adjusted good_bytes from %d to %d\n,
+xfer_size, good_bytes);
scsi_io_completion(SCpnt, good_bytes);
 }
 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-11-16 Thread Alan Stern
On Fri, 16 Nov 2007, RTE wrote:

 On Fri, 12 Oct 2007 00:18:11 +0400, Alan Stern [EMAIL PROTECTED] wrote:
  I'd like you to try some more experiments
 
 sorry for the long period of silence - not enough free time :(
 
 2.6.17-git21 whith patch
 after copying 700 MB file from flash to HDD
 errors in the copied file are not present

Okay, that's good.  Now here's a comparable patch for 2.6.17-git22 or 
later.  Let's see what happens when the copied data does contain 
errors.

Alan Stern


--- 2.6.17/drivers/scsi/sd.c1   2007-10-11 15:53:20.0 -0400
+++ 2.6.17/drivers/scsi/sd.c2007-11-16 14:27:24.0 -0500
@@ -904,6 +904,8 @@ static void sd_rw_intr(struct scsi_cmnd 
sense_valid = scsi_command_normalize_sense(SCpnt, sshdr);
if (sense_valid)
sense_deferred = scsi_sense_is_deferred(sshdr);
+printk(KERN_INFO driver_byte %x, sense key %x\n, driver_byte(result),
+sshdr.sense_key);
}
 #ifdef CONFIG_SCSI_LOGGING
SCSI_LOG_HLCOMPLETE(1, printk(sd_rw_intr: %s: res=0x%x\n, 
@@ -954,6 +956,9 @@ static void sd_rw_intr(struct scsi_cmnd 
 * the resolution of the device's medium.
 */
good_bytes = (bad_lba - start_lba)*SCpnt-device-sector_size;
+printk(KERN_INFO error_sector %d, req_sector %d, resid %d, underflow %d\n,
+(int) bad_lba, (int) start_lba, (int) SCpnt-resid,
+(int) SCpnt-underflow);
break;
case RECOVERED_ERROR:
case NO_SENSE:
@@ -979,6 +984,9 @@ static void sd_rw_intr(struct scsi_cmnd 
break;
}
  out:
+if (good_bytes != xfer_size)
+printk(KERN_INFO Adjusted good_bytes from %d to %d\n,
+xfer_size, good_bytes);
scsi_io_completion(SCpnt, good_bytes);
 }
 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB 2.0 external drive silently corrupted

2007-11-16 Thread Alan Stern
On Fri, 16 Nov 2007, Tony C wrote:

 Thanks for the note.  For completeness, I'm attaching the usbmon
 output that I gathered while running a non-desctructive 'badblocks'
 on a drive's ext3 partition (and which resulted in the thrashing of
 the partition table while I was collecting this file).  I have also
 attached my lsusb and lspci output.

Well, the usbmon output was complete, but it didn't show anything
unexpected.  Errors occurred every few seconds, and each one triggered
a reset followed by a successful retry.  The log contained only read 
commands, no writes.

It's possible that these errors are caused by hardware problems in the 
computer's USB controller.  The manufacturer's drivers would be able to 
work around these problems, but the Linux drivers wouldn't.  However 
that's just a guess.  And it's not clear how such errors would cause 
the drive to corrupt anything.

The large number of errors does indicate a serious problem somewhere.  
Have you tried using the drive with a different brand of computer?  Or
a different USB cable?

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB 2.0 external drive silently corrupted

2007-11-16 Thread Alan Stern
On Fri, 16 Nov 2007, Dr. C. wrote:

 Hello everyone,
 
 I have two Maxtor external USB drives which are causing me problems
 under various Linux kernels (I’ve tried 2.6.16.53, 2.6.23.1, and
 2.6.24-rc2). While these drives work fine under Windows, under linux I
 can partition the disks and format them, but when I attempt to read or
 write a large quantity of data, the drive becomes corrupted, the
 content becomes trashed and the partition table disappears:
 
 I had a detailed email prepared, but since my email keeps getting
 rejected due to rule match, I'll keep this brief: In the system log,
 the only thing that appears is an innocuous reset:, but turning on the
 kernel-storage-debug flag, we can see a bit more of what is occurring,
 something related to ‘3strikes’:
 
 Nov 11 19:18:55 www kernel: ehci_hcd :00:03.3: devpath 1 ep8in 3strikes
 Nov 11 19:18:55 www kernel: usb-storage: Status code -71; transferred 
 23552/6553
 6
 Nov 11 19:18:55 www kernel: usb-storage: -- unknown error
 Nov 11 19:18:55 www kernel: usb-storage: Bulk data transfer result 0x4
 Nov 11 19:18:55 www kernel: usb-storage: -- transport indicates error, 
 resetting
 Nov 11 19:18:55 www kernel: usb-storage: storage_pre_reset
 Nov 11 19:18:55 www kernel: usb-storage: Status code 0; transferred 
 65536/65536
 Nov 11 19:18:55 www kernel: usb-storage: -- transfer complete
 
 If this gets through I'll post more detail. Any suggestions? Is this
 just a case of hardware bugs being exposed linux? Should I open a
 kernel bug?

I don't think it's a kernel bug.  Much more likely is a low-level
hardware or firmware failure.  It could be a hardware bug, or it could
be a bad cable (or the equivalent).

The kernel log posted above isn't complete, that is, there are lines 
missing in the middle.  You'd be better off using usbmon (see 
Documentation/usb/usbmon.txt).

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB mount takes 30 seconds!

2007-11-15 Thread Alan Stern
On Wed, 14 Nov 2007, Diego Zuccato wrote:

 Alan Stern ha scritto:
  On Tue, 13 Nov 2007, Steve Kelem wrote:
  
  I have a USB hard drive that I'm trying to use with Linux.
  It does mount, but it takes 30 seconds!
 [...]
  Possibly some error occurs, the system waits during a 30-second 
  timeout, and then the disk is reset.
  What shows up in the output from dmesg after you mount the filesystem?
 Happened to me, too, when using an 'old' kernel (2.6.19, maybe).
 It seems that big reiser filesystems might take quite a long time to
 be mounted, if umounted correctly (quite absurd, since a dirty
 disconnect takes less time to be recovered...).
 
 Now I upgraded to a newer kernel (2.6.22-tmb-laptop-2mdv) and mount is
 nearly immediate on same HW.
 
 Maybe some extra checks in reiser code that, while nearly undetectable
 on internal drives, slowed down external ones? But I think it's not
 USB-related.

This sounds reasonable.  There wasn't anything in the usbmon data to 
indicate a problem.

Try upgrading to a later kernel and see what happens.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Hardware supporting g_file_storage

2007-11-15 Thread Alan Stern
On Wed, 14 Nov 2007, Thomas Marx wrote:

  Hi,
 
 I need to export some files from a Linux device via the 
 g_file_storage-module. 
 
 The Linux device compiles a set of files into a virtual disk which should 
 then 
 be exported to another system via USB/g_file_storage. 
 
 My question is which is the easiest and cheapest way of adding USB client mode
 support to a system? I have seen references to NET2880-cards which seem to 
 cost 
 around 400$, are there other, cheaper cards that are supported by Linux?

If you search on the web, you may find companies offering those cards 
at a lower price.

 Is there any supported chipset available via PCMCIA? Because the original 
 system
 I am planning to use is a notebook, which means no PCI-slot available, so a 
 PCMCIA
 solution would be even better.

Not as far as I know.  However you might be better off using a Gumstix
device (http://www.gumstix.com/) instead of a notebook.  Other possible 
device controllers are listed on the Gadget page at www.linux-usb.org.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB mount takes 30 seconds!

2007-11-13 Thread Alan Stern
On Tue, 13 Nov 2007, Steve Kelem wrote:

 I have a USB hard drive that I'm trying to use with Linux.
 It does mount, but it takes 30 seconds!
 When I type:
 % ls /media/usbdrive
 /var/log/messages says:
 Nov 13 00:05:34 laptop kernel: ReiserFS: sda1: found reiserfs format
 3.6 with standard journal
 Nov 13 00:06:05 laptop kernel: ReiserFS: sda1: using ordered data mode
 Nov 13 00:06:05 laptop kernel: ReiserFS: sda1: journal params: device
 sda1, size 8192, journal first block 18, max trans len 1024, max batch
 900, max commit age 30, max trans age 30
 Nov 13 00:06:05 laptop kernel: ReiserFS: sda1: checking transaction log
 (sda1)
 Nov 13 00:06:05 laptop kernel: ReiserFS: sda1: Using r5 hash to sort names
 Nov 13 00:06:05 laptop udevd[2311]: get_netlink_msg: no ACTION in
 payload found, skip event 'mount'
 Nov 13 00:06:08 laptop udevd[2311]: get_netlink_msg: no ACTION in
 payload found, skip event 'umount'
 
 and then the drive is unmounted!
 I don't always have this drive plugged in, so I don't want a permanent
 automount in /etc/fstab, but having to wait 30 seconds for an ls is
 horrible.
 
 Any idea of what's wrong?

Possibly some error occurs, the system waits during a 30-second 
timeout, and then the disk is reset.

What shows up in the output from dmesg after you mount the filesystem?

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB mount takes 30 seconds!

2007-11-13 Thread Alan Stern
On Tue, 13 Nov 2007, Steve Kelem wrote:

 dmesg has less info than /var/log/messages:
 SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC= SRC=192.168.111.153
 DST=192.168.1.255 LEN=139 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP
 SPT=631 DPT=631 LEN=119
 ReiserFS: sda1: found reiserfs format 3.6 with standard journal
 SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC= SRC=192.168.111.153
 DST=192.168.1.255 LEN=124 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP
 SPT=1054 DPT=111 LEN=104
 SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC= SRC=192.168.111.153
 DST=192.168.1.255 LEN=135 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP
 SPT=631 DPT=631 LEN=115
 ReiserFS: sda1: using ordered data mode
 ReiserFS: sda1: journal params: device sda1, size 8192, journal first
 block 18, max trans len 1024, max batch 900, max commit age 30, max
 trans age 30
 ReiserFS: sda1: checking transaction log (sda1)
 ReiserFS: sda1: Using r5 hash to sort names

That's not very useful, is it?  :-(

Try using the usbmon facility.  Instructions are in the kernel source 
file Documentation/usb/usbmon.txt.  It should show exactly what's going 
on.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] dummy_hcd for kernel-2.4.X

2007-11-12 Thread Alan Stern
On Mon, 12 Nov 2007, Anil Yadav wrote:

 Hi,
 
 I am looking to implement a dadget device with the help of dummy_hcd
 and zero. in kernel-2.6 I am able to manipulate various options in
 zero.c  by using dummy_hcd module.  When I am moving to kernel-2.4.28,
 unfortunatley  don't find dummy_hcd.c file to build. Infact not even
 the latest releases of 2.4 kernel series carry this file. Can anybody
 put some pointers in this regard so that the emulation can be done
 with dummy_hcd.c

Nobody has ever ported dummy_hcd to a 2.4 kernel.  If you want to use 
it, you'll have to port it yourself.

There is no documentation other than what exists in the kernel source.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB storage: corrupted data transfers

2007-11-10 Thread Alan Stern
On Sat, 10 Nov 2007, Mark Lord wrote:

 Something may be broken in USB / usb-storage land.
 
 I've got a 2GB USB stick here.
 I want to copy it to an image file on my hard drive:
 
 cat /dev/sdb  usbkey.image1
 
 Make a second copy, with or without unplugging/replugging the stick:
 
 cat /dev/sdb  usbkey.image2
 
 After doing this, the two copies *differ*.
 
 So I wrote a little program to compare them and determine *how* they differ,
 and the result is very interesting.
 
 Periodically, or or the other file has 8192 *zero* bytes inserted
 in place of it's data.   Not replacing it's data, just inserted
 into the stream, causing the real data (which follows) to be offset by 8192.

That's strange.  It happens periodically, you say?  What's the period?

 If one skips over the inserted 8192 bytes in the file, the data from that 
 point
 onward matches the other file, until another 8192 zeros are encountered.
 
 The total sizes of the two image files match each other,
 but that's probably just due to the logic in the 'cat' program.
 
 I wonder where those extraneous pairs of zero pages are coming from?

Me too.  It seems rather unlikely that they are coming from the USB
device or the transport, since at that level everything is addressed in
terms of sector numbers.  I don't see how 16 extra sectors could just
get inserted.  More believable would be a problem in the block layer,
the filesystem, or the application.

 This makes USB drives somewhat unreliable for backups and the like,
 which unfortunately is exactly what just about everybody uses them for.

Or it makes all drives somewhat unreliable, depending on just where the 
problem is.

 This (so far) is with 2.6.23.1 (w/slab allocater), and 2.6.24-rc2,
 on two different machines (both Intel based, but different chipset, CPU, RAM, 
 ...).
 
 I suspect not all brands/models of USB sticks would give the same results,
 but it is rather worrisome that it happens at all.

You could try doing a more specific test.  Write a program to access
the block device sector-by-sector and store a distinct recognizable
byte pattern to each sector.  (Maybe just repeat the 4-byte sector 
number over and over.)  Then write another program to read the
data back and see what bytes ended up in which sectors.

At the same time, use the usbmon facility (see
Documentation/usb/usbmon.txt) to record exactly what data gets sent
to/from the stick.  That should at least be sufficient to determine the
problem is in the stick itself, in the SCSI/USB layers, or someplace
higher up.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Requested help for device not accepting address error

2007-11-08 Thread Alan Stern
On Thu, 8 Nov 2007, Rosario D. Contarino wrote:

 Hi all,
 
 I'm trying to connect an external HD with USB 2.0 interface to
 a notebook with USB 1.1 interface.
 
 Here is the scenario:
 
 I have an old Acer TM 347T running:
 
 ---
 [EMAIL PROTECTED] ~]# uname -a
 Linux micro 2.6.9-55.0.12.EL #1 Fri Nov 2 10:57:39 EDT 2007 i686 i686
 i386 GNU/Linux
 [EMAIL PROTECTED] ~]# cat /etc/redhat-release
 CentOS release 4.5 (Final)
 ---

 What I've already tested so far:
 
 1) Same machine, same HD and same cable works well with Windows XP,
 2) modprobe -r ohci_hcd and modprobe ohci_hcd returns the same error
 as if I was booting the machine with the hard drive already on
 3) noacpi as boot option of the kernel
 
 
 Any suggestion will be greatly appreciated.

I hate to say this because it is so obvious...  Upgrading to 2.6.23 
will probably help a lot.  The 2.6.9 kernel is quite old.  Furthermore, 
nobody will be willing to help you debug the problem unless you use a 
recent kernel.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Error 84 during reads

2007-11-08 Thread Alan Stern
On Thu, 8 Nov 2007, Brad Schick wrote:

 I have a usb device (lsusb -v below) running custom firmware based on
 example code from Atmel . There are two interfaces: 0 is a mass storage
 interface with two endpoints, 1 is a custom vendor interface with one
 interrupt IN endpoint. The custom interface is used to send data to an
 app on the host based on libusb (Ubuntu 2.6.22-14-generic kernel).
 Custom commands are sent to the device on the default control endpoint.
 
 When I remove interface 0 (mass storage) in the firmware, the custom
 interface works as expected. I can send commands on the default endpoint
 and successfully read resulting data on the interrupt IN endpoint.
 
 But when I enable the mass storage IF I can no longer read from the
 interrupt endpoint. Each read request returns almost immediately with no
 data. This is what reads look like in usbmon's output:
 
 cd5c10c0 2870377317 S Ii:107:03 -115 32 
 cd5c10c0 2870424737 C Ii:107:03 -84 0
 
 Error 84 is EILSEQ, and looking around the kernel source seems to mean
 protocol error or unplug (although it has various uses). Any ideas why
 this might be happening? I've been digging around the firmware code, but
 I was hoping someone might have some suggestions.

Perhaps the device doesn't transmit any packets in response to the IN 
packet for the interrupt endpoint.  It should reply with either NAK or 
DATAx, and if it doesn't send anything at all the host will report a 
protocol error.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Hi Regarding usb module

2007-11-08 Thread Alan Stern
On Tue, 6 Nov 2007, root wrote:

 Hi All,
   i have to write test case for usb module..for that,first im checking
 with mass storage devices..im working with linux-2.6.22 kernel..In that
 linux-2.6.22/drivers/usb/gadget one dummy_hcd.h file is there i inserted
 this module its working fine..But when iam inserting ether.c module iam
 getting errors as usb_gadget_register_driver and
 usb_gadget_unregister_driver undefined.i want to insert this file.
 
 The same steps i have done in 2.6.20 its working fine.but its not
 working in 2.6.22 kernel..
 
 Can anyone please suggest me how to rectify the error.

I don't have any problem with modprobe g_ether in 2.6.24-rc1.  Are 
you sure that dummy_hcd is properly loaded?

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Bootable File-backed Storage Gadget?

2007-11-07 Thread Alan Stern
On Wed, 7 Nov 2007, hapet hapet wrote:

 Hi,
 
 I wonder if it is possible to set up a USB-Storage-Device via the
 g_file_storage-Module and make it bootable?

Have you tried it?  As far as I know, you don't need to do anything to
a USB storage device to make it bootable (except putting an OS on it,
of course).

 Can it be done? If so, how can it be done?

I have never tried to do it.  Maybe other people have.  I assume 
nothing special is needed, but I haven't looked into the matter.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Valid signals for USBDEVFS_DISCSIGNAL and uurb-signr

2007-11-07 Thread Alan Stern
On Wed, 7 Nov 2007, Phil Endecott wrote:

 Dear Experts,
 
 It seems that the signal that can be used with USBDEVFS_DISCSIGNAL and 
 in usbdevfs_urb.signr is limited to the real-time signals SIGRTMIN to 
 SIGRTMAX.  What's the rationale for this restriction?  I believe that a 
 process can kill() itself with any signal number, can't it?  I was 
 planning to use SIGIO for usbdevfs_urb.signr and SIGTERM (uncaught) for 
 USBDEVFS_DISCSIGNAL.  I don't think I'll have a problem with using 
 SIGRTMIN+n instead, but I'm curious to know if there's some subtle 
 problem with the non-real-time signals that I should be aware of.

I don't know of any reason for this restriction.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] handling timeouts on usb_bulk_msg

2007-11-05 Thread Alan Stern
On Mon, 5 Nov 2007, Andrew Greensted wrote:

 Hi All,
 
 I've written a custom device driver based on the usb-skeleton.c file in
 the kernel source.
 
 I want the driver to act in a similar way to when you read from a serial
 port. ie, when you do this:
 
 cat /dev/ttyS0
 
 it will wait for data to appear on the port and output to the terminal.
 It doesn't timeout, or close the connection when no data is available.
 In my case the data source is an IN endpoint from a custom usb board.
 
 The problem is how do I stop cat (or any other program) closing the
 connection when the read function timesout (the condition when no data
 is yet available).
 
 I've tried checking to see if the return value from usb_bulk_msg is
 ETIMEDOUT and returning 0 (no bytes read) from my read function rather
 than the error, but cat still exits.
 
 I've also tried setting the timeout parameter in usb_bulk_msg to 0 (wait
 forever). But then you can't exit (^c) or even kill the program reading
 from the port.

There are two possible approaches.  The easy way is just to use a very,
very long timeout.  Alternatively, when a timeout does occur don't
return to the user; instead loop back and submit another usb_bulk_msg.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Interrupt in/out timeout problems

2007-11-02 Thread Alan Stern
On Fri, 2 Nov 2007, Brad Schick wrote:

 I'm getting occasional timeouts for interrupt OUT writes and IN reads,
 and I have a theory but I'm looking for some input from people with
 more experience.
 
 The device is an Atmel AT90USB162 chip running on a STK526 development
 board. The firmware is a slightly modified version of a generic hid
 example from Atmel. This is connected to a Linux host running Kernel
 2.6.22-12-generic (under Ubuntu 7.10 32bit). The host machine has usb
 1.1 only. I have a test program on the host build on libusb.
 
 This is what happens: After reseting my device, the a timeout happens
 on the first read or write if the previous run of the test program
 ended on an odd number of reads or writes since reset. Lets say I have
 one read operation per run of my test program. On the first run after
 device reset it will work, 2nd run will timeout, 3rd will work, 4th
 timeout, etc. If I change the test program to make two read requests,
 they never timeout. Same pattern for writes.
 
 I'm USB newbie, but my best theory is that the DATA0/DATA1 toggle on
 the device or the host is getting out of sync when the test program
 starts or ends, causing the host controller to throw away one good
 packet until it gets back in sync (meaning the linux driver never sees
 the data).

Your theory sounds right.

 There is little traffic on the bus, so it is easy to view with usbmon.
 This is the kernel's output for one run of the test program with two
 writes and a read just after device reset (all is working):
 
 cfc4ea80 2533411848 S Io:073:02 -115 8 = 0101 
 cfc4ea80 2533424482 C Io:073:02 0 8 
 cfc4ec00 2534643656 S Io:073:02 -115 8 = 9d05 
 cfc4ec00 2534656329 C Io:073:02 0 8 
 d78b5000 2534861031 S Ii:073:01 -115 8 
 d78b5000 2534864299 C Ii:073:01 0 8 = 059d 
 cfc4e840 2535867107 S Co:073:00 s 01 0b    0
 cfc4e840 2535868186 C Co:073:00 0 0
 
 Now run again without resetting the device. Two working writes and a
 read timeout:
 
 cb8a2420 2513765604 S Io:073:02 -115 8 = 0101 
 cb8a2420 2513778931 C Io:073:02 0 8 
 cb8a2c60 2514993749 S Io:073:02 -115 8 = 1105 
 cb8a2c60 2515010776 C Io:073:02 0 8 
 cb8a28a0 2515214664 S Ii:073:01 -115 8 
 cb8a28a0 2517219497 C Ii:073:01 -2 0
 cb8a2ea0 2518219870 S Co:073:00 s 01 0b    0
 cb8a2ea0 2518221382 C Co:073:00 0 0
 
 So does my theory sound reasonable? Any other? Is there a way to tell
 what the host controller is expecting the DATA0/DATA1 state to be at
 any given time (I could make the device firmware set a LED to indicate
 which state it is sending or reading with)?

It's possible, requiring more or less effort depending on which host 
controller driver you are using.

 And why is the following
 sent each time the test program ends:
 
 cfc4e840 2535867107 S Co:073:00 s 01 0b    0
 cfc4e840 2535868186 C Co:073:00 0 0
 
 I believe this is the kernel telling interface 0 to use alternate
 setting 0. Would that come from the  USBDEVFS_RELEASEINTERFACE IOCTL
 sent by libusb upon release the interface? Would you expect this to be
 resetting the host controllers data toggle to 0? I can look into the
 firmware to see what it is doing in response.

Yes and yes.  See section 9.1.1.5 of the USB 2.0 specification.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] lsusb.c relies on Linux-specific byte-swap call

2007-10-31 Thread Alan Stern
On Wed, 31 Oct 2007, Joe Peterson wrote:

 Hi all,
 
 I am a developer at Gentoo, and I work on a subproject that uses the
 FreeBSD kernel.
 
 The latest version of usbutils in Gentoo (0.73) uses the call:
 __le16_to_cpu (in asm/byteorder.h).  This is not in FreeBSD, so it does
 not build on the fbsd port.  I have patched it to work, but it might be
 good to get this compatibility fix upstream.  Let me know if I should
 contact the devel list instead.

Actually you should contact the maintainer of usbutils.  But in the 
absence of any person clearly fulfilling that role, the development 
list would be the best place for this.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Does ioctl(USBDEVFS_SUBMITURB) send signal on successful completion?

2007-10-29 Thread Alan Stern
On Mon, 29 Oct 2007, Phil Endecott wrote:

 Dear Experts,
 
 I have a simple user-space driver that uses usbdevfs.
 
 As I understand it, there is no way to select() on data being available 
 on an endpoint.  So I have one thread per endpoint which does an 
 ioctl(USBDEVFS_BULK) read.  This is fine, until I need to shut down 
 (that part of) the driver.  Ideally, I would like to be able to 
 pthread_cancel the threads - but ioctl is not a cancellation point.  
 Similarly, I could send a signal to the thread, but according to 'man 
 ioctl', ioctl does not return EINTR to indicate that it has been 
 interrupted by a signal.
 
 I've considered the possibility that ioctl(USBDEVFS_BULK) might in fact 
 return EINTR if it gets a signal; I've tracked the code path as far as 
 a call to wait_for_completion_timeout() in  usb_start_wait_urb(); I 
 think that that would be wait_for_completion_interruptible_timeout() if 
 it were interruptible by a signal, yes?

That's right.

 So, I'm now looking at using ioctl(USBDEVFS_SUBMITURB) and 
 ioctl(USBDEVFS_REAPURB) instead.  (I think I'll need to use these 
 anyway eventually, in order to have more than one URB in progress 
 simultaneously, for improved throughput.)

Yes; for anything at all complicated you're better off with
asynchronous I/O.

  Hopefully I can submit a 
 request (which should not block) and I'll get a signal when it's ready 
 - except that usbdevfs.h says signal to be sent on error - does it 
 really not send a signal if the URB completes successfully?  The code 
 in async_completed() seems to send the signal irrespective of the value 
 in urb-status.

The comment in the header file is wrong; the signal always gets sent 
provided you set signr to something other than 0.

 Or maybe there is some other approach that I should be taking.

Nope.  This is the way to go.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-28 Thread Alan Stern
On Fri, 26 Oct 2007, Ken Rushia wrote:

 I've been reading this thread, thinking it may be the problem I'm running 
 into 
 on my computer with 2.6.23.  After the computer boots, the bus resets 
 repeatedly and a flood like this appears in messages:
 
 usb 1-5: new high speed USB device using ehci_hcd and address 2
 usb 1-5: new high speed USB device using ehci_hcd and address 3
 [...]
 usb 1-5: new high speed USB device using ehci_hcd and address 127
 [repeat]

It seems extremely unlikely that your problem is the one referred to in
the Subject line.  After all, your log messages talk about ehci_hcd,
not ohci_hcd.

 I am using an Asus A8N32-SLI Deluxe motherboard.  lspci -nnvv output can be 
 seen at http://forumattachments.krns1.fastmail.fm/lspci-nnvv.txt
 
 Have any patches for this made it into 2.6.24-rc1?  I'd be happy to do any 
 testing required to get this issue resolved.
 
 While I'm here, another note; EHCI appears to have broken sometime after 
 2.6.15 
 on this board (USB2 flash drive hasn't worked since then).  This has been 
 reported by others as well.  I'm not sure if there is any relation between 
 this 
 and the recent reset loop issue.

In what respect isn't your EHCI controller working?  Can you provide 
dmesg logs with CONFIG_USB_DEBUG enabled?

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Host Controller Driver Question

2007-10-27 Thread Alan Stern
On Thu, 25 Oct 2007, Steve Addison wrote:

 I need to add a USB host controller chip to an embedded product that's 
 running a kernel 2.4.18
 When selecting a host controller chip, I'm wondering about drivers. Are 
 pretty much all OHCI chips
 handled by the generic OHCI drivers?

Lots of them are.  I would hesitate to say that all of them are.

 Also, I noticed that in the 2.6 kernel driver source, it looks like 
 there are quite a few drivers for
 specific host chips (linux\drivers\usb\host). Are these chips that 
 differ from the OHCI/UHCI standards
 enough that they need special drivers?

No.  They differ from the standard in that they use a
platform-specific interface instead of PCI.  Otherwise they are pretty
much the same as any other OHCI controller.

 Or would any chip need a specific 
 driver?

You probably can answer this question yourself.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Buffer OverFlow

2007-10-27 Thread Alan Stern
On Fri, 26 Oct 2007, Ankur wrote:

 Hi,
 Is there any way to check whether the USB buffer is empty or not or the
 current command has been sent or not ?
 I am doing this
sendControlMessage ();
system(usleep 8000);
sendControlMessage ();
 
 this seems to be creating a problem with the device , the connection gets
 lost and device stops responding , is there any way to actually check
 whether the command in the buffer has been sent or not ?

It's kind of hard to answer this question since you don't explain what 
SendControlMessage() does.  The most natural approach would be for 
SendControlMessage() not to return until the message has been sent and 
the buffer is empty.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Possible bug is USB storage/sda module? [having the same problem, can you help?]

2007-10-27 Thread Alan Stern
On Wed, 24 Oct 2007, Halfling Rogue wrote:

 I'm sorry if this seems very random, but I've been having a lot of trouble
 mounting an external WD USB hard drive, and while Googling my particular I/O
 error I came across your message on the mailing
 listhttp://www.mail-archive.com/linux-usb-users@lists.sourceforge.net/msg16405.html.
 I'm running Dapper Drake Ubuntu on an IBM ThinkPad, and I was hoping you
 might know of a patch that could fix my problem? It mounts some of the time,
 but only after repeated unplugging and replugging, and I also have the
 problem outlined here:
 
 http://ubuntuforums.org/showthread.php?p=3624990#post3624990

I don't know what patches might fix your problem because I don't know 
what your problem is.  It would help if you build a kernel with 
CONFIG_USB_STORAGE debug enabled and post the dmesg log.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Possible causes of EOVERFLOW (babble) error?

2007-10-24 Thread Alan Stern
On Wed, 24 Oct 2007, Phil Endecott wrote:

  No.  That is, this is one meaning of the word babble, but in this
  context babble means the device was still transmitting when the host
  expected it to stop.  In other words, the device sent a larger packet
  than the host expected, like a 64-byte packet when the host expected 
  only 18 bytes, or a 3-byte packet when the host expected only 2 bytes.
 
 Thanks Alan.  Like declaring a bMaxPacketSize0 of 8, and then when 
 asked for 18 bytes of device descriptor, returning all 18 in one 
 packet?

Exactly.

  That looks like it's my problem!
 
 
 Aside: while I was trying to understand this, I stumbled upon this code 
 in core/hub.c.  This is in 2.6.19; apologies if it has changed since 
 then.  In hub_irq():
 
  bits = 0;
  for (i = 0; i  urb-actual_length; ++i)
  bits |= ((unsigned long) ((*hub-buffer)[i]))
   (i*8);
  hub-event_bits[0] = bits;
 
 This is processing the data from a hub's status-change endpoint.  My 
 concern is what happens if more than one port's status changes within 
 the endpoint's polling interval.  It's OK if the hub returns a single 
 report with all of the appropriate per-port bits set,

That's what will happen.

 but is it allowed 
 to return two reports, one showing one port change and a second also 
 showing a second port change?

No.  Interrupt endpoints don't pack more than one message into a single
packet.  Since the device doesn't know what the host expects, it has to
assume the host expects to receive only one message.

  I believe that in this case the code 
 above will attribute the second report to non-existent port numbers and 
 subsequently ignore them.  (I'm not worried about the MaxPacketSize / 
 babble here - though thinking about that was how I came to look at this 
 code - it seems to be 16 bytes for my hubs.)
 
 My concern is less about the correctness of the code - after all, if 
 hub status change reporting was broken, someone would have complained 
 by now - but more about whether I correctly understand how an interrupt 
 endpoint works.  In general, if an additional event occurs in the 
 device before a previous one has been seen by the host, does the new 
 status replace the old one?

It depends on the device, or the device's class.  With hubs, each
report is supposed to include the current change-status of every port,
so if two ports have had status changes then they will both be included
in the report.  Other sorts of devices might work differently.

  This would be similar to how a hardware 
 interrupt-status register would work.  However, thinking about a 
 keyboard you certainly don't want new keypresses to replace old ones 
 that have not been read yet!  So, from the point of view of a device 
 (e.g. a microcontroller) providing a general-purpose interrupt endpoint 
 feature, should new data be queued behind old data, or should it 
 replace it?

Like I said, it depends on the device.  A keyboard device might store 
key-press and key-release events in an internal buffer so that they can 
be presented to the host in the correct sequence.  However the USBHID 
protocol specification specifically allows keyboards to drop events if 
they occur too quickly.

BTW, in spite of the name it's a mistake to identify interrupt endpoint
behavior too closely with actual hardware interrupts.  You're better
off thinking of them as bounded-latency channels.  If an interrupt
endpoint has a polling period of 32 ms, then it is guaranteed the
device will have a chance to report each event to the host within 32 ms
of the time it occurs.  With bulk or control endpoints there is no such 
guarantee.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Possible causes of EOVERFLOW (babble) error?

2007-10-24 Thread Alan Stern
On Wed, 24 Oct 2007, Phil Endecott wrote:

 Alan Stern wrote:
  Interrupt endpoints don't pack more than one message into a single
  packet.
 
 OK.  So considering the example of a keyboard where the user has 
 pressed two keys within one polling period, they have to be returned in 
 two separate packets, which will be one polling period apart.  (Or 
 maybe discard one of them.)  Right?

You should _read_ the USB HID specification instead of guessing about
what it says.  According to Appendix C, each report from a keyboard is
supposed to indicate the current set of keys being pressed, and the
host is supposed to figure out what has happened by comparing the
current state with the previous state.

In short -- No, if the user has pressed two keys within one polling
period then the keyboard has to include both of them in a single packet
in the next report.

  If an interrupt
  endpoint has a polling period of 32 ms, then it is guaranteed the
  device will have a chance to report each event to the host within 32 ms
  of the time it occurs.
 
 ..unless it generates events at a rate of more than one each 32 ms, in 
 which case they will have to wait (or be discarded).

No.  The device has the chance to report events every 32 ms.  Which 
events it chooses to report is up to it.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Possible causes of EOVERFLOW (babble) error?

2007-10-23 Thread Alan Stern
On Tue, 23 Oct 2007, Phil Endecott wrote:

 Dear Experts,
 
 What can anyone tell me about the EOVERFLOW error (-75), reported e.g. 
 as follows:
 
 Oct 23 14:45:15 egypt kernel: usb 3-2.1: device descriptor read/all, 
 error -75
 
 I understand that it means babble,

Yes.

 i.e. that the device was still 
 transmitting when the end-of-frame was due.

No.  That is, this is one meaning of the word babble, but in this
context babble means the device was still transmitting when the host
expected it to stop.  In other words, the device sent a larger packet
than the host expected, like a 64-byte packet when the host expected 
only 18 bytes, or a 3-byte packet when the host expected only 2 bytes.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Sending a bus reset from userspace

2007-10-19 Thread Alan Stern
On Fri, 19 Oct 2007, James Lamanna wrote:

 Hi,
 Is there a way to send a bus reset from userspace?
 I'm trying to debug a USB powered device, and I would like to send it
 a bus reset without having to power-cycle it.

There's no such thing as a bus reset in USB.  However you can do a port 
reset using the program posted here:

http://marc.info/?l=linux-usb-usersm=116827193506484w=2

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-18 Thread Alan Stern
On Wed, 17 Oct 2007, David Miller wrote:

 From: Alan Stern [EMAIL PROTECTED]
 Date: Wed, 17 Oct 2007 11:51:57 -0400 (EDT)
 
   + break;
   + }
   + if (limit_1  0) {
   + ohci_warn(ohci, Root port outer-loop reset timeout, 
   +   now[%04x] reset_done[%04x]\n,
   +   now, reset_done);
   + }
  
  What reason is there for having two warning messages?  One ought to be 
  enough.
 
 In my patch it was possible for the inner loop one to succeed, but the
 outer one to not do so.
 
 In your's this is not the case so I guess it's OK.
 
 I wonder if it's so wise trying to do two things at once.  Here we are
 adding the loop timeouts, and also changing to using jiffies based
 timeouts rather than a chip timer register based one.
 
 I preferred my patches because it solved one single problem, the lack
 of loop limits.  The timeout mechanism could have been changed in
 another followon patch.

At this point I'd be perfectly happy to sit back and let David B.
choose, among all the possibilities that have been posted, the one he
thinks is best.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Please help... strange USB errors.

2007-10-18 Thread Alan Stern
On Thu, 18 Oct 2007, Riccardo Tempesta - Idealia Group s.r.l. wrote:

 I did not try a different device type, but I tried with three different 
 USB boxes with the same result.
 The error seems to be present even if the device is disconnected.
 
 I'm really confused... any idea?

I'm confused too.  How can you get errors if the device isn't 
connected?

You should monitor /proc/interrupts.  Look at what it says before you 
plug in the box, while the errors occur, and then afterwards.  See if 
you can tell whether the controller for that USB bus is getting any 
interrupts.

Also it might help if you build a kernel with CONFIG_USB_DEBUG turned 
on.  Then the dmesg log could provide more information.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-17 Thread Alan Stern
On Tue, 16 Oct 2007, David Miller wrote:

 From: Alan Stern [EMAIL PROTECTED]
 Date: Tue, 16 Oct 2007 11:23:58 -0400 (EDT)
 
  Do you have any idea _where_ in ohci_hub_control the hang still occurs?  
  Is it the same unbounded reset loop?
 
 Yes, with post status stuck at 0x111
 
  Does the patch below satisfy both Davids?
 
 No, there are no warning messages that trigger

Okay, below is my patch with a warning message.

 My last patch was just fine, it timed out appropriately and warned the
 user telling them exactly what event timed out.

It isn't just fine.  See below for comments. 

 I'm reposting it here for reference, this is getting silly:
 
 Signed-off-by: David S. Miller [EMAIL PROTECTED]
 
 diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
 index bb9cc59..9149593 100644
 --- a/drivers/usb/host/ohci-hub.c
 +++ b/drivers/usb/host/ohci-hub.c
 @@ -563,14 +563,19 @@ static inline int root_port_reset (struct ohci_hcd 
 *ohci, unsigned port)
   u32 temp;
   u16 now = ohci_readl(ohci, ohci-regs-fmnumber);
   u16 reset_done = now + PORT_RESET_MSEC;
 + int limit_1;
  
   /* build a continuous enough reset signal, with up to
* 3msec gap between pulses.  scheduler HZ==100 must work;
* this might need to be deadline-scheduled.
*/
 - do {
 + limit_1 = 100;

Where did 100 come from?  Why not rely on the reset_done criterion,
which clearly is what you want?  Why have two tests for end-of-loop?

 + while (--limit_1 = 0) {
 + int limit_2;
 +
   /* spin until any current reset finishes */
 - for (;;) {
 + limit_2 = PORT_RESET_HW_MSEC * 2;

This also is a somewhat arbitrary limit.  There's no obvious reason why
PORT_RESET_HW_MSEC should be both the limit for this loop and the
length of the msleep below.

 + while (--limit_2 = 0) {
   temp = ohci_readl (ohci, portstat);
   /* handle e.g. CardBus eject */
   if (temp == ~(u32)0)
 @@ -579,6 +584,10 @@ static inline int root_port_reset (struct ohci_hcd 
 *ohci, unsigned port)
   break;
   udelay (500);
   }
 + if (limit_2  0) {
 + ohci_warn(ohci, Root port inner-loop reset timeout, 
 +   portstat[%08x]\n, temp);
 + }
  
   if (!(temp  RH_PS_CCS))
   break;
 @@ -589,7 +598,14 @@ static inline int root_port_reset (struct ohci_hcd 
 *ohci, unsigned port)
   ohci_writel (ohci, RH_PS_PRS, portstat);
   msleep(PORT_RESET_HW_MSEC);
   now = ohci_readl(ohci, ohci-regs-fmnumber);
 - } while (tick_before(now, reset_done));
 + if (!tick_before(now, reset_done))

I realize that you are copying existing code here, but this makes the 
same kind of mistake you are trying to fix.  If a broken controller 
fails to increment its framenumber register, this termination condition 
will never be satisfied.  Better to compare against a jiffies value.

 + break;
 + }
 + if (limit_1  0) {
 + ohci_warn(ohci, Root port outer-loop reset timeout, 
 +   now[%04x] reset_done[%04x]\n,
 +   now, reset_done);
 + }

What reason is there for having two warning messages?  One ought to be 
enough.

Alan Stern



Index: usb-2.6/drivers/usb/host/ohci-hub.c
===
--- usb-2.6.orig/drivers/usb/host/ohci-hub.c
+++ usb-2.6/drivers/usb/host/ohci-hub.c
@@ -560,10 +560,10 @@ static void start_hnp(struct ohci_hcd *o
 /* called from some task, normally khubd */
 static inline int root_port_reset (struct ohci_hcd *ohci, unsigned port)
 {
-   __hc32 __iomem *portstat = ohci-regs-roothub.portstatus [port];
-   u32 temp;
-   u16 now = ohci_readl(ohci, ohci-regs-fmnumber);
-   u16 reset_done = now + PORT_RESET_MSEC;
+   __hc32 __iomem  *portstat = ohci-regs-roothub.portstatus[port];
+   u32 temp;
+   unsigned long   reset_done = jiffies +
+   msecs_to_jiffies(PORT_RESET_MSEC);
 
/* build a continuous enough reset signal, with up to
 * 3msec gap between pulses.  scheduler HZ==100 must work;
@@ -578,6 +578,12 @@ static inline int root_port_reset (struc
return -ESHUTDOWN;
if (!(temp  RH_PS_PRS))
break;
+   if (time_after(jiffies, reset_done)) {
+   ohci_warn(ohci, Port %d reset timeout, 
+   status %x\n,
+   port + 1, temp);
+   break;
+   }
udelay (500

Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-17 Thread Alan Stern
On Tue, 16 Oct 2007, Greg KH wrote:

 But perhaps we can order the hardware init stuff from all three together
 like this into a separate module they all depend on.  In a way, that's
 what the lock tried to do, right?  Are we just not catching all places
 we could have hardware being talked to by two modules at the same time?

No, we do catch the one place where it happens.  The problem seems to
be that the hardware update takes some time.  That is, on one side we
take the write lock, talk to the EHCI hardware, and drop the write
lock.  On the other side we take the read lock, talk to the OHCI 
hardware, and drop the read lock.  Nevertheless, the interference 
occurs.  David B.'s interpretation is that the hardware's change of 
state takes more time than the CPU uses in manipulating locks and 
switching tasks.  Hence his suggestion for adding a delay.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Please help... strange USB errors.

2007-10-17 Thread Alan Stern
On Mon, 15 Oct 2007, Riccardo Tempesta - Idealia Group s.r.l. wrote:

 Hi,
 I installed an Ubuntu 7.04 and I'm getting strange errors with UHCI.
 I'm using an USB box from waitec perfectly working on other systems.
 
 I get the following errors at boot:
 device descriptor read/64 error -110
 device descriptor read/64 error -110
 device descriptor read/64 error -110
 device descriptor read/64 error -110
 device descriptor read/8 error -110
 device descriptor read/8 error -110
 device descriptor read/8 error -110
 device descriptor read/8 error -110
 usb_set_interface failed
 usb_set_interface failed
 usb_set_interface failed
 
 Later, while trying to use the device I get a -71 error.
 
 The device works good on other systems.
 I even tryed to add a PCI USB card and connect the box there with the 
 same results.
 
 Already tryed to disable ACPI.
 
 My OS is Ubuntu 7.04 server with kernel 2.6.20-16.
 Compact Fujitsu with  Intel chipset.
 
 Please help!

Do other USB devices work on the Fujitsu computer?

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-16 Thread Alan Stern
On Mon, 15 Oct 2007, David Miller wrote:

 I want to help with this, but if I even breath on the kernel the bug
 goes away.  The race just gets harder to trigger, and if we just keep
 adding things it'll make the problem go away but for the absolutely
 wrong reasons.
 
 The only way we will provably fix this is to make sure EHCI initialize
 fully, first, regardless of kernel config or what userland does.

Unfortunately that simply isn't possible.  No matter what you do, the 
user can always unload ehci-hcd and then load it back in again.

Do you have any idea _where_ in ohci_hub_control the hang still occurs?  
Is it the same unbounded reset loop?

Does the patch below satisfy both Davids?

Alan Stern



Index: usb-2.6/drivers/usb/host/ohci-hub.c
===
--- usb-2.6.orig/drivers/usb/host/ohci-hub.c
+++ usb-2.6/drivers/usb/host/ohci-hub.c
@@ -560,10 +560,10 @@ static void start_hnp(struct ohci_hcd *o
 /* called from some task, normally khubd */
 static inline int root_port_reset (struct ohci_hcd *ohci, unsigned port)
 {
-   __hc32 __iomem *portstat = ohci-regs-roothub.portstatus [port];
-   u32 temp;
-   u16 now = ohci_readl(ohci, ohci-regs-fmnumber);
-   u16 reset_done = now + PORT_RESET_MSEC;
+   __hc32 __iomem  *portstat = ohci-regs-roothub.portstatus[port];
+   u32 temp;
+   unsigned long   reset_done = jiffies +
+   msecs_to_jiffies(PORT_RESET_MSEC);
 
/* build a continuous enough reset signal, with up to
 * 3msec gap between pulses.  scheduler HZ==100 must work;
@@ -578,6 +578,8 @@ static inline int root_port_reset (struc
return -ESHUTDOWN;
if (!(temp  RH_PS_PRS))
break;
+   if (time_after(jiffies, reset_done))
+   break;
udelay (500);
}
 
@@ -589,8 +591,7 @@ static inline int root_port_reset (struc
/* start the next reset, sleep till it's probably done */
ohci_writel (ohci, RH_PS_PRS, portstat);
msleep(PORT_RESET_HW_MSEC);
-   now = ohci_readl(ohci, ohci-regs-fmnumber);
-   } while (tick_before(now, reset_done));
+   } while (time_before_eq(jiffies, reset_done));
/* caller synchronizes using PRSC */
 
return 0;


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-10-12 Thread Alan Stern
On Fri, 12 Oct 2007, Dominique Dumont wrote:

 Alan Stern [EMAIL PROTECTED] writes:
 
  Okay.  That narrows it down to a single patch, this one:
 
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=03aba2f79594ca94d159c8bab454de9bcc385b76
 
 There's a weird line in this patch:
 
 -   if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
 +   if (scsi_end_request(cmd, 1, good_bytes, !!result) == NULL)
 
 The '!!result' is a double negative.
 
 This is corrected in linux 2.6.22:
 
 /* A number of bytes were successfully read.  If there
  * are leftovers and there is some kind of error
  * (result != 0), retry the rest.
  */
 if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
 return;

In fact it was corrected before 2.6.18-rc1 appeared, so it can't 
explain RTE's problem.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] User-space driver: order of uevents vs usbfs, claiming devices, and configurations

2007-10-11 Thread Alan Stern
In answer to some of your original questions:

On Thu, 11 Oct 2007, Phil Endecott wrote:

 Hi Oliver, thanks for the quick reply.
 
 Oliver Neukum wrote:
  Am Donnerstag 11 Oktober 2007 schrieb Phil Endecott:
  Claiming devices: I understand how the usb core offers new devices to 
  kernel drivers based on the struct usb_device_id.  Is there any way for 
  my user-space driver to influence this process?  (A sufficient solution 
  for me for the time being would be a way to temporarily disable the 
  kernel matching while my user-space code is running; for example, I'd 
  be happy to load a small kernel module that clobbers the existing 
  matching somehow.)
 
  You can unbind a device from its driven with an ioctl through usbfs.
 
 OK; is it one of the ones listed at the end of usbdevice_fs.h ?  I 
 don't see an obvious one...
 
 I would be happier if I could prevent it from ever getting bound in the 
 first place though!

There's no question that userspace drivers are second-class citizens.  
But even kernel drivers have the same sort of problem: If two kernel 
drivers can both manage the same device, there's no mechanism to make 
sure which one will get bound.  (Well, there _is_ one special-case 
mechanism.  libusual mediates conflicts between ub and usb-storage.)

There's no way to temporarily disable the kernel's built-in driver 
matching.

  Choosing configurations: It looks as if I get two uevents when a device 
  is attached, one for the unconfigured device and another once the core 
  has done SetConfiguration.  Is there any way for my driver to influence 
  the SetConfiguration process?  Presumably I could do a 
  USBDEVFS_SETCONFIGURATION if I were unhappy with the configuration that
 
  Yes, what's wrong with that?
 
 Nothing at all, except that the device will have been given first one 
 configuration and then another in quick succession.  I don't know if 
 that would ever be a problem.

It shouldn't be a problem.  Depends on the device, though.

  it had chosen.  (Is there any way for a kernel driver to influence the 
  SetConfiguration process?)
 
  usb_driver_set_configuration() whose semantics are a bit strange.
 
 Thanks, I'll have a look at that.

It ends up doing much the same thing; a new configuration is installed
quickly after the original one.  There's no way for a driver to
influence the original choice of a default configuration.

 Order of events: I have some code that listens for KOBJECT_UEVENTs 
 using netlink and then opens the corresponding /proc/bus/usb/ file.  
 But this sometimes fails, because the uevents are sent before the files 
 are created.  I could simply retry, but there's also the converse 
 situation where the device has already been removed (e.g. it has 
 bounced) to worry about - is there a better way to do this?

This last problem is unavoidable.  A USB device can be unplugged at any 
time, and nothing -- not even a kernel driver -- will learn about it 
immediately.  Drivers have to be prepared to handle errors caused by 
devices that unexpectedly disappear.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Read errors on Flash Drive Transcend TS1GJF2A

2007-10-11 Thread Alan Stern
On Thu, 11 Oct 2007, RTE wrote:

 On Fri, 31 Aug 2007 22:39:40 +0400, Alan Stern wrote:
 
  There's a good chance that your problem isn't caused by anything in the
  USB stack, but rather by a change somewhere else.
 
 I did not use Git (150 MB is too much for my unstable internet connection to 
 download at once), but I find the source of my problem.
 The problem is in these files:
 
 include/scsi/scsi_cmnd.h
 drivers/scsi/scsi_lib.c
 drivers/scsi/sd.c
 
 I replaced these files in linux-2.6.17-git22 with the same from 
 linux-2.6.17-git21 and errors disappeared.

Okay.  That narrows it down to a single patch, this one:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=03aba2f79594ca94d159c8bab454de9bcc385b76

I'd like you to try some more experiments to determine what is wrong 
with that patch.  Below is a diagnostic patch which should print some 
useful information in the system log when one of those read errors 
occurs.  This patch should be applied to a working kernel, such as 
2.6.17-git21.

When we have the information from this, I'll send you a comparable 
diagnostic patch for 2.6.17-git22.  The differences ought to indicate 
where the bug lies.

(By the way, I can't easily test-compile this patch on my machine.  
It looks okay, but there might be something wrong with it.)

Alan Stern



--- 2.6.17/drivers/scsi/sd.c0   2007-10-11 15:52:58.0 -0400
+++ 2.6.17/drivers/scsi/sd.c2007-10-11 16:10:34.0 -0400
@@ -923,6 +923,8 @@ static void sd_rw_intr(struct scsi_cmnd 
 */
if (driver_byte(result) != 0 
 sense_valid  !sense_deferred) {
+printk(KERN_INFO driver_byte %x, sense key %x\n, driver_byte(result),
+sshdr.sense_key);
switch (sshdr.sense_key) {
case MEDIUM_ERROR:
if (!blk_fs_request(SCpnt-request))
@@ -962,6 +964,9 @@ static void sd_rw_intr(struct scsi_cmnd 
 
error_sector = ~(block_sectors - 1);
good_bytes = (error_sector - SCpnt-request-sector)  
9;
+printk(KERN_INFO error_sector %d, req_sector %d, resid %d, underflow %d\n,
+(int) error_sector, (int) SCpnt-request-sector, (int) SCpnt-resid,
+(int) SCpnt-underflow);
if (good_bytes  0 || good_bytes = this_count)
good_bytes = 0;
break;
@@ -998,6 +1003,9 @@ static void sd_rw_intr(struct scsi_cmnd 
 * how many actual sectors finished, and how many sectors we need
 * to say have failed.
 */
+if (good_bytes != this_count)
+printk(KERN_INFO Adjusted good_bytes from %d to %d, block_sectors %d\n,
+this_count, good_bytes, (int) block_sectors);
scsi_io_completion(SCpnt, good_bytes, block_sectors  9);
 }
 


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] [linux-usb-devel] OHCI root_port_reset() deadly loop...

2007-10-10 Thread Alan Stern
On Tue, 9 Oct 2007, David Brownell wrote:

  From: Greg KH [EMAIL PROTECTED]
 
  Here's some information from Intel about where they have seen this
  happen for UHCI controllers, so it's not just an OHCI issue :(
 
  ...
 

The Intel error reports here are kind of unclear.

  1) We see that the ports with low speed devices are still in EHCI mode
  (port owner bit not written to in EHCI driver).

_When_ are they still in EHCI mode?

  In our analyzer captures
  we see the reads from the Port Status  Control register and it is
  indicating that there are low speed devices on the ports. Can you tell
  us why the driver would not be doing the write to the port owner bit
  when it sees that low speed devices are attached to that port? Is there
  something specific that it looks for and decides not to do the write?
 
 It's hard to say without more info about what's going on.  It
 might be on a non-enumeraton code path -- where nothing expects
 to set the OWNER bit -- or the CONNECT bit might not be set.
 See host/ehci-hub.c for details about exactly what the EHCI parts
 are doing, and core/hub.c for how it's driven.

Right.  In general the driver _does_ write to the port owner bit when 
it sees a low-speed device is attached to the port.  If that didn't 
happen in this case, maybe it's because the driver didn't see it.  
There are only one or two places in the code where the driver checks.

 (It can be tricky to make sense of all that, easier if debugging
 messages are turned on.   But that changes timings.  Better yet
 would be being non-intrusive tracing of the actual code paths
 that the CPU follows.)

It certainly would help us if the tests were made on a kernel with
CONFIG_USB_DEBUG enabled.

  2) In other cases we see that the ports with the low speed devices are
  back in UHCI mode but the ports are disabled. In this case we see from
  the analyzer traces that the UHCI driver has completed setting up the
  port. It has actually enabled that port in UHCI mode.

This implies that the reset sequence finished successfully.  Did that 
actually happen?

  We then see the
  EHCI driver comes in and it resets everything. The driver then gives
  control back to the UCHI controller (by setting the port owner bit)
  but...since the UHCI driver has already setup this port once it seems
  that it does not go back and set it up again. In this case we do not
  think that the UHCI driver has completed running when the EHCI driver
  comes in and does the reset.

But above they said that it _had_ completed!  Did they mean that the 
reset was complete but the driver hadn't yet detected that it was 
complete?

  Can you tell us if the UHCI driver was
  interrupted in the middle but after the ports with the low speed devices
  had been enabled would the UHCI driver ever go back and reinitialize the
  ports with the low speed devices?
 
 If the UHCI driver got disconnect and reconnect notifications,
 I expect it would do so.  At least OHCI seems *not* to have gotten
 such notifications.  I'm speculating that the just a switch
 behavior for the CF (and OWNER) bits may not allow notifications
 like that to happen when the companion controllers are resetting.

That seems likely.  There's no way (as far as I can tell) for a host to 
see a disconnect while a reset is in progress.  Of course, as soon as 
the reset is over then the host should see the disconnect, and it 
should set the corresponding Connect-Status-Changed bit.

Amusing scenario: Suppose that ehci-hcd initializes the EHCI controller 
(taking control of the port), sees that the device isn't high speed, 
and switches port ownership back to the companion controller, all 
during the span of the companion's reset.  The companion would never 
know anything had happened!  But then everything should just work -- 
the port would be enabled and communication should proceed normally.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Problem with BF531 and ISP1362 (linux 2.6.19.3)

2007-10-10 Thread Alan Stern
On Tue, 9 Oct 2007, Patrik Sevallius wrote:

 On 10/9/07, Alan Stern [EMAIL PROTECTED] wrote:
   On Tue, 9 Oct 2007, Patrik Johansson wrote:
 
   Hi,
  
   I have a board with a BF531 and a ISP1362. I'm getting timouts when
   doing device enumeration on certail devices. Most devices work fine, but
   I have a couple who times out when asking for string descriptors, and
   now one device that times out on SET_ADDRESS. I was able to get the
   devices that times out on string descriptors to work by disabling some
   code in drivers/usb/core/hub.c
  
   I welcome any ideas and pointers towards fixing this issue. What
   information can I provide to help solve this?
  
   Btw, the device works perfectly on my desktop computer.
  
   One weird coincidence is that all the devices where asking for string
   descriptors results in timeouts are devices using the MTP protocol (some
   of the support normal USB-storage as well).  The device that times out
   on SET_ADDRESS is a Muvid MP-521.
 
  If you can build kernels with CONFIG_USB_DEBUG set on both the board
  and the desktop computer, then there might be some useful information
  in the dmesg logs of the two machines.  It would at least be
  interesting to compare them.
 
 At the moment I don't have access to the machines in question (it's a
 customers hardware). But I did get some logs with some of the
 debugging in isp1362-hcd.c set. I have two logs, one for a working
 device and one for a non-working. I'll see if I can attach them (I
 tried earlier but the mail just bounced saying it was filtered out).
 
 cowon.txt.gz is a log from a Cowon D2, a working device.
 muvid.txt.gz is a log from the Muvid MP-521.
 
 From what i can tell from the logs, there's supposed to be an
 interrupt where there is a khubd error usb 1-2: khubd timed out on
 ep0out len=0/0. That's the confusing bit, it works fine with so many
 other devices. I tried increasing the timeout (it was 5 seconds) to
 50, but still no interrupt.
 
 I'll try getting the logs you asked for from the client as soon as possible.

It could be the problem is in the Muvid device rather than the isp1362.  
Or maybe the two of them are slightly incompatible with each other, 
while still being close enough to spec that they work with other 
devices or controllers.

I don't know anything about how the isp1362 works, so I can't make much 
sense of the log files you sent.  You could try asking for help from 
the people who wrote the driver.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] how to power off an usb device

2007-10-09 Thread Alan Stern
On Tue, 9 Oct 2007, Leopold Faschalek wrote:

 Hi All,
 
 we have an embedded arm9 linux-2.6.20 system with usb devices conncted
 via hubs. The hubs are able to power on/off each device. Is it
 possible to power off single devices per software?
 (This would be needed if a single device does'nt respond any more)
 
 I searched the kernel sources , but found only functions for suspend
 via power management.
 
 Or is this function doable with an usb reset? and how do I do this?
 
 Thanks for any information.

Check out this web page:

http://www.gniibe.org/ac-power-by-usb/ac-power-control.html

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Problem with BF531 and ISP1362 (linux 2.6.19.3)

2007-10-09 Thread Alan Stern
On Tue, 9 Oct 2007, Patrik Johansson wrote:

 Hi,
 
 I have a board with a BF531 and a ISP1362. I'm getting timouts when
 doing device enumeration on certail devices. Most devices work fine, but
 I have a couple who times out when asking for string descriptors, and
 now one device that times out on SET_ADDRESS. I was able to get the
 devices that times out on string descriptors to work by disabling some
 code in drivers/usb/core/hub.c
 
 I welcome any ideas and pointers towards fixing this issue. What
 information can I provide to help solve this? 
 
 Btw, the device works perfectly on my desktop computer.
 
 One weird coincidence is that all the devices where asking for string
 descriptors results in timeouts are devices using the MTP protocol (some
 of the support normal USB-storage as well).  The device that times out
 on SET_ADDRESS is a Muvid MP-521.

If you can build kernels with CONFIG_USB_DEBUG set on both the board
and the desktop computer, then there might be some useful information
in the dmesg logs of the two machines.  It would at least be 
interesting to compare them.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-09 Thread Alan Stern
On Mon, 8 Oct 2007, David Miller wrote:

 As coicidence would have it I finally found a recipe for triggering
 the issue, and it ties into what you're talking about here.
 
 It happens only if I make sure OHCI gets loaded first and then EHCI
 right afterwards.
 
 It seems that indeed it is important for EHCI to get loaded first,
 and in-kernel this is ensured by the link ordering.
 
 However, when both OHCI and EHCI are built as modules (or, similarly
 I guess, OHCI is built-in and EHCI is modular) there appears to be
 nothing in userspace which makes sure EHCI gets loaded first.
 
 When this triggers, in OHCI's root_port_reset(), the port status
 register reads 0x111 in that inner-loop and the value never changes.
 It stays like this forever.

I agree with Ben; the best way to solve this is in the kernel.  Even if 
you did manage to make sure that modules were loaded in the right order 
initially, that wouldn't help if somebody starts unloading and loading 
modules by hand.

The underlying cause of the problem appears to be related to the fact
that it is impossible in principle to detect a disconnect while a
full/low-speed reset is in progress.  However the hardware shouldn't
rely on this, and it should fail gracefully when an unexpected
disconnect does occur.

For example, what would the controller do if the user unplugged the USB 
cable right in the middle of a reset?

Anyway, it certainly would be easy enough to make port resets mutually
exclusive with EHCI initialization.  That would work on any platform,
PCI or not.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

2007-10-09 Thread Alan Stern
On Tue, 9 Oct 2007, Greg KH wrote:

  Anyway, it certainly would be easy enough to make port resets mutually
  exclusive with EHCI initialization.  That would work on any platform,
  PCI or not.
 
 That's a good idea, any thoughts as to how to do this?  I think I can
 find some Intel and Dell people who would be glad to test this out if
 you have a proposed patch.

Here is a proposed patch.  I haven't tried running it, but it compiles 
okay.

Alan Stern



Index: usb-2.6/drivers/usb/core/hcd.h
===
--- usb-2.6.orig/drivers/usb/core/hcd.h
+++ usb-2.6/drivers/usb/core/hcd.h
@@ -19,6 +19,8 @@
 
 #ifdef __KERNEL__
 
+#include linux/rwsem.h
+
 /* This file contains declarations of usbcore internals that are mostly
  * used or exposed by Host Controller Drivers.
  */
@@ -470,5 +472,9 @@ static inline void usbmon_urb_complete(s
: (in_interrupt () ? in_interrupt : can sleep))
 
 
-#endif /* __KERNEL__ */
+/* Mutual exclusion for EHCI CF initialization.  This interferes with
+ * port reset on some companion controllers.
+ */
+extern struct rw_semaphore ehci_cf_port_reset_rwsem;
 
+#endif /* __KERNEL__ */
Index: usb-2.6/drivers/usb/core/hub.c
===
--- usb-2.6.orig/drivers/usb/core/hub.c
+++ usb-2.6/drivers/usb/core/hub.c
@@ -125,6 +125,12 @@ MODULE_PARM_DESC(use_both_schemes,
try the other device initialization scheme if the 
first one fails);
 
+/* Mutual exclusion for EHCI CF initialization.  This interferes with
+ * port reset on some companion controllers.
+ */
+DECLARE_RWSEM(ehci_cf_port_reset_rwsem);
+EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
+
 
 static inline char *portspeed(int portstatus)
 {
@@ -1579,6 +1585,8 @@ static int hub_port_reset(struct usb_hub
 {
int i, status;
 
+   down_read(ehci_cf_port_reset_rwsem);
+
/* Reset the port */
for (i = 0; i  PORT_RESET_TRIES; i++) {
status = set_port_feature(hub-hdev,
@@ -1610,7 +1618,7 @@ static int hub_port_reset(struct usb_hub
usb_set_device_state(udev, status
? USB_STATE_NOTATTACHED
: USB_STATE_DEFAULT);
-   return status;
+   goto done;
}
 
dev_dbg (hub-intfdev,
@@ -1623,6 +1631,8 @@ static int hub_port_reset(struct usb_hub
Cannot enable port %i.  Maybe the USB cable is bad?\n,
port1);
 
+ done:
+   up_read(ehci_cf_port_reset_rwsem);
return status;
 }
 
Index: usb-2.6/drivers/usb/host/ehci-hcd.c
===
--- usb-2.6.orig/drivers/usb/host/ehci-hcd.c
+++ usb-2.6/drivers/usb/host/ehci-hcd.c
@@ -646,9 +646,11 @@ static int ehci_run (struct usb_hcd *hcd
 * involved with the root hub.  (Except where one is integrated,
 * and there's no companion controller unless maybe for USB OTG.)
 */
+   down_write(ehci_cf_port_reset_rwsem);
hcd-state = HC_STATE_RUNNING;
ehci_writel(ehci, FLAG_CF, ehci-regs-configured_flag);
ehci_readl(ehci, ehci-regs-command); /* unblock posted writes */
+   up_write(ehci_cf_port_reset_rwsem);
 
temp = HC_VERSION(ehci_readl(ehci, ehci-caps-hc_capbase));
ehci_info (ehci,


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Razer Krait USB mouse disconnect weirdness

2007-10-06 Thread Alan Stern
On Sat, 6 Oct 2007, Jonas Nicolaisen wrote:

 Here's a very strange thing. The Razer mouse works on this same machine
 when I use an old Knoppix CD, kernel 2.4.20. Correctly detected, no
 error messages, no b0rkage.
 
 I'm puzzled.
 
 It looks as if it's using driver usb_mouse instead of usbhid.
 
 I won't go back to kernel 2.4 though :-/
 
 So it looks like the mouse is working (it also works on another Linux
 machine I tested it on, kernel 2.6.16 and an UHCI hub there.)

If you try 2.6.16 on your regular machine, does the mouse work?

 It's not the cable. And apparently it's not the USB hub either, since
 the Knoppix live system can cope with this mouse/hub combo just fine.
 
 Going back to Gentoo with kernel 2.6.22.9, same status -84 messages in
 syslog again.
 
 Should I try something like kernel 2.6.7?

I don't see any point in that.

 Can it be that it's a hotplug issue?

I doubt it very much.  Hotplug problems tend to cause the driver not to 
be loaded at all.  That's not what you're seeing.

 After the knoppix experiment, I'm really puzzled. Nothing in any of the
 logs there. Mouse just working (TM).
 
 
  
  It could be.  Unlikely but possible.  You could try putting a powered 
  hub between the computer and the mouse.
  
 
 I might try that anyway, but it looks as if that's not the problem...
 
 Any hope to really fix this?

It's a hardware problem.  Probably the easiest way to fix it is to 
replace the mouse.

 
 Hm, after the Knoppix experiment I'm not really sure anymore if it's a
 hardware problem. It looks more like something changed in the newer USB
 or HID drivers that made this hardware _stop_ working.

It's possible that the older kernels _were_ getting the same errors, 
but they simply ignored them.  Careful error handling was added to 
usbhid only fairly recently.

 Could usbmon help?

It could.  Certainly it's worth a try.  Use it with both the 
non-working 2.6.22 kernel and the working 2.6.16 (or whatever) kernel.

  In theory it could be either one -- or even a weird incompatibility 
  where each is off by just a little bit, so they can work with other 
  devices but not with each other.
  
 
 The knoppix experiment looks like they _can_ work with each other.
 
 dmesg from knoppix attached. Need more info?

There's no useful information in the Knoppix dmesg.

However it might be useful for you to build 2.6.22 with 
CONFIG_USB_DEBUG enabled and post the dmesg from that, with all the 
errors.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] connect a USB drive - nothing works!

2007-10-06 Thread Alan Stern
On Sat, 6 Oct 2007, Bernie Kelly wrote:

 Can't get my Linux desktop (kubuntu feisty fawn 7.04) to connect to an 
 external  USB drive.  Tried everything.  Drive is a Tsaihong 2508 USB2 
 storage device (40Gb) and works perfectly in Windows XP.  Willing to 
 convert to FAT 32 filesystem (it's now NTFS) but XP won't let me convert 
 NTFS and Linux can't read the device so Linux converters won't work.  
 Trolled through all the forums and tried everything, nothing works.
 
 Here's the dmesg I get when I try to connect it.  Any ideas?

If you build a kernel with CONFIG_USB_STORAGE_DEBUG enabled, the dmesg
log will contain lots of extra useful debugging information.  It should 
indicate where the problem is.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Problem with disconnecting usb-device (terratec cinergy T2)

2007-10-05 Thread Alan Stern
On Fri, 5 Oct 2007, Tomi Orava wrote:

 Hi,
 
 I've been trying to merge an already existing driver for Terratec Cinergy
 T2 digi-tv into newer DVB-USB framework (ie. get the cinergy driver to
 be compliant with the rest of the usb digi-tuners).
 
 However, I seem to have a problem with this modified driver as the device
 gets disconnected from the usb-bus sooner or later (after 10-48h of
 operation). Until the disconnection the driver  device seem to be working
 just fine. In order to figure out what is the actual problem in
 communication I retrieved the following usbmon debug log, but I have
 problems in understanding it. Anybody care to help a little bit ?

You won't be able to figure it out because it isn't a problem in
communication; the problem is that the device really is disconnecting.  
This could be caused by a flaky USB cable connection or an inadequate
USB power supply on the motherboard.

Still, to help you understand the usbmon log: Each of the lines 
containing S Bi:5:003:2 -115 512 indicates a bulk-IN URB being 
submitted by your driver, and each of the lines containing
C Bi:5:003:2 0 512 indicates a successful URB completion (together
with the first 32 bytes of data received).  The other lines at the end 
of the log show what the system does when the disconnect occurs.

Alan Stern



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Razer Krait USB mouse disconnect weirdness

2007-10-05 Thread Alan Stern
On Fri, 5 Oct 2007, Jonas Nicolaisen wrote:

 Hello.
 
 I recently got a new Razer Krait 1600 dpi three-button mouse.
 
 Problem: Mouse stops responding after seconds of use with this message:
 
 ohci_hcd :00:0b.0: urb c11300c0 path 1 ep1in 1e16 cc 1 --
 status -84
 
 With kernel 2.6.16, that was followed by an unlink error message and
 the mouse just froze. Movement and buttons were no longer detected but
 the LEDs still got power. USB unplug-replug would fix it for a few
 seconds, then the same behaviour. Only happens when actually moving or
 clicking.
 
 With kernel 2.6.22.9 from kernel.org without patches it was exactly the
 same until I enabled USB selective suspend/resume and wakeup in the
 kernel. After doing so, the above error message (status -84) is getting
 spammed several times a second to syslog but the kernel seems to ignore
 it now so the mouse works. Or at least it seems to work unless you
 look at syslog...
 
 The mouse is connected directly to the laptop's only USB port.
 
 A Logitech MX518 10 button 1600 dpi mouse is working flawlessly, as well
 as a small laptop mouse.
 
 What does the status -84 mean?

It means there was a low-level USB communications error.  Maybe the 
cable connection isn't firm, or maybe the mouse just stops working 
every few seconds.

 Any hope to really fix this?

It's a hardware problem.  Probably the easiest way to fix it is to 
replace the mouse.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Razer Krait USB mouse disconnect weirdness

2007-10-05 Thread Alan Stern
On Fri, 5 Oct 2007, Jonas Nicolaisen wrote:

 On Fri, Oct 05, 2007 at 02:56:40PM -0400, Alan Stern wrote:
   What does the status -84 mean?
  
  It means there was a low-level USB communications error.  Maybe the 
  cable connection isn't firm, or maybe the mouse just stops working 
  every few seconds.
  
 
 Wow. That's heavy. These mice are sold at a relatively high price to a
 target audience of professional gamers. The mouse was new from the
 factory. Wouldn't you think they had some kind of QC?
 
 When you look around the internet, lots of people are reporting
 unplug-replug style problems with Razer mice, especially the Diamondback
 which has the same sensor technology as the Krait. This problem
 apparently hasn't been fixed for years. But those mice are going at over
 40 euros. Target market is Windows gamers, of course.
 
 Razer does use very thin cables; it's part of their marketing blurb
 because it supposedly makes the mice better for gaming. Before I toss
 the mouse away, would it be worth it to replace the cable with the one
 from my cheap (working) laptop mouse? I can solder and the cable
 terminates at a simple connector plug on the mouse's board.

I really don't know.  It might more sense to try using that mouse on 
other computers first, to see if the errors still occur.  If they 
don't, maybe you can trade it to somebody.

 Can you say something about the possibility of this being a
 protocol/standards issue? i.e. is it possibly a firmware issue, or would
 a three-button mouse even have firmware?

The mouse definitely has firmware.  But this error code doesn't 
indicate a high-level protocol problem; it is very low-level.

 It's not connected to current draw or overcurrent protection, no?

It could be.  Unlikely but possible.  You could try putting a powered 
hub between the computer and the mouse.

   Any hope to really fix this?
  
  It's a hardware problem.  Probably the easiest way to fix it is to 
  replace the mouse.
  
 
 Hardware problem on the side of the USB hub or the mouse?

In theory it could be either one -- or even a weird incompatibility 
where each is off by just a little bit, so they can work with other 
devices but not with each other.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Error Nikon Camera

2007-10-04 Thread Alan Stern
On Thu, 4 Oct 2007, Paul Check wrote:

 On Tuesday 02 October 2007 14:47:55 you wrote:
  On Tue, 2 Oct 2007, Paul Check wrote:
If you run fdisk -l /dev/sdh before trying to mount the camera, what
is the output?
  
   The device doesn't exist before the camera is plugged in, thanks to udev.
   So, the output is nothing.
 
  That's what you get if you run fdisk before the camera is plugged in.
  But what do you get if you run fdisk after the camera is plugged in and
  before you try to mount it?
 
 Interestingly enough, the output is still nothing, even though the 
 devices /dev/sdh and /dev/sdh1 are created.
 
What shows up in the dmesg log after you plug in the camera and try
to mount it?
 
 The output seems to be longer than dmesg gets, so here is my 
 edited /var/log/messages file with the relevant sections:

Okay, the log is clear enough.  The camera tells the computer that it 
has 16007041 sectors, and an unrecoverable error occurs when the 
computer tries to read sector 16007040.  Evidently the camera really 
has one less sector than it claims.  This is a very common bug.

A blacklist entry should fix the problem.  To create I will need to see 
the contents of /proc/bus/usb/devices with the camera plugged in.  
Alternatively, the same information is present in the output from 
lsusb -v.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Error Nikon Camera

2007-10-04 Thread Alan Stern
On Thu, 4 Oct 2007, Paul Check wrote:

 Ok, I'll just cut and paste it below (I take it you just want the Nikon 
 section, which in this case is the second block, but I'll paste the whole 
 thing.  Where does your blacklist entry go: in or out of kernel? Or, more 
 generally, how will the change get propagated to me?

It is in the form of a patch, below; you must apply it to your kernel
source and rebuild.  Note: The patch was made for 2.6.22; it might or
might not apply smoothly to slightly different kernel versions.

 I had seen you discussing a similar error with someone else (I believe it was 
 Alan Cox w a D70), so I figured it was a similar problem. The D2Xs is not 
 such a common camera, so not surprising it didn't come up before. But why 
 would this happen now? It was working earlier with the same kernel version 
 [2.6.22]. Is there something outside of the kernel that changed? Or did I 
 pick up some small kernel change?

Most likely you changed some other part of the kernel configuration, 
something which caused the kernel to try to read the last sector.

Let us know if the patch fixes your problem.

Alan Stern



Index: 2.6.22/drivers/usb/storage/unusual_devs.h
===
--- 2.6.22.orig/drivers/usb/storage/unusual_devs.h
+++ 2.6.22/drivers/usb/storage/unusual_devs.h
@@ -334,6 +334,13 @@ UNUSUAL_DEV(  0x04b0, 0x0411, 0x0100, 0x
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_CAPACITY),
 
+/* Reported by Paul Check [EMAIL PROTECTED] */
+UNUSUAL_DEV(  0x04b0, 0x0415, 0x0100, 0x0100,
+   NIKON,
+   NIKON DSC D2Xs,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_FIX_CAPACITY),
+
 /* BENQ DC5330
  * Reported by Manuel Fombuena [EMAIL PROTECTED] and
  * Frank Copeland [EMAIL PROTECTED] */


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] The problems of OHCI driver for Winbond W90N740.

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, Darwin Chen wrote:

 Dear Alan,
 
 If I add the following code to usb/host/ohci-hcd.c or define the flag
 OHCI_VERBOSE_DEBUG, then the usb subsystem will work and there are no
 errors. But it's very slowly. :(
 If the delay value is smaller than 350, system will hang up.
 So I think this problem is a timing problem, I don't know how to fix the
 problem. Could you give me some suggestions? 

Sorry, I'm out of ideas.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Error Nikon Camera

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, Dominique Dumont wrote:

 Alan Stern [EMAIL PROTECTED] writes:
 
  You may find it helps to turn off HAL before running your tests, 
  because HAL does constant probing of USB storage devices.
 
 Is this probing limited to storage devices or does it occur to any usb
 device ? (say a dvb-t device ;-) )

As far as I know, HAL probes only storage devices.  It does so because 
it is looking for media changes.

 If the latter, how can I trace this probing ? With usbmon or is there
 a simpler mechanism ?

You can always use usbmon.  For storage devices there is a simpler 
alternative: enable CONFIG_USB_STORAGE_DEBUG.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] random USB disconnect, 2.6.23-rcX

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, markus reichelt wrote:

   I've noticed a strange USB disconnect of an external HDD. There's
   several USB devices connected to this machine at all times,
   mostly hubs, but some directly connected HDD gets hit by this
   issue.

 But I tracked this annoying problem down anyway. It turned out it was
 solely hardware-related; I used the additional USB-port connectors on
 the motherboard (cable-slot) and these little buggers feature a
 pretty weak power supply. It's ok if a self-powered hub is connected
 to them, but if a device even demands 100 mA it borks (f.e. my old
 webcam). Chipset is nvidia (CK8S USB Controller).

Odd.  Any bus-powered device is allowed to draw up to 100 mA.  This 
sounds like a good chipset to avoid.

Thanks for telling us the solution.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] uhci vs ehci: 5 wakeups/s saved

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, Sarah Sharp wrote:

 On Wed, Oct 03, 2007 at 02:29:49PM +0100, Alan Jenkins wrote:
  My internet arrives via a USB 2.0 wireless adaptor.
  Using UHCI instead of EHCI saves ~5 wakeup/s:
  
  With ehci_hcd loaded (and not uhci_hcd):
31.1% ( 10.0) kernel core : ehci_work (ehci_watchdog)
30.4% (  9.8)   interrupt : ehci_hcd:usb5

Pardon me, but can somebody explain what those numbers mean?  Are they 
an average number of interrupts per second?

  With uhci_hcd loaded (and not ehci_hcd):
48.0% (  9.8)   interrupt : uhci_hcd:usb1
19.6% (  4.0)   kernel module : usb_hcd_poll_rh_status (rh_timer_func)
  
  Since ehci_hcd also disagrees with my MP3 player, I'm not sure I want 
  USB 2.0 any more ;-).  I may end up blacklisting the module.

Nobody is forcing you to use it.  :-)  Feel free to blacklist it if you
can get better performance without it.

 How does it disagree with your MP3 player?
 
  I was suprised, since I've read[1] and seem to remember verifying that 
  UHCI causes a constant 1000 wakeups/s, and that this was unavoidable 
  given the UHCI specification.

The blogger in [1] is completely wrong.  UHCI does not cause a constant
1000 interrupts per second.

   I'm running a 2.6.23-rc9-hrt1 kernel 
  (-rc8-hrt1 patch applied cleanly to -rc9).
  
  Is this expected?

It's hard to be precise.  Here's a partial analysis:

The interrupts for each driver fall into two categories.  With uhci-hcd
they are labelled in your listing as usb_hcd_poll_rh_status and
uhci_hcd; with ehci-hcd they are labelled as ehci_watchdog and
ehci_hcd.

Now in general you should expect the total uhci_hcd and ehci_hcd
numbers (not necessarily the averages!) to be roughly equal.  The
uhci_hcd number might be somewhat higher.  The poll_rh_status
interrupts will occur at a steady 4/second.  The ehci_watchdog value is
harder to pin down.  Bear in mind, however, that during the time when
those interrupts arrive, the EHCI controller is performing DMA, which
will prevent the CPU from entering a deep sleep state in any case.  
(In fact, one of the purposes of the ehci_watchdog interrupt is to tell
the driver that it can turn off DMA.)

One other thing: EHCI transfers data 40 times faster than UHCI.  All
else being equal, you would be justified in expecting it to generate 40
times as many interrupts per second.  The fact that it doesn't
indicates something -- perhaps that the real bottleneck isn't in these 
controllers at all but somewhere else in the system.

  Could it be USB autosuspend at work?  I've checked and echo -1  
  /sys/module/usbcoreparamters/autosuspend doesn't change the number of 
  wake-ups, but perhaps I'm missing something.
 
 It's unlikely that your USB wireless adaptor is being autosuspended.  I
 don't think there's any kernel support for wireless adaptors.  There is
 autosuspend support for USB to ethernet adaptors that run under the
 kaweth driver.  Without kernel support, the device won't autosuspend.

Right.

  I notice that the number of interrupts is actually the same.   The 
  difference is in the kernel polling routines - ehci_work vs 
  usb_hcd_poll_rh_status.  Does ehci need to poll twice as often, or might 
  it be possible to tune or hack the polling interval?

ehci doesn't poll at all under normal circumstances, but it does use a
timer to disable the async schedule.  As I mentioned above, uhci polls
at 4/second.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] uhci vs ehci: 5 wakeups/s saved

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, Alan Jenkins wrote:

  One other thing: EHCI transfers data 40 times faster than UHCI.  All
  else being equal, you would be justified in expecting it to generate 40
  times as many interrupts per second.  The fact that it doesn't
  indicates something -- perhaps that the real bottleneck isn't in these 
  controllers at all but somewhere else in the system.

 This is on an idle system (for desktop linux values of idle).  I'm not 
 transferring data at maximum bus speed; in fact I'm not doing anything 
 as a user that requires network access.  So I wasn't particularly 
 expecting more interrupts on ehci.

Even though you're not doing anything that requires network access, as 
long as the network interface is enabled it needs to respond to 
incoming or broadcast packets.  The adapter driver may even poll the 
USB device; I don't know how it works.

  ehci doesn't poll at all under normal circumstances, but it does use a
  timer to disable the async schedule.  As I mentioned above, uhci polls
  at 4/second.
 
  Alan Stern
 So if I want to find out why ehci causes more wakeups on an idle system 
 than uhci, I need to break down the ehci_watchdog timer into its 
 component uses.

Yes.  Probably the important one for you is the async-schedule-disable 
timeout.  It will fire some milliseconds after all bulk and control 
transfers are complete, telling ehci-hcd that it can turn off the async 
schedule.

 Um.  So the ehci hardware is generating 10 interrupts a second on my 
 idle desktop.

Remember, even though your desktop is idle, that doesn't mean the 
network is idle.

  Each ehci interrupt is associated with DMA activity.  The 
 driver sets timeouts to check whether DMA has finished and can be 
 disabled.  Assuming that DMA activity happens at regular intervals, it 
 wouldn't make sense for the DMA activity _timeouts_ to happen any less 
 frequently.  So I also get 10 timeouts per second to go with the 10 
 interrupts.  That accounts for the wakeups I'm seeing on powertop. 

That sounds about right.

 So that's it then.  autosuspend isn't supported for my device yet.  I 
 assume theres no way I could get the ehci hardware interrupts lower than 
 10 Hz in this case, and that it doesn't make sense to try and avoid the 
 watchdog timeout.

Try doing an ifconfig down on the network interface and see what 
happens.  Or since you say everything is idle and you aren't using the 
network anyway, simply unplug the wireless adapter.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] uhci vs ehci: 5 wakeups/s saved

2007-10-03 Thread Alan Stern
On Wed, 3 Oct 2007, Alan Jenkins wrote:

 So if I want to find out why ehci causes more wakeups on an idle system 
 than uhci, I need to break down the ehci_watchdog timer into its 
 component uses.

One other thing I forgot to mention.  As you know, ehci-hcd's extra
interrupts tell the driver it can disable DMA.  But uhci-hcd never
disables DMA as long as any active devices are plugged into the
controller.  The hardware doesn't permit it.  So even though uhci-hcd's
overall interrupt count may be lower, it forces the CPU to stay out of
the deep sleep states that ehci-hcd allows for.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Error Nikon Camera

2007-10-02 Thread Alan Stern
On Mon, 1 Oct 2007, Paul Check wrote:

 I should have added: when the camera is in mass storage mode I *am* able to 
 see the camera with sg_scan -i:
 
 /dev/sg9: scsi20 channel=0 id=0 lun=0 [em]
 NIKON D2Xs  1.00 [rmb=1 cmdq=0 pqual=0 pdev=0x0]
 
 even though it won't mount.  --Paul

If you run fdisk -l /dev/sdh before trying to mount the camera, what 
is the output?

What shows up in the dmesg log after you plug in the camera and try 
to mount it?

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB Error Nikon Camera

2007-10-02 Thread Alan Stern
On Tue, 2 Oct 2007, Paul Check wrote:

  If you run fdisk -l /dev/sdh before trying to mount the camera, what
  is the output?
 
 The device doesn't exist before the camera is plugged in, thanks to udev. So, 
 the output is nothing.

That's what you get if you run fdisk before the camera is plugged in.  
But what do you get if you run fdisk after the camera is plugged in and 
before you try to mount it?

  What shows up in the dmesg log after you plug in the camera and try
  to mount it?
 
 There is a lot of output (because I have verbose debugging enabled in the 
 kernel?). I've attached the end of the dmesg output below.

The end doesn't say very much.  Please attach the entire thing.

You may find it helps to turn off HAL before running your tests, 
because HAL does constant probing of USB storage devices.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Fwd: Composite USB devices

2007-10-01 Thread Alan Stern
On Sun, 30 Sep 2007, The Almighty Pegasus Epsilon wrote:

 On 9/30/07, Alan Stern [EMAIL PROTECTED] wrote:
  Strictly speaking, character and block are properties of the
  driver, not of the device.  It's perfectly possible to have both a
  character driver and a block driver for the same device (although they
  better not both be loaded at the same time!).
 
  Anyway, only SCSI devices get sg nodes; HID devices don't.  In thie
  case sg0 refers to the mass-storage interface of the WD MyBook device,
  not the HID interface.  (The HID interface corresponds to the
  /class/input/input1 device, as you can see in the log.)  sg1 refers to
  the other, working USB device.  But this isn't particularly helpful for
  solving your main problem.
 
 I was under the impression that sg meant SCSI generic, ie, any kind of
 device you'd like to hook to a SCSI bus.

That's right.

 For example, I'm pretty sure
 there are SCSI keyboards, which would absolutely be a character device
 by nature, not just by driver.

True.  Although if somebody wanted to, they _could_ write a block
device driver for a keyboard.  It wouldn't be very useful.

  But only the other device worked with the SCSI disk driver.  It's
  undoubtedly because the other device (sg1) reports itself as type 0 =
  disk drive and the WD device (sg0) reports itself as type 13 =
  enclosure -- I don't know what that's supposed to mean.  Whatever it
  is, the SCSI disk driver doesn't accept it.
 
  Now I don't know if this will work or if it's the right thing to do,
  but you can try it.  Edit the kernel source file drivers/scsi/sd.c.
  Near the beginning is a line saying
 
  MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);
 
  You can add a line saying
 
  MODULE_ALIAS_SCSI_DEVICE(TYPE_ENCLOSURE);
 
  Also, at the start of the sd_probe() function is this line:
 
  if (sdp-type != TYPE_DISK  sdp-type != TYPE_MOD  sdp-type != 
  TYPE_RBC)
 
  You should add into that an extra test:
 
  if (sdp-type != TYPE_DISK  sdp-type != TYPE_MOD  sdp-type != 
  TYPE_RBC
   sdp-type != TYPE_ENCLOSURE)
 
  That will allow the SCSI disk driver to recognize the WD device.
  Whether it will end up working correctly is a different question...
 
  Alan Stern
 
 An interesting idea, for the hell of it I tried it. It did not work,
 it simply created a block device node that cat /dev/sda (yes, it
 usurped the old sda, which is now sdb) gives no output for. Correct me
 if I'm wrong, but if it were working, it should dump a terabyte of
 random gibberish to my screen.

Yes.  Well maybe not random gibberish, but the idea is right.

 If you check the output from /proc/bus/usb/devices, it very clearly
 shows 1) the hub, 2) the external enclosure that works, and 3) the one
 that doesn't, but the one that doesn't work has two I lines, while
 everything else has only one:
 
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
 
 I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
 I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
 
 I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
 
 the Sub=00 Prot=00 Driver=usbhid gets registered fine, and with the
 patch, it makes a corresponding (but non-functional) block node to go
 with it. but the Sub=06 Prot=50 Driver=usb-storage never makes it
 through to my /dev and that's exactly the problem.

No, you are confused.  First, you have this hangup regarding the extra
HID interface.  The fact is, it doesn't affect the mass-storage aspect
of the device at all.  The two are quite independent.

Second, the non-functional block node you saw with the patch
corresponds to interface 0, the enclosure driven by usb-storage --
not to the HID interface.  This probably would be easy to see from
the dmesg log, but you failed to include it.

 I think what's missing is another layer of abstraction. Are other
 Enclosures properly handled by linux-usb (as opposed to the obviously
 functional Direct-Access)?

Enclosure is a SCSI concept; it has nothing to do with usb-storage.  
The plain truth is that usb-storage is working fine; the difficulty you 
are encountering lies in the SCSI stack, not in the USB stack.

 Possibly of interest is the result of the patch you suggested:
 
 sd 0:0:0:0: [sda] READ CAPACITY failed
 sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
 sd 0:0:0:0: [sda] Sense Key : 0x5 [current]
 sd 0:0:0:0: [sda] ASC=0x20 ASCQ=0x0
 sd 0:0:0:0: [sda] Test WP failed, assume Write Enabled
 sd 0:0:0:0: [sda] Asking for cache data failed
 sd 0:0:0:0: [sda] Assuming drive cache: write through
 sd 0:0:0:0: [sda] Attached SCSI disk
 
 The old drive works the same, as far as I can tell, but other than it
 being moved down to sdb:
 
 sd 1:0:0:0: [sdb] 156301488 512-byte hardware sectors (80026 MB)
 sd 1:0:0:0: [sdb] Write Protect is off
 sd 1:0:0:0: [sdb] Mode Sense: 27 00 00 00
 sd 1:0:0:0: [sdb] Assuming drive cache: write through
 sd 1:0:0:0: [sdb

Re: [Linux-usb-users] The problems of OHCI driver for Winbond W90N740.

2007-10-01 Thread Alan Stern
On Tue, 2 Oct 2007, Darwin Chen wrote:

 Hello,
 I'm porting uClinux for W90N740, the kernel is booted successful, but the USB 
 Host has some problems. After the kernel is booted, I plug in a USB Card 
 reader, the kernel outputs the following messages, I don't understand the 
 messages, :(
 The attachment is the HCD source code for W90N740. 
 $ cat /proc/kmsg 

 7usb-storage: Command READ_CAPACITY (10 bytes)
 7usb-storage:  25 00 00 00 00 00 00 00 00 00
 7usb-storage: Bulk Command S 0x43425355 T 0x5 L 8 F 128 Trg 0 LUN 0 CL 10
 7usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
 7drivers/usb/host/ohci-dbg.c: SUB 00336738 dev=2 ep=1out-bulk flags=c 
 len=0/31 stat=-115
 7drivers/usb/host/ohci-dbg.c: data(0/31): 55 53 42 43 05 00 00 00 08 00 00 
 00 80 00 0a 25... stat:-115
 7drivers/usb/host/ohci-dbg.c: RET 00336738 dev=2 ep=1out-bulk flags=c 
 len=31/31 stat=0
 7usb-storage: Status code 0; transferred 31/31
 7usb-storage: -- transfer complete
 7usb-storage: Bulk command transfer result=0
 7usb-storage: usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries
 7drivers/usb/host/ohci-dbg.c: SUB 0032cdb8 dev=2 ep=2in-bulk flags=5 
 len=0/8 stat=-115
 7drivers/usb/host/ohci-dbg.c: RET 0032cdb8 dev=2 ep=2in-bulk flags=5 
 len=8/8 stat=0
 7drivers/usb/host/ohci-dbg.c: data(8/8): 00 01 f5 ff 00 00 02 00 stat:0
 7usb-storage: Status code 0; transferred 8/8
 7usb-storage: -- transfer complete
 7usb-storage: Bulk data transfer result 0x0
 7usb-storage: Attempting to get CSW...
 7usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
 7drivers/usb/host/ohci-dbg.c: SUB 00336738 dev=2 ep=2in-bulk flags=c 
 len=0/13 stat=-115
 
 $ 7usb-storage: command_abort called
 7usb-storage: usb_stor_stop_transport called
 7usb-storage: -- cancelling URB
 7drivers/usb/host/ohci-dbg.c: UNLINK 00336738 dev=2 ep=2in-bulk flags=c 
 len=0/13 stat=-104
 
 There is nothing in /proc/bus/usb!
 
 What should I do?

First, make sure /proc/bus/usb is mounted:

mount -t usbfs none /proc/bus/usb

Second, try plugging the card reader into a regular Linux system to
make sure it is okay.

Third, try plugging a different USB device (like a flash memory) into 
your machine, instead of the card reader.

The error message means that Linux didn't receive a status reply from 
the card reader after sending it a READ CAPACITY command.  Either the 
card reader didn't send a status reply or else the host controller 
driver didn't detect the reply.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Composite USB devices

2007-09-30 Thread Alan Stern
On Sun, 30 Sep 2007, The Almighty Pegasus Epsilon wrote:

 I've got a 1TB Western Digital USB drive, and when I connect it to my
 linux machine, it shows it as both an HID device and a mass storage
 device, but udev only generates the sg device node of the HID, and I
 consequently can't seem to access the mass storage part, which is the
 only part I actually care about.
 
 First, I'm not even sure if this is a kernel/USB driver issue, or a
 udev issue, or a user issue, but if it's a udev issue, I ought to be
 able to just run mknod with the right magic numbers and have it work,
 but either i'm massively misunderstanding the enumeration of such
 things, or even that doesn't work.
 
 In any case, I've gone so far as reading everything from google
 results, to deciphering a good half of /proc/bus/usb/devices, to even
 skimming kernel code, and either composite device support is still
 being hammered out, or i need gadget support in there, or I'm
 completely overlooking something.
 
 So the questions: Am I overlooking something? Do you need more
 information (lsusb -v perhaps) to sort this out,

more information?!  You have provided hardly any, beyond the fact 
that it doesn't work!

 or do I actually need
 to get to patching the kernel, or installing a development/release
 candidate kernel, or should I just take this thing back to best buy? I
 kinda need the space, as you can probably guess, as I paid for it, and
 would seriously appreciate a quick fix, if one exists.

The output from dmesg would help, and so would the contents of
/proc/bus/usb/devices.  It also wouldn't hurt if you mentioned which
version of the Linux kernel you are using.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Fwd: Composite USB devices

2007-09-30 Thread Alan Stern
On Sun, 30 Sep 2007, The Almighty Pegasus Epsilon wrote:

 sg1 is a character device, not a block device. sg1 is the HID device
 in the composite device, where I need the mass storage device, which
 is a block device.

Strictly speaking, character and block are properties of the 
driver, not of the device.  It's perfectly possible to have both a 
character driver and a block driver for the same device (although they 
better not both be loaded at the same time!).

Anyway, only SCSI devices get sg nodes; HID devices don't.  In thie
case sg0 refers to the mass-storage interface of the WD MyBook device,
not the HID interface.  (The HID interface corresponds to the
/class/input/input1 device, as you can see in the log.)  sg1 refers to
the other, working USB device.  But this isn't particularly helpful for
solving your main problem.

 On Sun, 30 Sep 2007, The Almighty Pegasus Epsilon wrote:
 
  On 9/30/07, Alan Stern [EMAIL PROTECTED] wrote:
  more information?!  You have provided hardly any, beyond the fact
  that it doesn't work!
 
  I'll have to disagree, I provided a rather verbose description of the
  problem in plain english rather than technical babble, along with a
  theory or two as to why it doesn't work, and how it might be fixed.

It's not worth arguing over.

  input: Western Digital My Book as /class/input/input1
  input: USB HID v1.11 Device [Western Digital My Book] on usb-:00:07.2-1
  usbcore: registered new interface driver usbhid
  drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

That's the HID interface in the composite WD MyBook device.

  Initializing USB Mass Storage driver...
  scsi0 : SCSI emulation for USB Mass Storage devices
  usb-storage: device found at 2
  usb-storage: waiting for device to settle before scanning
  scsi1 : SCSI emulation for USB Mass Storage devices
  usbcore: registered new interface driver usb-storage
  USB Mass Storage support registered.
  usb-storage: device found at 3
  usb-storage: waiting for device to settle before scanning
  scsi 0:0:0:0: Enclosure WD   My Book Device   104a PQ: 0 ANSI: 4
  scsi 1:0:0:0: Direct-Access WDC WD80 0BB-40BSA0    PQ: 0 ANSI: 0

So both devices were registered with the SCSI core, as they would have 
to be in order for both sg0 and sg1 to appear.

  usb-storage: device scan complete
  usb-storage: device scan complete
  sd 1:0:0:0: [sda] 156301488 512-byte hardware sectors (80026 MB)
  scsi 0:0:0:0: Attached scsi generic sg0 type 13
  sd 1:0:0:0: Attached scsi generic sg1 type 0
  sd 1:0:0:0: [sda] Write Protect is off
  sd 1:0:0:0: [sda] Mode Sense: 27 00 00 00
  sd 1:0:0:0: [sda] Assuming drive cache: write through
  sd 1:0:0:0: [sda] 156301488 512-byte hardware sectors (80026 MB)
  sd 1:0:0:0: [sda] Write Protect is off
  sd 1:0:0:0: [sda] Mode Sense: 27 00 00 00
  sd 1:0:0:0: [sda] Assuming drive cache: write through
  sda: unknown partition table
  sd 1:0:0:0: [sda] Attached SCSI disk

But only the other device worked with the SCSI disk driver.  It's
undoubtedly because the other device (sg1) reports itself as type 0 =
disk drive and the WD device (sg0) reports itself as type 13 =
enclosure -- I don't know what that's supposed to mean.  Whatever it 
is, the SCSI disk driver doesn't accept it.

Now I don't know if this will work or if it's the right thing to do,
but you can try it.  Edit the kernel source file drivers/scsi/sd.c.  
Near the beginning is a line saying

MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);

You can add a line saying

MODULE_ALIAS_SCSI_DEVICE(TYPE_ENCLOSURE);

Also, at the start of the sd_probe() function is this line:

if (sdp-type != TYPE_DISK  sdp-type != TYPE_MOD  sdp-type != 
TYPE_RBC)

You should add into that an extra test:

if (sdp-type != TYPE_DISK  sdp-type != TYPE_MOD  sdp-type != 
TYPE_RBC
 sdp-type != TYPE_ENCLOSURE)

That will allow the SCSI disk driver to recognize the WD device.  
Whether it will end up working correctly is a different question...

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Cowon iAudio D2: trouble recognizing size and partitions

2007-09-29 Thread Alan Stern
On Sat, 29 Sep 2007, Stefan Richter wrote:

 Hi list,
 
 I've got the mentioned MP3 player with 4GB built-in flash memory and an
 SD/SDHC card slot.  The player worked under Linux with the shipped
 firmware, but in order to make its card slot SDHC compatible I installed
 their current firmware v2.50.  The USB mass storage driver of that
 firmware still seems to work on Windows (shows built-in flash and card
 slot as two separate drive letters), became a bit quirkier on OS X (is
 shown as invalid volume upon connection, is then quickly recognized as
 it should and can be accessed, immediately reinserts itself when it was
 ejected), but hardly works under Linux.
 
 With card slot empty:
...
 sd 71:0:0:0: [sdd] 1 512-byte hardware sectors (0 MB)
...
 Can't do much with that.

Indeed.  Without a card in the slot you can't do much with it, no
matter what shows up in the log.

(It might be worth mentioning that the firmware's behavior in this case 
was not correct.  It should have returned an error code indicating no 
card was present, instead of pretending there was a 0-MB card.)

 With an 8GB SDHC card inserted:
 
 usb 1-8: new high speed USB device using ehci_hcd and address 24
 usb 1-8: configuration #1 chosen from 1 choice
 scsi72 : SCSI emulation for USB Mass Storage devices
 usb-storage: device found at 24
 usb-storage: waiting for device to settle before scanning
 scsi 72:0:0:0: Direct-Access COWOND2   0100 PQ: 0
 ANSI: 0
 sd 72:0:0:0: [sdd] 15728160 512-byte hardware sectors (8053 MB)
 sd 72:0:0:0: [sdd] Write Protect is off
 sd 72:0:0:0: [sdd] Mode Sense: 37 00 00 08
 sd 72:0:0:0: [sdd] Assuming drive cache: write through
 sd 72:0:0:0: [sdd] 15728160 512-byte hardware sectors (8053 MB)
 sd 72:0:0:0: [sdd] Write Protect is off
 sd 72:0:0:0: [sdd] Mode Sense: 37 00 00 08
 sd 72:0:0:0: [sdd] Assuming drive cache: write through
  sdd: sdd1
  sdd: p1 exceeds device capacity
 sd 72:0:0:0: [sdd] Attached SCSI removable disk
 sd 72:0:0:0: Attached scsi generic sg4 type 0
 usb-storage: device scan complete
 attempt to access beyond end of device
 sdd: rw=0, want=15758216, limit=15728160
 Buffer I/O error on device sdd1, logical block 1968752
 [repeated]
 attempt to access beyond end of device
 sdd: rw=0, want=15758280, limit=15728160
 [repeated]
 
 Then I can at least access the SDHC card.

What makes you think there's a problem?  Evidently the partition table 
is goofy, but you can easily repartition the card.  It sure looks like 
everything is working correctly.

 $ ls /sys/bus/usb/devices/1-8*/
 /sys/bus/usb/devices/1-8/:
 1-8:1.0  bNumConfigurations  dev   maxchild   uevent
 bConfigurationValue  bNumInterfaces  devnumpower
 usb_endpoint
 bDeviceClass bcdDevice   driverproductversion
 bDeviceProtocol  bmAttributesep_00 quirks
 bDeviceSubClass  busnum  idProduct serial
 bMaxPacketSize0  configuration   idVendor  speed
 bMaxPowerdescriptors manufacturer  subsystem
 
 /sys/bus/usb/devices/1-8:1.0/:
 bAlternateSetting  bInterfaceProtocol  driver  ep_83 power
 usb_endpoint
 bInterfaceClassbInterfaceSubClass  ep_02   host72subsystem
 bInterfaceNumber   bNumEndpoints   ep_81   modalias  uevent

There's not much point in these directory listings.  The names of the 
files don't convey any useful information; what matters is their 
contents.

 The initial successful tests with the old firmware and what you see
 above is with Linux 2.6.23-rc6.
 
 Questions:
   - Are there usb-storage or scsi-mod workarounds which are good
 candidates to make it work?

As far as I can see, it's working already.

   - Is there a way to specify quirks to usb-storage at runtime?

No.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Cowon iAudio D2: trouble recognizing size and partitions

2007-09-29 Thread Alan Stern
On Sat, 29 Sep 2007, Stefan Richter wrote:

 Alan Stern wrote:
  On Sat, 29 Sep 2007, Stefan Richter wrote:
  I've got the mentioned MP3 player with 4GB built-in flash memory and an

Ah, the key point.  I missed it before, obviously.

 Before the firmware update, the D2 was accessible as 4GB storage device
 under Linux.  I couldn't test then with an additional card because I
 hadn't an SD card.  I even used Linux to upload the firmware update to
 the built-in flash.

The simplest way to find out what's going on is to rebuild the kernel 
with CONFIG_USB_STORAGE_DEBUG enabled.  Then the dmesg log for when you 
plug in the device will answer a lot of questions.  (BTW, it helps if 
you disable HAL while running the test.)

 BTW, Linux doesn't exhibit the access beyond end of device behaviour
 if I put the card in a regular USB SDHC card reader.  The reader reports
 the card sizes as 15,758,336 sectors, while the Cowon D2 states the card
 size as 15,728,160 sectors --- 30,176 sectors less.

It sounds like the Cowon firmware doesn't report card sizes correctly.

 $ cd /sys/bus/usb/devices/1-8\:1.0/
 $ echo ep*
 ep_02 ep_81 ep_83
 $ cat ep*/type
 Bulk
 Bulk
 Interrupt
 
 So there are two Bulk endpoints.  Does this matter?

That's what there should be: one for input and one for output.

 The SCSI host associated with device 1-8:1.0 contains one target and the
 target contains one logical unit.  I'd expect to get two logical units,
 perhaps two targets, perhaps two SCSI hosts.

The verbose debugging log will indicate what went wrong with the first
LUN.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] hotplugging on Fedora Core 6

2007-09-27 Thread Alan Stern
On Wed, 26 Sep 2007, Gergely Buday wrote:

 Alan Stern writes:
 
   Thanks. Everything seems to be fine with usb in dmesg, except this one:
  
   libusual: modprobe for usb-storage succeeded, but module is not present
  What happens if you simply do:
 
  modprobe usb-storage
 
 Wonder, it works. What has failed before? Should I edit some init scripts?

I don't know.  The hotplug system is supposed to load usb-storage 
automatically when you plug in your drive.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] hotplugging on Fedora Core 6

2007-09-26 Thread Alan Stern
On Wed, 26 Sep 2007, Gergely Buday wrote:

 Alan Stern writes:
 
   when I plug an usb mass storage device to my fc6 box, nothing happens.
   What information do you need to diagnose the problem? What log files
   should I investigate?
 
  The output from dmesg would be the most helpful.  Even better would be
  if you first rebuild the kernel with CONFIG_USB_DEBUG enabled.
 
 Thanks. Everything seems to be fine with usb in dmesg, except this one:
 
 libusual: modprobe for usb-storage succeeded, but module is not present
 
 A new kernel I need? I use the one shipped with fedora core 6.

What happens if you simply do:

modprobe usb-storage

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] hotplugging on Fedora Core 6

2007-09-24 Thread Alan Stern
On Mon, 24 Sep 2007, Gergely Buday wrote:

 Hi there,
 
 when I plug an usb mass storage device to my fc6 box, nothing happens.
 What information do you need to diagnose the problem? What log files
 should I investigate?

The output from dmesg would be the most helpful.  Even better would be 
if you first rebuild the kernel with CONFIG_USB_DEBUG enabled.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] random USB disconnect, 2.6.23-rcX

2007-09-21 Thread Alan Stern
On Fri, 21 Sep 2007, markus reichelt wrote:

 Hi list,
 
 I've noticed a strange USB disconnect of an external HDD. There's
 several USB devices connected to this machine at all times, mostly
 hubs, but some directly connected HDD gets hit by this issue. 
 
 It's reproducable under normal usage; tho I'm not sure what triggers
 it. It has happened both while accessing the HDD and during idle
 times. For what it matters, I replaced the HDD enclosure of a cypress
 chipset with a genesys logic one... doesn't matter. 
 
 2.6.23-rcX (this one is rc7)
 
 dmesg output:
 
 hub 1-0:1.0: state 7 ports 8 chg  evt 0010
 ehci_hcd :00:02.2: GetStatus port 4 status 001002 POWER sig=se0
 CSC
 hub 1-0:1.0: port 4, status 0100, change 0001, 12 Mb/s
 usb 1-4: USB disconnect, address 3

That was the disk disconnecting.  Pretty much everything that follows
is irrelevant: We don't need to know what happened _after_ the drive
disconnected -- we need to know what happened _before_ (i.e., what
caused the disconnect).

A usbmon trace would be helpful.  See the instructions in 
Documentation/usb/usbmon.txt.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Reg: Mass storage Problem

2007-09-16 Thread Alan Stern
On Sun, 16 Sep 2007, mahesh waran wrote:

 Hi Engineers,
 Dear all:
 
 When I use the g_file_strogae.ko module, I failed to write big file to the 
 disk.
 
 Hardware platform:
 
 CPU: S3C2440A
 
 SDRAM: 32M sdram
 
 Kernel:2.6.19 
 
 processor:AT91SAM9261
 
 I plug a 256MBytes usb flashdisk(fat32 type) into the board usb host
 interface, and connect a usb line between the board usb device interface
 and a PC with WinXP OS. 
 
 In the board side, I use the following command:
 
 # insmod ./g_file_storage.ko file=/dev/sda removable=1
 
 where /dev/sda is the external 256MB flash disk.
 
 Then in the PC side, XP can recognize the board as a usb mass storage
 
 device. And read big file(3Mbytes) is OK.
 
 But when I write a big file(3Mbytes) into the board from XP side, the
 speed is very slow and finally failed. (Write a 3KBytes file is OK). In
 the board side, kernel repeatedly printed following message every
 several seconds. g_file_storage gadget: full speed config #1.
 
 What's wrong with it?

To find out what is wrong, you must edit the source file 
drivers/usb/gadget/file_storage.c.  Change the lines saying

#undef DEBUG
#undef VERBOSE

to

#define DEBUG
#define VERBOSE

Then rebuild the driver and run your test again.  When it is done, post 
the output from dmesg on the board so we can see what happened.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] 100 port usb hub

2007-09-14 Thread Alan Stern
On Fri, 14 Sep 2007, Carl Karsten wrote:

 goal is to stress test a bad-ass wifi setup by simulating 500 laptops.
 
 Assuming I can find a 500 usb 802.11b adapters for under $1 each (might 
 happen, 
 they are small and obsolete.)  I need a 'good' way to get them all hooked to 
 a 
 few laptops.
 
 8 8 port hubs plugged into 1 8 port will give me 64 ports, but thats 9 hubs, 
 or 
 about 80 hubs total, or well over $1000, plus a few $100 in usb cables, plus 
 a 
 big mess just plugging them all in.
 
 I am hoping someone makes a big hub.  128 devices is the most I can plug into 
 a 
 single OS, right?

I don't know of any big hubs, sorry.

Be aware that currently Linux has a limit of 31 ports per hub.  You can
change it easily enough: USB_MAXCHILDREN is defined in
include/linux/usb.h.

If you think about it in terms of dollars per port, you may find that 
the financial requirements are impractically high no matter how the 
hubs are arranged, unforunately.  Guessing at an average retail figure 
like $5 per USB port plus wifi adapter, you would need a minimum of 
$2500, not counting cables and other incidentals.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] submit urb question (isochronous mode)

2007-09-11 Thread Alan Stern
On Mon, 10 Sep 2007, Philip Rakity wrote:

 Alan,
 
 Now understand.  Is there anyway to get the each buffer corresponds
 to a separate transaction in the EHCI.TXT document.  plus the compare
 and contrast statement?

It doesn't belong there, since it is true for every Isochronous URB no 
matter what host controller you use.  EHCI, OHCI, UHCI -- they all work 
the same.  It's part of the USB spec, and people are expected to know 
that already.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] submit urb question (isochronous mode)

2007-09-10 Thread Alan Stern
On Mon, 10 Sep 2007, Philip Rakity wrote:

 I am trying to understand the difference of the following:
 
 video camera -- isochronous mode  --- data only comes into the HOST
 
 polling is done every 1ms
 
 
 Now for the question
 
 I submit say
 10 urbs each with 10 buffers
 
 or
 
 I submit say
 
 100 urb's with 1 buffer each
 
 assume that each buffer is big enough to hold the video frame that is  
 received by the host.

Okay... but the maximum size of a full-speed isochronous transfer is 
only 1023 bytes.  Is that really large enough to hold a video frame?

 so what is the compare and contrast --
 
 I guess that if every buffer is filled each 1ms then my callback is  
 called every 1ms for the 100 urb case and every 10ms for the 10urb case

That's right.

 anything else ?

The CPU has more interrupt overhead in the 100-URB case, because it 
gets interrupted every ms.  In the 10-URB case, interrupts occur every 
10 ms.

There's more general processing overhead in the 100-URB case, simply 
because it takes a certain amount of work to submit each URB -- and the 
amount of work needed for a 10-buffer URB is less than 10 times the 
work needed for a 1-buffer URB.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] usb-storage and Motorola Z6

2007-09-09 Thread Alan Stern
On Sun, 9 Sep 2007, Peter Rasmussen wrote:

 OK, I added that change as well, and it seems to make mount'ing and 
 accessing the mobile and its micro-SD card much more stable.
 However, as the fixes are adding an unusual device and otherwise 
 removing checks in the code, it isn't the way to go for the general case 
 I suppose?
 Or is it? I understand that the Z6 is broken and that some stringent 
 checks have to be removed to make it work, but what ill effects will 
 those have in the general case, ie. for a proper implementation of a 
 client device?

These changes will not go into the kernel, at least, not in the form
discussed so far.  If they are accepted it will be in a form that
doesn't affect devices other than the Z6.

  OK, but with my poor knowledge about how devices connect in the USB 
  world, I would still have expected that handshake procedures both on 
  host and client side would be known to the other side when the main 
  software, ie. the OS on both sides, are the same or similar.
  
 
  What do you mean?  Of course these procedures are all standardized, so
  they are well known to everybody.  That doesn't mean everybody
  implements them correctly.
 

 Or the standard is too loosely specified so that many implementations 
 may seem right, but won't work together, eg. because of timing issues 
 and whatnot. Or that it is tested against too slim a target, eg. if it 
 works with our host software on a Windows machine, it passes, which has 
 been seen before in other places.

Both of those phenomena have been known to happen.  However in the case 
of the two major problems with the Z6 -- the wrong Tag value and the PQ 
= 1 setting -- the standards are not loose or ambiguous.  They are 
clear as can be, and the phone violates them.  I have never heard of 
any other device making the same kind of mistakes.  It might even 
be suggested that Motorola introduced those bugs deliberately.

Regarding the last block problem, once again the standard is quite 
clear.  However this is an error which many people have made, 
repeatedly.  Perhaps because reporting the highest block number rather 
than the number of blocks isn't what people expect, or perhaps because 
some devices translate (e.g. between USB and IDE) to a protocol which 
does use the number of blocks.

  I didn't say that.  I have no idea how Motorola chose to implement
  their client-side USB software.  It might be an application or it might 
  be part of their kernel.
 

  Again, I am surprised why 
  Motorola would do that when working software already exists?
  
 
  What working software are you referring to?
 

 As it is a Linux based system, there should be quite a lot of software 
 that work already with USB, don't you think? And Motorola has at least 
 one other Linux based mobile that works without any changes to a 
 standard kernel, ie. the A780 I mentioned.

So why didn't they use the same software as in the A780?  Beats me...

 Thank you very much for your help!

You're welcome.

 Unless you are still interested in seeing my logs when connecting the 
 Z6, with the changes in my Linux kernel that you proposed, I will stop 
 spamming the list and keep what I have learned :-)
 The Z6 I have used here is not mine and I have to give it back to my 
 friend tomorrow.

If it works okay with those three changes, there's no point in 
discussing the matter any farther.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] USB power/recharging

2007-09-09 Thread Alan Stern
On Sun, 9 Sep 2007, Howard Chu wrote:

 I have a bunch of older USB devices that could simply be charged by plugging 
 into a dumb USB power port on my laptop's power adapter. I now have two newer 
 devices (Sony Minidisc MZ-RH1 and Motorola KRZR phone) that refuse to charge 
 from a dumb port. They seem to require a regular handshake with a PC, 
 negotiating their DC current requirements, before they will start charging.

Possibly they require their USB port to be enabled.  Or possibly they 
require to be put in a special configuration for recharging -- the 
default configuration for USB devices is not allowed to draw more than 
100 mA of current whereas other configurations are allowed to draw up 
to 500 mA.

 I 
 find this pretty annoying because it means I now need a powered up PC 
 (laptop) 
 when I want to recharge these guys while I'm traveling, or I have to bring 
 their proprietary chargers with me. (Whereas I usually just bring the laptop 
 power supply and a set of plug adapters for wherever I'll be visiting.)
 
 So my first question is - does anybody know of a smart USB dongle that can 
 take power from a dumb USB power port, and can talk thru the required 
 handshake 
 to get these devices to enable their chargers?

Not me, sorry.  That is, I'm not aware of any sort of smart USB
dongle at all, let alone one capable of doing what you want.

 Next, I've occasionally seen some people complain that their phones start 
 charging as soon as they plug into their laptop. In some cases, you don't 
 want 
 the phone sucking down whatever battery life is left in the laptop, you just 
 want to do some stuff with the phone and let it draw down its own battery. 
 This 
 is the more Linux-oriented question - can you tweak the USB driver to ignore 
 the power negotiation handshake? (I.e., I'm assuming that if the power 
 negotiation fails, the device's charger will fail to kick in, but the rest of 
 command communication should continue to operate.)

There is no such thing as a power negotiation handshake.  There may 
be special commands those phones accept which cause them to turn their 
recharger on or off, but such things aren't standardized.  Or the 
phones may use standard commands to control their recharger, but such 
usage is not the overt purpose of those commands.  There is no standard 
USB command for Turn your recharger on.

Depending on what the phone requires, it may or may not be possible to
do what you want.  For example, if all the phone requires is that its
port be enabled, then you're out of luck -- there's no way to use a USB
device if its port isn't enabled.  But if the phone offers a selection
of configurations, some of which turn on the recharger and others of
which don't, then you're in good shape -- you can make Linux tell the
phone to install whichever configuration you want.

You can find out what configurations are available either by looking at 
/proc/bus/usb/devices or by running lsusb -v, while the phone is 
attached to the computer.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] usb-storage and Motorola Z6

2007-09-08 Thread Alan Stern
On Sat, 8 Sep 2007, Peter Rasmussen wrote:

  In fact there was another patch from earlier in the email thread, which 
  was needed to work around the PQ = 1 problem.  Since you didn't apply 
  that patch, the SCSI disk driver wasn't bound to your Z6.
 

 Now I applied that patch, too, and it did make a difference, in 
 drivers/scsi/scsi_sysfs.c I have:
 
 static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
 {
 struct scsi_device *sdp = to_scsi_device(dev);
 if (sdp-no_uld_attach)
 return 0;
 return 1;
 //  return (sdp-inq_periph_qual == SCSI_INQ_PQ_CON)? 1: 0;
 }

Did you also make the change to usb-storage for ignoring wrong Tag 
values?

 Before posting a lot of USB debug output, I'll explain a shorter version :-)
 
 1.After reboot I connected the Z6 (incl. a micro-SD card) and got
 what looked good, if not the usual output from dmesg:
 
 snip
 scsi 0:0:0:0: Direct-Access Motorola MSnc. PQ: 1 ANSI: 0 
 CCS
 snip
 sd 0:0:0:0: [sda] Attached SCSI removable disk
 sd 0:0:0:0: Attached scsi generic sg0 type 0
 snip
 scsi 0:0:0:1: Direct-Access Motorola MSnc. PQ: 1 ANSI: 0 
 CCS
 snip
 sd 0:0:0:1: [sdb] Attached SCSI removable disk
 sd 0:0:0:1: Attached scsi generic sg1 type 0
 snip

Evidently the phone didn't report that the micro-SD card was present.  
Otherwise you would have seen log entries describing the number of
sectors and the write-protect status.

 2.I could then mount the SCSI devices like this:
 
 # mount /dev/sda /mnt/usb
 # mount /dev/sdb /mnt/usb2
 
 When I normally with a USB mass storage device do, eg.:
 
 # mount /dev/sda1 /mnt/usb
 
 3.I couldn't however, always mount the mentioned devices as I would
 sometimes get a 'mount: No medium found' error, and a message on the
 mobile will sometimes show USB connected and sometimes USB
 disconnected even though it didn't seem to correlate to successful
 connection between my PC and the Z6.
 
 4.So, something seems to be inconsistent. I have tried it with a few
 different cables and I can't detect a difference.
 
 5.Should I post a full log of eg. connecting the Z6, mounting it and the SD 
 card, accessing it and then unmounting? 
   A full log may then include failed attempts, which will perhaps give some 
 hints at what is wrong?
   Or do you already have a pretty good idea as to what is wrong, and find 
 that such an exercise is not really useful?

If you want to post a log, include only the initial connection and one 
failed mount attempt.  Also, you can remove linux-scsi from the CC: 
list above, since this bug no longer involves any SCSI-level issues.

  :-)  There's no necessary relation between the OS running on a device
  like your phone and its interoperability with computers running the
  same OS.
 

 Well, I would have expected that they have similar methods to
 connect, even though different Linux kernel version of course may
 have introduced some differences. My A780 has a 2.4.20 kernel and I
 wouldn't be surprised if other Motorola mobiles also use the 2.4.*
 series of Linux kernels.

Not at all -- the methods used for connecting are _completely_
different, because the phone connects as a peripheral whereas the
kernel expects to connect as a host.

  And you say that this seems to be a more widespread problem with 
  Motorola devices? Do you remember which ones, and do they run Linux as 
  well?
  
 
  There were two problems.  First was the PQ = 1 problem; I have never
  seen it before now (so only on the Z6).  The other problem was the
  capacity, or last sector number; we know that the RAZR V3i and V3x both
  suffer from it as well.  (I have no idea whether they run Linux.)  
  Possibly other devices do too, and we just don't know about them.

Plus the third (incorrect Tags) problem, which I forgot to mention
earlier.

 I know that those two don't run Linux, but can they connect to a
 Linux host, or do they also have problems?

They can connect to a Linux host with no problem, now that the 
appropriate quirks entries have been created.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Cannot run scanning software

2007-09-08 Thread Alan Stern
On Sat, 8 Sep 2007, Leslie Katz wrote:

 I bought a Canon MP160 printer/copier/scanner to use with my computer
 running Fedora.
 
 The copier works without the need to install software.
 
 The printer needs software. I was able to download, install and
 configure 2 rpm packages from Canon, so that printing works
 perfectly.
 
 Canon also offered 2 rpm packages needed for scanning. I downloaded
 and installed them. The packages create a plugin for Gimp and also
 create a standalone application. I tried both methods for scanning,
 but neither works.
 
 I looked at the output from dmesg and the relevant bit, according to
 my dim understanding, is as follows:
 
 usb 2-1: usbfs: interface 1 claimed while 'scangearmp' sets config #1
 
 I'd be very grateful to be told how I can overcome the problem described.

That message indicates the programs from Canon are out-of-date.  
Earlier kernels would accept the error condition described by the log 
message, but current ones do not.

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] usb-storage and Motorola Z6

2007-09-08 Thread Alan Stern
On Sat, 8 Sep 2007, Peter Rasmussen wrote:

  Did you also make the change to usb-storage for ignoring wrong Tag 
  values?
 

 I'm not sure what you mean,

See:   http://marc.info/?l=linux-usb-usersm=118859379130423w=2

  Evidently the phone didn't report that the micro-SD card was present.  
  Otherwise you would have seen log entries describing the number of
  sectors and the write-protect status.
 

 Well, the second device, that I may mount as /dev/sdb, is the micro-SD 
 card, so some presence must be detected.

I guess so, but it didn't happen in the portion of the log you included 
in your earlier message.

  Well, I would have expected that they have similar methods to
  connect, even though different Linux kernel version of course may
  have introduced some differences. My A780 has a 2.4.20 kernel and I
  wouldn't be surprised if other Motorola mobiles also use the 2.4.*
  series of Linux kernels.
  
 
  Not at all -- the methods used for connecting are _completely_
  different, because the phone connects as a peripheral whereas the
  kernel expects to connect as a host.
 

 OK, but with my poor knowledge about how devices connect in the USB 
 world, I would still have expected that handshake procedures both on 
 host and client side would be known to the other side when the main 
 software, ie. the OS on both sides, are the same or similar.

What do you mean?  Of course these procedures are all standardized, so
they are well known to everybody.  That doesn't mean everybody
implements them correctly.

 So are you 
 saying that it is a utility on the client side (the mobile phone) that 
 is made as a totally independent application?

I didn't say that.  I have no idea how Motorola chose to implement
their client-side USB software.  It might be an application or it might 
be part of their kernel.

 Again, I am surprised why 
 Motorola would do that when working software already exists?

What working software are you referring to?

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] usb-storage and Motorola Z6

2007-09-07 Thread Alan Stern
On Fri, 7 Sep 2007, Peter Rasmussen wrote:

 I'm sorry if this is a little late, but I had once had access to a Z6 
 and believe I had it successfully connected to my Linux host, and was 
 therefore puzzled by this message exchange.
 
 I have now borrowed the device again for the weekend to check it out a 
 little more.
 
 Using Alan's patch below, otherwise my kernel is a standard 2.6.23-rc5 
 (CONFIG_USB_STORAGE_DEBUG=y ) I got the following result after reboot 
 and connecting the Z6.:
...

In fact there was another patch from earlier in the email thread, which 
was needed to work around the PQ = 1 problem.  Since you didn't apply 
that patch, the SCSI disk driver wasn't bound to your Z6.

 What I can't understand, however, is that as this mobile phone 
 supposedly runs Linux. I can't see how Motorola could break it so badly 
 that the USB connection now doesn't work with a PC running Linux?

:-)  There's no necessary relation between the OS running on a device
like your phone and its interoperability with computers running the
same OS.

 And you say that this seems to be a more widespread problem with 
 Motorola devices? Do you remember which ones, and do they run Linux as well?

There were two problems.  First was the PQ = 1 problem; I have never
seen it before now (so only on the Z6).  The other problem was the
capacity, or last sector number; we know that the RAZR V3i and V3x both
suffer from it as well.  (I have no idea whether they run Linux.)  
Possibly other devices do too, and we just don't know about them.

 The following is from connecting a Z3 that supposedly isn't based on 
 Linux, but works all right (and this may have been the one I thought was 
 the Z6 that I claimed worked):
...

It looks normal.

 I hope perhaps it can provide some comparison info now with a device 
 that works and one that doesn't.
 
 If Motorola actualy has made changes to the Linux kernel they use with 
 the Z6, I suppose we should be able to get the actual code. Should I 
 investigate that?

Sure, go ahead and try.  Maybe you can convince them to fix their bugs!  
Although that won't help all the units that have already been 
manufactured...

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Reg:Nand Flash Issue

2007-09-05 Thread Alan Stern
On Wed, 5 Sep 2007, mahesh waran wrote:

 Hi Engineers,
 
   Dear all:
 
  When I use the g_file_strogae.ko module, I failed to write big file to
 
  the disk.
 
  Hardware platform:
 
  CPU: S3C2440A
 
  SDRAM: 32M sdram
 
  Kernel:2.6.19 
  processor:AT91SAM9261
  
  I plug a 256MBytes usb flashdisk(fat32 type) into the board usb host
 
  interface, and connect a usb line between the board usb device interface
 
  and a PC with WinXP OS. 
 In the board side, I use the following command:
 
  # insmod ./g_file_storage.ko file=/dev/sda removable=1
 
  where /dev/sda is the external 256MB flash disk.
 
  Then in the PC side, XP can recognize the board as a usb mass storage
 
  device. And read big file(3Mbytes) is OK.
 
  But when I write a big file(3Mbytes) into the board from XP side, the
 
  speed is very slow and finally failed. (Write a 3KBytes file is OK). In
 
  the board side, kernel repeatedly printed following message every
 
  several seconds. g_file_storage gadget: full speed config #1.
 
  What's wrong with it?

All those full speed config #1 messages show up because the PC is 
resetting your board.  It does the reset because an error has occurred.

Does it work any better if you add stall=n to the insmod command 
line?

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] MXI Security Stealth MXP - data corruption

2007-09-02 Thread Alan Stern
On Sun, 2 Sep 2007, Chuck Anderson wrote:

 Please Cc me on any replies, since I'm not subscribe to this list.  
 Thanks.
 
 I'm evaluating MXI Security's Stealth MXP 4 GB hardware encrypted USB 
 thumb drive w/biometric reader.  It works okay in Windows and MacOS X, 
 but fails under Linux with data corruption issues.  Here is the output 
 of lsusb:
...

 As you can see, the corruption is always 16 bytes in size and the 
 offsets seem to fall into a pattern of sorts.  The corruption is also 
 always the same for this specific data set.  When I looked at the 
 corruption in the files that I stored when it was formatted as FAT32, 
 it was different and seems to be data-dependent.
 
 If I repeat the exact test on MacOS X, there is no problem.  All zeros 
 get written and read back from the device.  If I then take the zeroed 
 USB stick back to a Linux system and try to read it, I get corrupted 
 data.  So the corruption definately happens when Linux reads from the 
 device.
 
 If I re-zero the device on Linux and take it back to MacOS X, the same 
 corruption shows up there.  So the corruption also happens when Linux 
 writes to the device.
 
 I'm using Fedora 5 and 6 for my testing, and I've tried several 
 kernels including 2.6.18-1.2798.fc6, 2.6.20-1.2962.fc6, and 
 2.6.22.2-42.fc6.  My colleague has also tried Slackware Linux with 
 kernel 2.6.21.5, and the problem appears there as well.

That's on a different computer?  Hardware differences are more likely 
to matter here than kernel version differences.

 Does anyone know what might be going on here?  It seems there is a bug 
 somewhere in Linux usb-storage.  I've never head issues with regular 
 USB sticks before--could the problem here be due to the multiple LUNs?

I doubt there's a bug in usb-storage or in the LUN handling code.  If
there were, it would likely show up much more frequently than 16 bytes
out of every 128 KB -- and it would show up with every storage device,
not just this one.

It's quite possible there's a bug in the device, one that is somehow 
triggered by Linux but not by Windows or Mac OS X.  However I have no 
idea what such a bug might be or how to avoid it.

If you have access to a USB bus analyzer, it would be possible to prove 
or disprove that the bug is in the device.  But even then, it wouldn't 
be clear how to cope with it.

Have you tried using the device at full speed instead of high speed?  
Do rmmod ehci-hcd before plugging it in and then see how it behaves.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


  1   2   3   4   5   6   7   8   9   10   >