Skip to contentSkip to conversation

USB sleep & mount

DISCUSSION Rodolfo Giometti 2 participants 2 messages May 23, 2006 MIPS

lore
Share & tools
lore
#0 lore raw

Hello,

I'm working on sleep for USB host on au1x00 CPUs and I have the following problem.

When I put the system to sleep and then it wakes up everything works well _if_ the USB key is not mounted before the sleep. For instance, if I mount partition "/dev/sda1" (first USB key partition) and then go to sleep, at wake up the system forgets device "/dev/sda" and registers a new device "/dev/sdb" so, obviously, the filesystem previously mounted is not accessible anymore.

My question is: is that correct since the userland, before going to sleep, should umount all external filesystems or it's a bug? :)

Thanks,

Rodolfo

Signature · 4 lines
GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127
#1 lore raw
Quoted 8 lines · Rodolfo Giometti

Hello,

When I put the system to sleep and then it wakes up everything works well _if_ the USB key is not mounted before the sleep. For instance, if I mount partition "/dev/sda1" (first USB key partition) and then go to sleep, at wake up the system forgets device "/dev/sda" and registers a new device "/dev/sdb" so, obviously, the filesystem previously mounted is not accessible anymore.

Thats exactly right - USB sleep is a very delicate and broken procedure. Basically, the controller seems to be giving up and re-enumerating everything.

Quoted 2 lines

My question is: is that correct since the userland, before going to sleep, should umount all external filesystems or it's a bug? :)

The userland technically *shouldn't* have to unmount the filesystems, but its the safest option we have - between enumeration issues, and the age old problem of unplugging the external device while in sleep - its just better to unmount the device before heading for nap time (or mount the thing with '-a' so data isn't lost).

Is that ideal? Of course not - but welcome to the wonderful world of USB in Linux.

Jordan