Hi.  I am trying to get the ohci-isp1362 driver working, and I feel
like I am almost there.  Here's my situation:

The only thing I'm using it for right now is to transfer files to
and from a flash drive.  I can enumerate fine, and it seems I can
list files and directories just fine too.  I can write files, if I
write them 4KiB at a time, and 'sync' between writes.  Reading
sometimes fails, and it seems if I read straight to SDRAM it fails
more often than reading to onboard NAND flash (JFFS2).  I'm
assuming this has to do with various timing issues.

I'm trying to analyze my debug messages, and understand what's
happening.  Could you give some guidance?

Here's the pattern that I'm seeing in my debug messages:
(note: My debug messages likely look a bit different)

ohci_write_control: HCCONTROL 00000083->000000a3
In 'td_submit_urb'.
ohci_write_cmdstatus: HCCMDSTAT 00000000->00000004
find_td: Found ED c10f0080(c10f0080)...
td_flags:f0100000
Processing TD c1080040 ED c10f0080 PTD[0] 0610 #1010
enqueue_ptd: Queueing PTD 0610 len 512 TD c1080040 #1010
__isp1362_write_buffer: Writing 8 byte to buffer[00] @ 0610
__isp1362_read_buffer: Reading 72 byte from buffer[00] @ 0610
flush_ptd: Flushing PTD[0] 0610, TD c1080040 #102d
__isp1362_read_buffer: Reading 8 byte from buffer[00] @ 0610
__isp1362_read_buffer: Reading 512 byte from buffer[00] @ 0618
Retiring TD c1080040 ED c10f0080 info 00401102 with CC=0 #102d
finish_xfer: PTD 0610 of TD c1080040 finished #102d
ohci_write_control: HCCONTROL 000000a3->00000083

Now, 0x0610 is the area in the buffer for the first ATL packet.  It
can handle 512 bytes, and it is transferred on the bus in 64 byte
chunks.

Now, the irregularity (and trouble) starts with these debug
messages:

ohci_write_control: HCCONTROL 00000083->000000a3
In 'td_submit_urb'.
ohci_write_cmdstatus: HCCMDSTAT 00000000->00000004
find_td: Found ED c10f0080(c10f0080)...
td_flags:f0d00000
Processing TD c1080040 ED c10f0080 PTD[0] 0610 #10eb
enqueue_ptd: Queueing PTD 0610 len 512 TD c1080040 #10eb
__isp1362_write_buffer: Writing 8 byte to buffer[00] @ 0610 
__isp1362_read_buffer: Reading 72 byte from buffer[00] @ 0610
In 'td_submit_urb'.
ohci_write_cmdstatus: HCCMDSTAT 00000000->00000004
flush_ptd: Flushing PTD[0] 0610, TD c1080040 #1108
__isp1362_read_buffer: Reading 8 byte from buffer[00] @ 0610
__isp1362_read_buffer: Reading 512 byte from buffer[00] @ 0618
- In 'requeue_ptd'
enqueue_ptd: Queueing PTD 0610 len 512 TD c1080040 #1108
__isp1362_write_buffer: Writing 8 byte to buffer[00] @ 0610
__isp1362_read_buffer: Reading 72 byte from buffer[00] @ 0610
find_td: Found ED c10f0080(c10f0080)...
td_flags:a3d00000
_!_ td = td->hwNextTD  (Break here? -emu.c:~904)
td_flags:f0d00000
Processing TD c1080000 ED c10f0080 PTD[1] 0818 #1134
enqueue_ptd: Queueing PTD 0818 len 512 TD c1080000 #1134
__isp1362_write_buffer: Writing 8 byte to buffer[00] @ 0818
__isp1362_read_buffer: Reading 72 byte from buffer[00] @ 0818


Now, I'm in the middle of processing a TD, and I get these lines
that don't normally happen here:

In 'td_submit_urb'.
ohci_write_cmdstatus: HCCMDSTAT 00000000->00000004

Is this because it's processing the next TD while waiting for the
first one?  I also see a new 'find_td' message, but I never see the
'Retiring TD' message for the first one.
This then causes it to go on to the next PTD buffer area (@
0x0818).
It then keeps on doing the same thing, and interrupts with a new
'find_td' with the next PTD buffer area after that.  It finally
halts with the "update_td_status: TD c1080040 ERROR 3
TD_CC_DATATOGGLEM" error.. I'm assuming since it missed something,
it didn't correctly set the toggle bit.

Now, is something happening concurrently that's adding new TDs
before the last one has finished if it's not fast enough?  Could I
add some sort of gate to prevent processing of a TD before the old
one has finished?  (I also noticed the '0xa' at the start of
td_flags, which is the TD_BUSY condition code added by the isp's
ohci emulation, and it doesn't seem to ever get cleared)

I really don't understand how this all works, or what's going on,
so any pointers / insight are more than welcome.

Thanks,
Mike



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to