Re: Suspend/Resume and USB filesystems

2014-01-03 Thread Theo de Raadt
>I can make sure that I unmount any externally mounted filesystems
>before suspending. Seeing as it's not going to be easy to fix, the
>man page for apm/zzz/ZZZ should probably mention that suspending
>while a filesystem is mounted is not supported.
>  
I do not see the need for such a piece of documentation.  It is not
the filesystem which goes away, it is that devices known to not
be part of the machine are detached.  Upon resume, we have no way
of verifying they are the same and placing them in the same
configuration.  It is an obvious mechanism.



Re: Suspend/Resume and USB filesystems

2014-01-03 Thread Helg Bredow

> Date: Thu, 2 Jan 2014 21:16:53 -0800
> From: mlar...@azathoth.net
> To: t...@tedunangst.com
> CC: xx...@msn.com; misc@openbsd.org
> Subject: Re: Suspend/Resume and USB filesystems
>
> On Fri, Jan 03, 2014 at 12:13:05AM -0500, Ted Unangst wrote:
>> On Fri, Jan 03, 2014 at 09:17, Helg Bredow wrote:
>>> I've been running OpenBSD 5.4 off a USB stick and couldn't get
>>> suspend/resume to work on either of my laptops. I thought maybe it was a
>>> driver issue but I've now installed the latest snapshot to the internal
>>> HDD and suspend/resume seems to be working fine. However, suspend causes a
>>> detach of the whole ugen to umass stack to detach so any mounted USB
>>> filesytems end up in an unclean state. This is probably what was causing
>>> it to fail when booting off USB.
>>>
>>> Is there anything that I need to configure in order to prevent this from
>>> happening?
>>
>> I don't think there's anything you can do. That's how the kernel does
>> things (detach usb, reattach).
>>
>> We could:
>> 1. postpone the device detach until after resume, and then only detach
>> devices which are actually missing. I'm not sure how much madness this
>> would involve.
>> 2. postpone forced filesystem unmount until after resume to see if the
>> disk comes back. I'm fairly certain this will involve a lot of madness.
>>
>
> This is not likely going to be fixed in any near timeframe. It's just too
> much headache.
>
> -ml
>
I can make sure that I unmount any externally mounted filesystems
before suspending. Seeing as it's not going to be easy to fix, the
man page for apm/zzz/ZZZ should probably mention that suspending
while a filesystem is mounted is not supported. 
  



Re: Suspend/Resume and USB filesystems

2014-01-02 Thread Mike Larkin
On Fri, Jan 03, 2014 at 12:13:05AM -0500, Ted Unangst wrote:
> On Fri, Jan 03, 2014 at 09:17, Helg Bredow wrote:
> > I've been running OpenBSD 5.4 off a USB stick and couldn't get
> > suspend/resume to work on either of my laptops. I thought maybe it was a
> > driver issue but I've now installed the latest snapshot to the internal
> > HDD and suspend/resume seems to be working fine. However, suspend causes a
> > detach of the whole ugen to umass stack to detach so any mounted USB
> > filesytems end up in an unclean state. This is probably what was causing
> > it to fail when booting off USB.
> > 
> > Is there anything that I need to configure in order to prevent this from
> > happening?
> 
> I don't think there's anything you can do. That's how the kernel does
> things (detach usb, reattach).
> 
> We could:
> 1. postpone the device detach until after resume, and then only detach
> devices which are actually missing. I'm not sure how much madness this
> would involve.
> 2. postpone forced filesystem unmount until after resume to see if the
> disk comes back. I'm fairly certain this will involve a lot of madness.
> 

This is not likely going to be fixed in any near timeframe. It's just too
much headache.

-ml



Re: Suspend/Resume and USB filesystems

2014-01-02 Thread Ted Unangst
On Fri, Jan 03, 2014 at 09:17, Helg Bredow wrote:
> I've been running OpenBSD 5.4 off a USB stick and couldn't get
> suspend/resume to work on either of my laptops. I thought maybe it was a
> driver issue but I've now installed the latest snapshot to the internal
> HDD and suspend/resume seems to be working fine. However, suspend causes a
> detach of the whole ugen to umass stack to detach so any mounted USB
> filesytems end up in an unclean state. This is probably what was causing
> it to fail when booting off USB.
> 
> Is there anything that I need to configure in order to prevent this from
> happening?

I don't think there's anything you can do. That's how the kernel does
things (detach usb, reattach).

We could:
1. postpone the device detach until after resume, and then only detach
devices which are actually missing. I'm not sure how much madness this
would involve.
2. postpone forced filesystem unmount until after resume to see if the
disk comes back. I'm fairly certain this will involve a lot of madness.



Suspend/Resume and USB filesystems

2014-01-02 Thread Helg Bredow
I've been running OpenBSD 5.4 off a USB stick and couldn't get suspend/resume 
to work on either of my laptops. I thought maybe it was a driver issue but I've 
now installed the latest snapshot to the internal HDD and suspend/resume seems 
to be working fine. However, suspend causes a detach of the whole ugen to umass 
stack to detach so any mounted USB filesytems end up in an unclean state. This 
is probably what was causing it to fail when booting off USB.

Is there anything that I need to configure in order to prevent this from 
happening?

Thanks,
helg