FAQ:[#6001] Problem with USB after resume from hibernate(2010)

Document created by Aaronwu Employee on Sep 10, 2013
Version 1Show Document
  • View in full screen mode

[#6001] Problem with USB after resume from hibernate

Submitted By: Andrew Fomushkin

Open Date

2010-04-09 03:15:18    

Priority:

Medium     Assignee:

Vivi Li

Bob Liu

Status:

Open     Fixed In Release:

N/A

Found In Release:

2009R1.1-RC4     Release:

Category:

Drivers     Board:

Custom

Processor:

BF527     Silicon Revision:

0.2

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

2009R1.1

App binary format:

N/A     

Summary: Problem with USB after resume from hibernate

Details:

 

I'am using out custom board based on BF527-0.2, USB configured as gadget only, using PIO, when I sending to sleep my board by command

 

echo mem > /sys/power/state

 

all went ok, now when board resume from sleep by RTC, PG15 (it's no matter) all peripherial working except USB.

When I now hotplug USB there is no reaction on host and on board.

 

P.S. In ADSP-BF52x Blackfin Processor Hardware Reference (Volume 2 of 2) Preliminary Revision 0.3 on page 26-43 I found that driver need to manipulate USB_APHY_CNTRL2 register to resume from hibernate properly, there is no such code in kernel.

 

Follow-ups

 

--- Andrew Fomushkin                                         2010-05-18 03:14:21

Interesting commit in mainline

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4f712e010b2da1cc01c178922f2eb5aaeae461b6

 

--- Vivi Li                                                  2010-07-02 01:18:19

I can replicate this bug with both pio and dma modes. Steps refer to test

power_usbdev.

 

standby is OK, mem will fail.

 

--

root:/> dd if=/dev/zero of=fsg.block bs=1M count=16

16+0 records in

16+0 records out

root:/> modprobe g_file_storage file=/fsg.block stall=0

g_file_storage gadget: File-backed Storage Gadget, version: 20 November 2008

g_file_storage gadget: Number of LUNs=1

g_file_storage gadget-lun0: ro=0, file: /fsg.block

root:/> g_file_storage gadget: high speed config #1

lsmod

Module                  Size  Used by

g_file_storage         18779  0

root:/>

 

uclinux63-527-usbdev:/root # ls /dev/sdc

/dev/sdc

uclinux63-527-usbdev:/root # time fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF

disklabel

Building a new DOS disklabel with disk identifier 0xa1092164.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (2-1024, default 2):

Using default value 2

Last cylinder or +size or +sizeM or +sizeK (2-1024, default 1024):

Using default value 1024

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

 

real    0m8.209s

user    0m0.000s

sys     0m0.008s

uclinux63-527-usbdev:/root #

uclinux63-527-usbdev:/root # mke2fs /dev/sdc1

mke2fs 1.40.8 (13-Mar-2008)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

4096 inodes, 16368 blocks

818 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=16777216

2 block groups

8192 blocks per group, 8192 fragments per group

2048 inodes per group

Superblock backups stored on blocks:

        8193

 

Writing inode tables: done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 23 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

uclinux63-527-usbdev:/root # mount -t ext2 -o sync /dev/sdc1 /mnt/usb

uclinux63-527-usbdev:/root # time dd if=/dev/zero of=/mnt/usb/10m.bin bs=1M

count=10

Fri Jul  2 11:37:44 CST 2010

10+0 records in

10+0 records out

10485760 bytes (10 MB) copied, 41.694 s, 251 kB/s

 

real    0m41.713s

user    0m0.000s

sys     0m0.424s

Fri Jul  2 11:38:26 CST 2010

uclinux63-527-usbdev:/root # time cat /mnt/usb/10m.bin > /dev/null

 

real    0m0.007s

user    0m0.000s

sys     0m0.004s

uclinux63-527-usbdev:/root # ls -l /mnt/usb

total 10293

-rw-r--r-- 1 root root 10485760 Jul  2 11:38 10m.bin

drwx------ 2 root root    12288 Jul  2 11:37 lost+found

uclinux63-527-usbdev:/root # umount /mnt/usb

uclinux63-527-usbdev:/root #

 

 

root:/> rtcwake -s 10 -m mem

wakeup from "mem" at Thu Feb 26 00:31:25 1970

PM: Syncing filesystems ... done.

Freezing user space processes ... (elapsed 0.01 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

Suspending console(s) (use no_console_suspend to debug)

PM: suspend of devices complete after 924.000 msecs

PM: late suspend of devices complete after 0.001 msecs

PM: early resume of devices complete after 0.001 msecs

PM: resume of devices complete after 0.001 msecs

Restarting tasks ... done.

 

root:/> lsmod

Module                  Size  Used by

g_file_storage         18779  0

 

uclinux63-527-usbdev:/root # mount -t ext2 -o sync /dev/sdc1 /mnt/usb

mount: special device /dev/sdc1 does not exist

uclinux63-527-usbdev:/root #

--

 

--- Bob Liu                                                  2010-07-28 05:15:51

fixed by adding musb_platform_restore_context() implemention.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes