From owner-freebsd-current@FreeBSD.ORG Tue Sep 30 05:48:20 2014 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A35C51; Tue, 30 Sep 2014 05:48:20 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 24065DE1; Tue, 30 Sep 2014 05:48:18 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA16503; Tue, 30 Sep 2014 08:48:10 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XYqIE-000Fpw-2i; Tue, 30 Sep 2014 08:48:10 +0300 Message-ID: <542A43E1.5010401@FreeBSD.org> Date: Tue, 30 Sep 2014 08:47:13 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: FreeBSD Current Subject: vt_suspend / vt_resume Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 05:48:20 -0000 I think that currently vt_suspend / vt_resume are called at quite unsuitable times. For example, vt_suspend performs a vt switch which requires cooperation from an X server, but that could be problematic given that some devices may already be suspended. I believe that it is better to do what sc(4) does and use power_suspend / power_resume event handlers instead of device_suspend / device_resume methods. power_suspend event is posted when a kernel has not entered any special state yet. What do you think? -- Andriy Gapon