This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM389X: USB g_mass_storage.ko problem

Dear Ti Team,

We are facing one issue related USB mass storage module.

we are inserting g_mass_storage.ko module and mounting one sd-card on the Host PC.

When we run the crystal disk mark utility to test the write performance, we are getting the below
mentioned prints on the board because of which we are getting write performance very low.
g_mass_storage gadget: high speed config #1: Linux File-Backed Storage.

Then we run the USB Analyzer on the host PC and found out that sometimes when 64k data is transfered,
board is not giving response back because of which host PC is Resetting the USB Port. Please find the log below.


We are using the Kernel from PSP=v2.6.37_ti816xpsp_04.00.02.14 release.

Please let us know the solution for this as soon as possible.

Best Regards,
Supreet

  • Supreet

    Have you checked with g_file_storage gadget. (g_file_storage.ko) ? Please let me know g_file_storage.ko is working.

    Regards

    Ravi B

  • Hi Ravi B,

    We Checked with g_file_storage gadget(g_file_storage.ko) and its working fine. 

    But we want to use g_mass_storage.ko .

    Please let us know the solution.

    Best Regards,

    Supreet 

  • Supreet

    Please refer to User's guide to supported feature. The g_mass_stoarge gadget is not supported.  Is there any limitation with FSG and it is not meeting your use case requirement?

    Regards

    Ravi B

  • Hi Ravi,

    Will the g_mass_storage gadget  be supported anytime soon????

    Best Regards,

    Supreet

  • Dear Ti Team, 

    Can you please tell us because of what we are facing reset issue in g_mass_storage gadget . We are not seeing this issue in g_file_storage gadget.

    We have to use g_mass_storage gadget for our setup.

    Can you please provide solution/reason for the above issue. We are running out of time.

    Best Regards,

    Supreet 

  • Supreet

    We do not have plan to support/validate g_mass_storage driver on 2.6.37+ kernel.  Is there any specific reason to use g_mass_storage gadget only. Can you check you observe any issue in PIO mode?

    Regards

    Ravi B

  • Hi Ravi B,

    We want to use g_multi gadget which uses g_mass_storage.ko + g_ether.ko since we want to use port as multi function(USB + Ethernet) .

    We tested g_mass_storage gadget in PIO mode and its working perfectly fine there.

    There seems to be problem in DMA mode but g_file_storage gadget works fine in DMA mode.

    So can you please tell us where the problem might be ?

    Waiting for your quick reply.

    Best Regards,

    Supreet 

  • Dear Ti Team,

    I am trying to debug the above mentioned issue in g_mass_storage.ko . Can you provide me some details regarding where the problem may be(files)?

    Waiting for your quick reply.

    Best Regards,

    Supreet

  • The gadget driver files are available at driver/usb/gadget/ directory.

  • Dear all,

    I'm facing the same issue with Sitara AM335x processor (here is the thread). Please note that I am using the latest SDK which includes Linux kernel 3.1.

    The g_file_storage works fine in both DMA and PIO mode, while g_mass_storage only in PIO, while in DMA mode it is reset frequently causing errors and poor performances. But I can not use deprecated g_file_storage, because I need USB Mass-Storage-Class in a composite gadget device (like g_multi).

    I do not think the problem is the gadget driver itself (drivers/usb/gadget), but its usage with the USB controller in DMA mode (drivers/usb/musb).

    Roshan, can I ask which system are you using on the USB host side for your tests: Linux PC or Windows PC?

    Do you have any success in you debug analysis?

    Thanks. Best regards,

    Max

  • Please refer http://e2e.ti.com/support/embedded/linux/f/354/t/159859.aspx#608238 for solution of g_mass_storage.

    Ajay

  • In that thread suggested by Ajay, I've verified that in DMA code of MUSB Controller driver there is an hard-code that makes g_file_storage to work fine.

    The hard-code can be easily extended to make g_mass_storage working fine, too. But unfortunately it's not useful for g_multi or other composite devices.

    In fact, within composite devices, DMA channels should be configured in different modes depending on endpoints (some will be used for Mass Storage Class, and other for other functions), so mode of DMA channels cannot depend just on USB Gadget driver name.

    Hope TI will work on DMA code of MUSB Controller driver to make it more flexible and able to work with composite gadgets.

    Regards, Max

  • There is plan to implement a new cppi4.1 dma driver in accordance with drivers/dma api. The discussion has already started at below links.

    [1] http://marc.info/?l=linux-kernel&m=132645142522764&w=2

    [2] http://marc.info/?l=linux-usb&m=132750514901315&w=2

    This driver is suppose to take care of all this.

    Ajay

  • Hi Max,

    I Agree with the points mentioned by you. I too want to use g_multi gadget. 

    Hope to get the resolution for this DMA as soon as possible.

    Thanks.

    Best Regards,

    Supreet

  • Hi TI Team,

    Can you please let us know when we can expect resolution for USB multi gadget dma issue.

    Waiting for your quick response.

    Best Regards,

    Supreet