Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-06 Thread Guennadi Liakhovetski
On Tue, 5 Jun 2007, Alan Stern wrote:

 I just tried doing what you said:
 
   modprobe net2280
   dd if=/dev/zero of=/tmp/b bs=1M count=5 ; \
   modprobe g_file_storage file=/tmp/b
 
 No problem; it worked fine.  But my version of the driver includes the 
 patch, of course.  And this was under 2.6.22-rc3.

Right, I did the same (ok, 4M) and it worked too. Then I did it with my 
usual size - 16M - and it broke. Also with the patch you suggested.

Thanks
Guennadi
-
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-06 Thread Alan Stern
On Wed, 6 Jun 2007, Guennadi Liakhovetski wrote:

 On Tue, 5 Jun 2007, Alan Stern wrote:
 
  I just tried doing what you said:
  
  modprobe net2280
  dd if=/dev/zero of=/tmp/b bs=1M count=5 ; \
  modprobe g_file_storage file=/tmp/b
  
  No problem; it worked fine.  But my version of the driver includes the 
  patch, of course.  And this was under 2.6.22-rc3.
 
 Right, I did the same (ok, 4M) and it worked too. Then I did it with my 
 usual size - 16M - and it broke. Also with the patch you suggested.

Okay.  I just tried it over again, this time using 16 MB.  Just as in
your case, the filesystem was standard ext3.  And it worked.

So you'll have to do some debugging on your own.  The source file is 
drivers/usb/gadget/file_storage.c.  To begin with, you can #define the 
DEBUG and VERBOSE macros near the start of the file.

Some other things to check: Make sure that fsg_bind() completes 
successfully.  See if handle_exception() is getting called and if it is 
calling do_set_config() under the FSG_STATE_CONFIG_CHANGE case.  Also 
see if do_set_config() returns an error.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Alan Stern
On Tue, 5 Jun 2007, Guennadi Liakhovetski wrote:

 Hi
 
 I see a ~100% reproducible problem under 2.6.20 with g_file_storage: the 
 script
 
 cp fs.image /tmp/
 modprobe g_file_storage file=/tmp/fs.image
 
 comes with no error back, but the enumeration fails. Whereas inserting a 
 sync between the cp and modprobe fixes it... It worked without sync 
 under 2.4.30. Filesystem is ext3 mounted with default parameters 
 (rw,data=ordered), gadget driver net2280, i386 platform. Is this intended 
 behaviour?

Yes, of course we always write device drivers so that they will fail in 
unexpected ways unless the user does something unintuitive and 
undocumented.  :-)

When you say the enumeration fails, what exactly goes wrong?  I've 
never tried using g_file_storage with a newly-created backing file.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Uncle George
Alan Stern wrote:

 Yes, of course we always write device drivers so that they will fail in 
 unexpected ways unless the user does something unintuitive and 
 undocumented.  :-)
Ya, we all knew that. Just so long as you understand that we users all 
read the hardware docs from cover to cover, looking for all those 
undocumented features just so we can justify the errant driver report. :}

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Guennadi Liakhovetski
On Tue, 5 Jun 2007, Alan Stern wrote:

 On Tue, 5 Jun 2007, Guennadi Liakhovetski wrote:
 
  I see a ~100% reproducible problem under 2.6.20 with g_file_storage: the 
  script
  
  cp fs.image /tmp/
  modprobe g_file_storage file=/tmp/fs.image
  
  comes with no error back, but the enumeration fails. Whereas inserting a 
  sync between the cp and modprobe fixes it... It worked without sync 
  under 2.4.30. Filesystem is ext3 mounted with default parameters 
  (rw,data=ordered), gadget driver net2280, i386 platform. Is this intended 
  behaviour?
 
 Yes, of course we always write device drivers so that they will fail in 
 unexpected ways unless the user does something unintuitive and 
 undocumented.  :-)

Sure, I always program that way too:-)

 When you say the enumeration fails, what exactly goes wrong?  I've 
 never tried using g_file_storage with a newly-created backing file.

Ok, the host says:

usb usb1: wakeup_rh (auto-start)
hub 1-0:1.0: state 7 ports 2 chg  evt 0004
uhci_hcd :00:1f.2: port 2 portsc 0093,00
hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s
hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101
usb 1-2: new full speed USB device using uhci_hcd and address 69
usb 1-2: default language 0x0409
usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: File-backed Storage Gadget
usb 1-2: Manufacturer: Linux 2.6.20.1-rt8-dsa-mftd2x-2 with net2280
usb 1-2: SerialNumber: 3238204E6F76
usb 1-2: uevent
usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: khubd timed out on ep0out len=0/0
usb 1-2: can't set config #1, error -110
drivers/usb/core/inode.c: creating file '069'
hub 1-0:1.0: state 7 ports 2 chg  evt 0004

