From owner-freebsd-stable@freebsd.org Wed Jul 29 21:53:01 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E909AE475 for ; Wed, 29 Jul 2015 21:53:01 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4404FD8; Wed, 29 Jul 2015 21:53:01 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by obnw1 with SMTP id w1so17566915obn.3; Wed, 29 Jul 2015 14:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0NLL4XfqHJmFEpn9TNy9JX1mOzaiKfh2K5tEUiHozjs=; b=QwxTY/O2+8teJMQrvAexhAfRcuPNuZztJG4WZGGEi2d9IxlC1qqpCzNiWqWsFnt3e0 yUzJCHDFEBObu6XAlyss9UJC8PHaJasgtUPjgAPzenB+2OHtk15rKL0OIfssK+nfs4Og mx8N31/Usa78yvHsUI5mZDvmtDPWLeG5Vp7XosXIKjDvPgGIQtWli2orPfQBOalUog2S X07uNVj9Qzg1Y4NYcxp1FLEk2hLmoslGdDV+lgptDTOkem9Uyim9NtjscpenQOCZ+EvP xa2nw7JdnvkeaJnn8qJrj2IkTwEuIoNOuZrzse/WD5ABaWaTrc8EafO+kx2maWLzjg6s jvxg== MIME-Version: 1.0 X-Received: by 10.182.186.2 with SMTP id fg2mr44456389obc.35.1438206781104; Wed, 29 Jul 2015 14:53:01 -0700 (PDT) Sender: kob6558@gmail.com Received: by 10.202.221.69 with HTTP; Wed, 29 Jul 2015 14:53:00 -0700 (PDT) In-Reply-To: <55B8CE0C.6040000@orange.fr> References: <86oak289hv.fsf@gly.ftfl.ca> <86oaj9dnbo.fsf@gly.ftfl.ca> <12509399.h3RdpFfE1l@ralph.baldwin.cx> <55B8CE0C.6040000@orange.fr> Date: Wed, 29 Jul 2015 14:53:00 -0700 X-Google-Sender-Auth: F_FQVOWxziPzYEHQCf4Ow1XMR38 Message-ID: Subject: Re: suspend/resume regression From: Kevin Oberman To: Claude Buisson Cc: John Baldwin , Joseph Mingrone , Adrian Chadd , FreeBSD-STABLE Mailing List , "Brandon J. Wandersee" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2015 21:53:02 -0000 On Wed, Jul 29, 2015 at 5:58 AM, Claude Buisson wrote: > On 07/26/2015 00:54, Kevin Oberman wrote: > >> John, >> >> I'm concerned that two issues may be getting conflated. >> >> The issue I thought we were looking at was the failure of some systems >> (T520, X220, T430) to resume after a number of PCI enhancements were >> MFCed. >> This is completely unrelated to the USB issue I was experiencing when >> trying to test the problem on HEAD. The more I think about it, the more I >> think that the USB "issue" is just how things need to work. >> >> Specifically, if you are booting a full, multi-user system from a USB >> connected drive, suspending and resuming will leave the system in an >> untenable condition that will force a panic. At least I don't see how the >> OS can determine that the disk present on resume is unchanged from that >> present when the system was suspended. Modern disk IDs greatly improve the >> situation, but I am unaware of any way to be sure that a removable drive >> (such as a USB) has not been removed and plugged into some other system >> that might have written to it. My knowledge of such things is very dated, >> going back to my days doing kernel programming about 25-30 year ago on >> VMS, >> so someone may have resolved the issue, but I don't understand exactly >> how. >> I guess that the risk might be low enough to just go ahead and pray that >> nobody did something really, really stupid like unplugging the drive, >> plugging it in elsewhere, and writing to it. >> >> The real issue is just resuming the system after r281874 was MFCed as a >> part of 284034. No USB connected file systems are involved. I m happy to >> see that it has been reverted for 10.2, but clearly, these changes are >> needed down the line and I hope the issue can be resolved well before >> 11.0. >> (This assumes a 10.3 before 11.0 happens next year.) >> >> > I have done some tests on my T530 at r285668 and had some (good and bad) > surprises: > > 0) historically i915kms+drm2 could not be loaded by loader.conf without > locking the machine, but needed to be loaded by rc.conf (kld_list). Now > these modules can be loaded by loader.conf. > > 1) resume does not work with a non patched kernel, but works when the > MFC of r281874 is reverted (i.e. r285863 applied) - in console mode (vt) > and X.org. > > 2) and now is my bad surprise: when i915kms+drm2+iic*+kbdmux are not > loaded at all, suspend works (in console mode of course), but not > resume, both with the nonpatched and the patched kernel. After resume > the screen keeps being black, but the system can be logged to with ssh, > but cannot be powered off nor rebooted from another system. Furthermore > the log shows unidentified _USB_ devices at resume (which never appeared > in any log before): > > Jul 29 12:28:12 watson devd: Executing '/etc/rc.suspend acpi 0x03' > Jul 29 12:28:12 watson acpi: suspend at 20150729 12:28:12 > Jul 29 12:28:37 watson kernel: uhub0: at usbus0, port 1, addr 1 > (disconnected) > Jul 29 12:28:37 watson kernel: uhub1: at usbus1, port 1, addr 1 > (disconnected) > Jul 29 12:28:37 watson kernel: ugen1.2: at usbus1 > (disconnected) > Jul 29 12:28:37 watson kernel: uhub4: at uhub1, port 1, addr 2 > (disconnected) > Jul 29 12:28:37 watson kernel: ugen1.3: > at usbus1 (disconnected) > Jul 29 12:28:37 watson kernel: uhub2: at usbus2, port 1, addr 1 > (disconnected) > Jul 29 12:28:37 watson kernel: ugen2.2: at usbus2 > (disconnected) > Jul 29 12:28:37 watson kernel: uhub3: at uhub2, port 1, addr 2 > (disconnected) > Jul 29 12:28:37 watson kernel: ugen2.3: at usbus2 (disconnected) > Jul 29 12:28:37 watson kernel: ums0: at uhub3, port 5, addr 3 > (disconnected) > Jul 29 12:28:37 watson kernel: acpi0: cleared fixed power button status > Jul 29 12:28:37 watson kernel: em0: link state changed to DOWN > Jul 29 12:28:37 watson kernel: xhci0: Port routing mask set to 0xffffffff > Jul 29 12:28:37 watson kernel: uhub0: <0x8086 XHCI root HUB, class 9/0, > rev 3.00/1.00, addr 1> on usbus0 > Jul 29 12:28:37 watson kernel: uhub1: rev 2.00/1.00, addr 1> on usbus2 > Jul 29 12:28:37 watson kernel: uhub2: rev 2.00/1.00, addr 1> on usbus1 > Jul 29 12:28:38 watson kernel: uhub0: 8 ports with 8 removable, self > powered > Jul 29 12:28:37 watson devd: Executing '/etc/rc.resume acpi 0x03' > Jul 29 12:28:38 watson acpi: resumed at 20150729 12:28:38 > Jul 29 12:28:38 watson kernel: uhub2: 3 ports with 3 removable, self > powered > Jul 29 12:28:38 watson kernel: uhub1: 3 ports with 3 removable, self > powered > Jul 29 12:28:38 watson kernel: em0: link state changed to UP > Jul 29 12:28:38 watson devd: Executing '/etc/rc.d/dhclient quietstart em0' > Jul 29 12:28:39 watson kernel: ugen2.2: at usbus2 > Jul 29 12:28:39 watson kernel: uhub3: class 9/0, rev 2.00/0.00, addr 2> on usbus2 > Jul 29 12:28:39 watson kernel: ugen1.2: at usbus1 > Jul 29 12:28:39 watson kernel: uhub4: class 9/0, rev 2.00/0.00, addr 2> on usbus1 > Jul 29 12:28:40 watson kernel: uhub4: 6 ports with 6 removable, self > powered > Jul 29 12:28:41 watson kernel: uhub3: 8 ports with 8 removable, self > powered > Jul 29 12:28:41 watson kernel: ugen1.3: > at usbus1 > Jul 29 12:28:41 watson devd: Executing 'logger Unknown USB device: > vendor 0x04f2 product 0xb2ea bus uhub4' > Jul 29 12:28:41 watson root: Unknown USB device: vendor 0x04f2 product > 0xb2ea bus uhub4 > Jul 29 12:28:41 watson devd: Executing 'logger Unknown USB device: > vendor 0x04f2 product 0xb2ea bus uhub4' > Jul 29 12:28:41 watson root: Unknown USB device: vendor 0x04f2 product > 0xb2ea bus uhub4 > Jul 29 12:28:41 watson kernel: ugen2.3: at usbus2 > Jul 29 12:28:41 watson devd: Executing 'logger Unknown USB device: > vendor 0x046d product 0xc52b bus uhub3' > Jul 29 12:28:41 watson root: Unknown USB device: vendor 0x046d product > 0xc52b bus uhub3 > Jul 29 12:28:41 watson kernel: ums0: rev 2.00/24.00, addr 3> on usbus2 > Jul 29 12:28:41 watson kernel: ums0: 16 buttons and [XYZT] coordinates ID=2 > Jul 29 12:28:41 watson devd: Executing 'logger Unknown USB device: > vendor 0x046d product 0xc52b bus uhub3' > Jul 29 12:28:41 watson root: Unknown USB device: vendor 0x046d product > 0xc52b bus uhub3 > > I dare say that there is some mess somewhere.. > > 4) last minute tests: I get the same resume problem as 3) supra when > booting from a USB stick with a 11-CURRENT snapshot, both > 20150330-r28086 and 20150722-r285794 (and cannot obtain anything useful > from /var/log/messages) > > Claude Buisson > > I am a bit confused by several things. 0) Yes, I understand that i915 can be loaded at boot time without the display going away, but I am still unclear on why people do this (or force it's loading in any other way). IIRC, before the i915 code was committed to HEAD, the kernel module has auto-loaded when X started. I just "startx". It also loads fine if you use a display manager (gdm, xdm, kdm... )to start X. Is there some special reason that you need the module loaded prior to X starting? 1) Here the confusion starts. You say that resume works as of r285863 after saying that it does not work with an non-patched kernel. These statement seem self-contradictory. Are you saying that after r285863 that other patches are required? Or are you talking about a distributed binary kernel as opposed to STABLE, in which case, yes, you will need to wait until next week for RC2. 2) Yes, I was under the impression that vt(4) would allow suspend/resume to work vtys, but I have also found that to not be the case. I just have not had the time or interest to pursue the issue or even do any real testing. (In other words, I really don't care too much.) 4) This refers to "3)", but I only see 0, 1, 2, and 4. Where did 3 go? Look back in this thread for discussion of the issue. Simply stated, no system can resume successfully when booted from a USB drive. The problem is that, on suspend all USB devices are removed from the system and on resume they are re-created, but there is no way to assure that a device that is present when the system is essentially "OFF" is consistent after it is re-connected. This problem was one that I faced 30 years ago with long dead operating systems (RSX-11D, RSX11-M and IAS) and it has not been resolved in all of those years. Thanks to the fact that all useful drives are now "smart", there is hope that this can be resolved in some way. It is certainly possible to confirm that the same physical drive is available on resume, but it might be on a different device name, so this will likely use gptid or some similar technique to do so. Even then, how can you tell if the drive was moved to another system, written to, and returned to the suspended system before it was restored? Just don't expect it any time soon. It's a really hard problem that used to be an impossible one. I suspect that it will probably always be at least a bit unsafe, as it is today with removable SATA drives. (I can suspend my system, unplug the system disk (on the second spindle on my T520), plug it into another system, modify its contents, and put it back, and resume to a likely disaster. USB just makes this disaster easier. -- Kevin Oberman, Network Engineer, Retired E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683