From owner-freebsd-current@freebsd.org Wed Mar 17 09:38:30 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D11725A8117 for ; Wed, 17 Mar 2021 09:38:30 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0lTL3C38z3Blt for ; Wed, 17 Mar 2021 09:38:29 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (115-38-180-10.area1c.commufa.jp [115.38.180.10]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 12H9c7aW074787; Wed, 17 Mar 2021 18:38:08 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Wed, 17 Mar 2021 18:38:07 +0900 From: Tomoaki AOKI To: freebsd-current@freebsd.org Cc: d@delphij.net Subject: Re: ThinkPad: reboots after successful shutdown -p Message-Id: <20210317183807.bde5bf91cd431a9548abc0c0@dec.sakura.ne.jp> In-Reply-To: <53e336e7-1b08-5ebf-27a2-de7ca756024c@delphij.net> References: <53e336e7-1b08-5ebf-27a2-de7ca756024c@delphij.net> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4F0lTL3C38z3Blt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 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: Wed, 17 Mar 2021 09:38:30 -0000 On Wed, 17 Mar 2021 00:01:49 -0700 Xin Li via freebsd-current wrote: > > > On 3/16/21 9:45 PM, Warner Losh wrote: > > > > > > On Tue, Mar 16, 2021 at 10:18 PM Xin Li > > wrote: > > > > On 11/17/19 23:14, Xin Li wrote: > > > Hi, > > > > > > I recently noticed that if I do a 'shutdown -p' from -CURRENT, the > > > system would shut down and seemingly powered off, then it would > > restart > > > after about 5-10 seconds. > > > > > > Is this a known issue?〓 Arguably this is not necessarily a FreeBSD > > > issue, but it seems that the Windows 10 installation doesn't have the > > > problem, so I guess there might be some difference between our and > > > Windows's shutdown sequence. > > > > I've found a workaround for this, for the record, setting > > hw.efi.poweroff=0 would make the laptop to correctly shutdown. > > > > However I don't see anything wrong with sys/dev/efidev/efirt.c's > > implementation of EFI shutdown; it appears to be essentially the same as > > implemented in command_poweroff() in stand/efi/loader/main.c, but > > 'poweroff' would work just fine in loader.efi. > > > > Can someone familiar with the code shed me some light here? :-) > > > > It looks like what Linux did was to prefer ACPI S5, unless it's not > > available or the system have HW_REDUCED flag in FADT, so if we do > > something similar it would fix the issue for me, but according to > > bugs.freebsd.org/233998 that's not > > the case for at least Conor's system > > (_S5 appears to be in the ACPI dump), so I think it's something else... > > > > > > For me, interrupt storm on shutdown has been the causes of issues like > > this... > > > > Any chance you can eliminate that as a possibility? > > Hmm, that's a good question -- is there a way to tell after the screen > was turned off? > > Before the screen was turned off, there doesn't appear to be interrupt > storm. The system was performing a typical FreeBSD shutdown procedure: > All buffers synced, showed uptime, destroyed GELI devices, spin down the > SATA devices, shutdown the cardreader (rtsx0), detached all USB devices > (hidraw1, hidbus, usbhid1, ubt0, uhub0), screen turned slightly red for > a very brief period (maybe side effect of turning off the backlight), > then goes off. > > I think most of FreeBSD drivers would turn off interrupt from the device > before detaching, but I haven't looked into all of my devices; but from > what I have seen on screen (captured a 60fps video and can share if that > helps), there doesn't appear to be an interrupt storm before that. > > Cheers, > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > Hi. Unclear if it's related or not, but my ThinkPad P52 often refuses keyboard input on loader.efi and boot1.efi (boot1.efi as bootx64.efi). In such cases, I need (typically) one or more power cycle to go into single user mode with updated kernel (for installword). Also experienced unintended auto-reboot-after-poweroff on P52, but only once, currently. I suspect some hardware with no FreeBSD driver can trigger interrupt storm because of the lack of proper initialization and detach. IIRC, my old ThinkPad T420 didn't have the problem. So possibly UEFI firmware issue. Regards. -- Tomoaki AOKI