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.

am335x: mass storage issue with PSP kernel

Other Parts Discussed in Thread: AM3517

Hi,

I have following USB configuration:

USB0 - OTG

USB1 - host only connected to 4-port hub

With this kernel https://github.com/koenkooi/linux/tree/beaglebone-3.2 I can attach an USB mass storage device and it will be detected (lsusb) and it will be also detected by the USB mass storage driver

usb 1-1.3: new high-speed USB device number 6 using musb-hdrc
usb 1-1.3: default language 0x0409
usb 1-1.3: udev 6, busnum 1, minor = 5
usb 1-1.3: New USB device found, idVendor=1b8f, idProduct=0305
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.3: Product: EXPRESS DUO
usb 1-1.3: Manufacturer: STT
usb 1-1.3: SerialNumber: 09021000000211517700000031
usb 1-1.3: usb_probe_device
usb 1-1.3: configuration #1 chosen from 1 choice
usb 1-1.3: adding 1-1.3:1.0 (config #1, interface 0)
usb-storage 1-1.3:1.0: usb_probe_interface
usb-storage 1-1.3:1.0: usb_probe_interface - got id
scsi3 : usb-storage 1-1.3:1.0
drivers/usb/core/inode.c: creating file '006'
scsi 3:0:0:0: Direct-Access     STT      EXPRESS DUO      1.00 PQ: 0 ANSI: 5
sd 3:0:0:0: [sdb] 30687232 512-byte logical blocks: (15.7 GB/14.6 GiB)
sd 3:0:0:0: [sdb] Write Protect is off
sd 3:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 3:0:0:0: [sdb] No Caching mode page present
sd 3:0:0:0: [sdb] Assuming drive cache: write through
sd 3:0:0:0: [sdb] No Caching mode page present
sd 3:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 3:0:0:0: [sdb] No Caching mode page present
sd 3:0:0:0: [sdb] Assuming drive cache: write through
sd 3:0:0:0: [sdb] Attached SCSI removable disk

When using the PSP kernel http://arago-project.org/git/projects/?p=linux-am33x.git;a=shortlog;h=refs/heads/v3.2-staging the same device will be detected (shows up in lsusb), but no mass storage device will be created:

usb 1-1.4.1: new high-speed USB device number 10 using musb-hdrc
usb 1-1.4.1: default language 0x0409
usb 1-1.4.1: udev 10, busnum 1, minor = 9
usb 1-1.4.1: New USB device found, idVendor=1b8f, idProduct=0305
usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.4.1: Product: EXPRESS DUO
usb 1-1.4.1: Manufacturer: STT
usb 1-1.4.1: SerialNumber: 09021000000211517700000031
usb 1-1.4.1: usb_probe_device
usb 1-1.4.1: configuration #1 chosen from 1 choice
usb 1-1.4.1: adding 1-1.4.1:1.0 (config #1, interface 0)
usb-storage 1-1.4.1:1.0: usb_probe_interface
usb-storage 1-1.4.1:1.0: usb_probe_interface - got id
scsi5 : usb-storage 1-1.4.1:1.0
drivers/usb/core/inode.c: creating file '010'
hub 1-1.4:1.0: state 7 ports 4 chg 0000 evt 0002

Other devices like USB-to-serla converter or 3G modem are working without issues. USB mass storage device connected to USB0 (OTG) is working too, so all drivers are there.

Any idea?

Yegor

  • If I move  pm_runtime_get_sync() to its old place (ti81xx_musb_init()) in the same commit, I have no problems with mass storage devices. But if I apply the same patch to the latest kernel, the system doesn't boot. As I have no console for now accept one using usb-to-serial converter I can't see, where the kernel crashes.

    diff --git a/drivers/usb/musb/ti81xx.c b/drivers/usb/musb/ti81xx.c
    index 946c99e..1479996 100644
    --- a/drivers/usb/musb/ti81xx.c
    +++ b/drivers/usb/musb/ti81xx.c
    @@ -1006,6 +1006,7 @@ int ti81xx_musb_init(struct musb *musb)
            struct omap_musb_board_data *data = plat->board_data;
            u32 rev;
            u8 mode;
    +       int ret;

            if (musb->id < 2)
                    gmusb[musb->id] = musb;
    @@ -1016,6 +1017,12 @@ int ti81xx_musb_init(struct musb *musb)
            if (!musb->xceiv)
                    return -ENODEV;

    +       ret = pm_runtime_get_sync(dev);
    +       if (ret < 0) {
    +               dev_err(dev, "pm_runtime_get_sync FAILED");
    +               return -ENODEV;
    +       }
    +
            /* mentor is at offset of 0x400 in am3517/ti81xx */
            musb->mregs += USB_MENTOR_CORE_OFFSET;

    @@ -1279,11 +1286,6 @@ static int __init ti81xx_probe(struct platform_device *pdev)

            /* enable clocks */
            pm_runtime_enable(&pdev->dev);
    -       ret = pm_runtime_get_sync(&pdev->dev);
    -       if (ret < 0) {
    -               dev_err(dev, "pm_runtime_get_sync FAILED");
    -               goto err2;
    -       }

            /* usb subsystem init */
            usbotg_ss_init();

  • Hi

    Do you observe this issue in PIO mode or DMA mode?

    Regards

    Ravi B

  • Hi Ravi,

    in both DMA and PIO modes.

    Yegor

  • Hi Ravi,

    I received AM335x Starter Kit today and made USB mass storage tests.

    With a Starter Kit kernel (compiled on Jun 2012) the USB stick will be detected as mass storage device and sda/sda1 devices will be created.

    With the latest v3.2-staging kernel including the recent changes from 29 Jan 2013 USB drive was only detected on USB level, as I already reported.

    Could you please make a test and confirm my observations?

    Thanks.

    Yegor

  • I see the issue in the  "ti-sdk-am335x-evm-05.07.00.00" which has a "linux-3.2.0-psp04.06.00.10" as well. If the above mentioned change is applied, the linux does not boot any more. Anyone has a fix or knows what's going on there? Thanks.

  • Has the issue only happened with your 'STT' USB drive? Have you tried with different USB thumb drives?

    I have no MSC enumeration issue on my Starter Kit with SDK 5.07 kernel.

  • Yes, I did try other USB drive and it does not work either.

  • Has there been any resolution on this issue?  I'm having the same problem with PSP 04.06.00.07.  USB Mass storage device work fine with the controller set to OTG, but USB Mass Storage devices do not work with the USB controller set to HOST.

    Does this issue persist in newer PSP versions?

  • USB is working properly in the latest vanilla kernel 3.14 using device tree. But I can imagine, that the official TI's PSP 3.12 should also work.