From owner-freebsd-current@freebsd.org Wed Mar 17 04:18:10 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 EEE85578BA8 for ; Wed, 17 Mar 2021 04:18:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0cMk6Y12z4byw; Wed, 17 Mar 2021 04:18:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from odin.corp.delphij.net (unknown [IPv6:2601:646:8601:f4a:b8cf:2687:e870:beea]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1480FCB13; Wed, 17 Mar 2021 04:18:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Subject: Re: ThinkPad: reboots after successful shutdown -p To: d@delphij.net, freebsd-current@freebsd.org Cc: jkim@freebsd.org, cem@FreeBSD.org, marcel@freebsd.org, Warner Losh , byuu@tutanota.com, interloper255@gmail.com References: From: Xin Li Organization: The FreeBSD Project Message-ID: Date: Tue, 16 Mar 2021 21:18:08 -0700 User-Agent: Thunderbird MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 04:18:11 -0000 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... Cheers,