From owner-svn-src-all@FreeBSD.ORG Sat Aug 30 17:58:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB338121; Sat, 30 Aug 2014 17:58:36 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C141C151A; Sat, 30 Aug 2014 17:58:36 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DA540B95D; Sat, 30 Aug 2014 13:58:34 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Sat, 30 Aug 2014 13:58:20 -0400 Message-ID: <58768837.sIF65g1iXL@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201408301748.s7UHmc6H059701@svn.freebsd.org> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 30 Aug 2014 13:58:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2014 17:58:37 -0000 On Saturday, August 30, 2014 05:48:38 PM John Baldwin wrote: > Author: jhb > Date: Sat Aug 30 17:48:38 2014 > New Revision: 270850 > URL: http://svnweb.freebsd.org/changeset/base/270850 > > Log: > Save and restore FPU state across suspend and resume. In earlier > revisions of this patch, resumectx() called npxresume() directly, but that > doesn't work because resumectx() runs with a non-standard %cs selector. > Instead, all of the FPU suspend/resume handling is done in C. This mostly fixes suspend and resume in X on a little 32-bit only netbook I have. I needed an additional patch to the i915 code to prevent it from tearing down its interrupt handler in suspend and re-establishing it during resume (this sort of thing is not needed in drivers and isn't safe because suspend runs pinned to CPU 0 and unregistering an interrupt needs to bind to the CPU the IDT vector is assigned to). --- //depot/vendor/freebsd/src/sys/dev/drm2/i915/i915_drv.c +++ //depot/user/jhb/acpipci/dev/drm2/i915/i915_drv.c @@ -253,7 +253,9 @@ "GEM idle failed, resume might fail\n"); return (error); } +#if 0 drm_irq_uninstall(dev); +#endif } i915_save_state(dev); @@ -315,7 +317,9 @@ sx_xlock(&dev->mode_config.mutex); drm_mode_config_reset(dev); sx_xunlock(&dev->mode_config.mutex); +#if 0 drm_irq_install(dev); +#endif sx_xlock(&dev->mode_config.mutex); /* Resume the modeset for every activated CRTC */ Even with that my one attempt at resuming in X so far seemed to hang in X (though the machine was fine and worked fine aside from X hanging). Curiously, this netbook is able to suspend/resume just fine on the console with syscons(4), but the LCD is not turned back on if I suspend/resume with vt(4) using the VGA driver. I think vt(4) should do some of the VESA stuff for suspend/resume syscons does when using vt_vga (but not when using one of the KMS backends). -- John Baldwin