and on USB-analyser I see an invalid out-transaction with an invalid 
toggle and a setup transactio with only NAKs.

Thanks
Guennadi
-
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Alan Stern
On Tue, 5 Jun 2007, Guennadi Liakhovetski wrote:

  When you say the enumeration fails, what exactly goes wrong?  I've 
  never tried using g_file_storage with a newly-created backing file.
 
 Ok, the host says:
 
 usb usb1: wakeup_rh (auto-start)
 hub 1-0:1.0: state 7 ports 2 chg  evt 0004
 uhci_hcd :00:1f.2: port 2 portsc 0093,00
 hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s
 hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101
 usb 1-2: new full speed USB device using uhci_hcd and address 69
 usb 1-2: default language 0x0409
 usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=3
 usb 1-2: Product: File-backed Storage Gadget
 usb 1-2: Manufacturer: Linux 2.6.20.1-rt8-dsa-mftd2x-2 with net2280
 usb 1-2: SerialNumber: 3238204E6F76
 usb 1-2: uevent
 usb 1-2: configuration #1 chosen from 1 choice
 usb 1-2: khubd timed out on ep0out len=0/0
 usb 1-2: can't set config #1, error -110
 drivers/usb/core/inode.c: creating file '069'
 hub 1-0:1.0: state 7 ports 2 chg  evt 0004
 
 and on USB-analyser I see an invalid out-transaction with an invalid 
 toggle and a setup transactio with only NAKs.

This looks like it has nothing to do with using sync or newly-created 
backing files.  Instead it resembles a problem for which a patch was 
recently submitted:

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

It hasn't been accepted yet, unfortunately.  If you can confirm that it 
fixes your problem, I'll urge Greg to merge it in time for 2.6.22.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Guennadi Liakhovetski
On Tue, 5 Jun 2007, Alan Stern wrote:

 On Tue, 5 Jun 2007, Guennadi Liakhovetski wrote:
 
  usb usb1: wakeup_rh (auto-start)
  hub 1-0:1.0: state 7 ports 2 chg  evt 0004
  uhci_hcd :00:1f.2: port 2 portsc 0093,00
  hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s
  hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101
  usb 1-2: new full speed USB device using uhci_hcd and address 69
  usb 1-2: default language 0x0409
  usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-2: Product: File-backed Storage Gadget
  usb 1-2: Manufacturer: Linux 2.6.20.1-rt8-dsa-mftd2x-2 with net2280
  usb 1-2: SerialNumber: 3238204E6F76
  usb 1-2: uevent
  usb 1-2: configuration #1 chosen from 1 choice
  usb 1-2: khubd timed out on ep0out len=0/0
  usb 1-2: can't set config #1, error -110
  drivers/usb/core/inode.c: creating file '069'
  hub 1-0:1.0: state 7 ports 2 chg  evt 0004
  
  and on USB-analyser I see an invalid out-transaction with an invalid 
  toggle and a setup transactio with only NAKs.
 
 This looks like it has nothing to do with using sync or newly-created 
 backing files.  Instead it resembles a problem for which a patch was 
 recently submitted:
 
   http://marc.info/?l=linux-usb-develm=118053809808501w=2

Emn, how recent are those signal-handling changes? Remember, the kernel on 
the gadget is only 2.6.20.1. And macroscopically it is indeed 100% 
repropducible - with and without sync. Can it really be explained by this 
signal-handling problem?

 It hasn't been accepted yet, unfortunately.  If you can confirm that it 
 fixes your problem, I'll urge Greg to merge it in time for 2.6.22.

I'll try to test it tomorrow.

Thanks
Guennadi
-
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] file_storage gadget requires a sync...

2007-06-05 Thread Alan Stern
On Tue, 5 Jun 2007, Guennadi Liakhovetski wrote:

  This looks like it has nothing to do with using sync or newly-created 
  backing files.  Instead it resembles a problem for which a patch was 
  recently submitted:
  
  http://marc.info/?l=linux-usb-develm=118053809808501w=2
 
 Emn, how recent are those signal-handling changes? Remember, the kernel on 
 the gadget is only 2.6.20.1. And macroscopically it is indeed 100% 
 repropducible - with and without sync. Can it really be explained by this 
 signal-handling problem?

I don't know; I didn't follow the changes to the core signal-handling 
for kernel threads.  I never experienced any problems until I started 
using 2.6.22, so it's certainly possible that you're seeing something 
different.

I just tried doing what you said:

modprobe net2280
dd if=/dev/zero of=/tmp/b bs=1M count=5 ; \
modprobe g_file_storage file=/tmp/b

No problem; it worked fine.  But my version of the driver includes the 
patch, of course.  And this was under 2.6.22-rc3.

Alan Stern


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel