Re: Re: Questions about FSG, pls help me(platform:s3c2440 andlinux2.6.26)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
As you said,  host eventually times out and proceeds with USB bus reset .My question is
1. why the last bulk out doesn't happen?
2. As I said in last letter, after receive 4032 bytes, controller receive an interrupt(EP_INT_REG=USB_INT_REG=0, PWR_REG=0, EP0_CSR=0), and this bulk out translation is ended. How does the interrupt(EP_INT_REG=USB_INT_REG=0, PWR_REG=0, EP0_CSR=0) happens?
 
2009-03-24

snoppy1314

发件人: Kalpesh Rathod
发送时间: 2009-03-24  15:57:38
收件人: snoppy1314
抄送: kernelnewbies; linux-usb
主题: Re: Questions about FSG, pls help me(platform:s3c2440 andlinux2.6.26)
Hi snoopy,

I don't have answer to you question but just sharing my thoughts.

Though double buffering is used, there will be cases when your both buffer are filled by host and FSG has not taken data from either. In that case OUT transactions should be NAKed by the your controller. This is generally taken care by the controller itself in hardware.

IMHO, your last bulk out transaction is neither ACKed or NAKed by your controller. Hence, host eventually times out and proceeds with USB bus reset.
ACK/NAK of transaction is controller h/w job. I don't know s3c2410 h/w but it should have some status indication for FIFO busy status for both the buffers. Check these values when your transaction fails.
 
As, a trial you can make your code to respond faster. Remove all printks in write_10 path. Even remove call to vfs_write and from file_storage.c and simply return success there. This may lead to knew code insight as host will receive data in sufficient time.

Thanks,
Kalpesh


2009/3/24 snoppy1314 <snoppy1314@xxxxxxx>
 
 
Hi, everyone:
 
I use the s3c2410_udc.c, file_storage.c and others in drivers/usb/gadget to make my PDA acts as a USB disk to PC.
When my PDA is connected with PC, it can be realized as a usb disk, I can also copy files from PDA to PC.But the question is:files cann't be copied from PC to PDA.After use BUS HOUND and printk, I found some reasons, but don't know how to do next.
1. when receive WRITE(10) from PC, PDA do as follow(it's defined in file_storage.c)
1.1 check buffer 1 is empty?--yes-->receive data from usb, and save data to buffer 1
1.2 check buffer 2 is empty?--yes-->receive data from usb, and save data to buffer 2
1.3 check buffer 1 is full?--yes-->write data in buffer 1 to Flash
1.4 check buffer 2 is full?--yes-->write data in buffer 2 to Flash
1.5 go back to 1.1, until data ends
The question is :in step 1.1, for example, when receive 4096 bytes data from PC, PDA only receive 4032 bytes(receive 63 tims, for each 64 bytes), the last bulk_out interrupt is not received but receive a interrupt (EP_INT_REG=USB_INT_REG=0, PWR_REG=0, EP0_CSR=0) and after some seconds, a reset interrupt with bulk_out interrupt is received and usb bus is reset.
Who can tell me how the interrupt (EP_INT_REG=USB_INT_REG=0, PWR_REG=0, EP0_CSR=0)  is produced when it's not EP interrupt or USB interrupt?
Who can tell me why the last bulk_out interrupt is not received by PDA?
 
thanks in advance!
 
Yours 施金前
 
2009-03-24

snoppy1314
 
 


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux