From owner-freebsd-current@freebsd.org Wed Mar 17 04:45:50 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 E4DA95799FF for ; Wed, 17 Mar 2021 04:45:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0czf5tTQz4dwJ for ; Wed, 17 Mar 2021 04:45:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82f.google.com with SMTP id 94so584336qtc.0 for ; Tue, 16 Mar 2021 21:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ytbEkdNnXgIU2uN0fyN1rGIYnF2ZjDjOCKNFTm9NRRo=; b=pyHCqCtKmZbv56h95U+Q8QiaipTeLFKOseGxAuWsc+QYHCxQNZJeE9uf7V92aSTXRC 3GO9OuZweA7Xc5DPTiR/wkFXUqb0NGX6qpfnw1J8VOo2mp2kSlBzsfRdS1oeza0G93F4 gj3kN59Fd/Vbbfw8fHeIRXy5q92gEgrqQ+LMOU3ykppM7rZ3upTXRxeyzBm8ZvSVp4Hz gMpejtyYt42Dmyb7x55BChvaOVHSR0O56hUlR8nzAcjH8K4UGGoPm4YGGcouq+6u0kdx T5swItYJ01Oj3roiOUAmwZyWovgeZJXMjIgKRIQKDPqLAI6VNwOPkrYYFwynsWcrp1cG 4vrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ytbEkdNnXgIU2uN0fyN1rGIYnF2ZjDjOCKNFTm9NRRo=; b=MqTwza5ywKh/qlWquq3M1zD3s1h7T2RNpnItFy18bXCKOcVLJGJWTF+O4aXY0PMy1a Gft1cA6p1zDiJwc2OzP5/6nymF4n3+uStmWsrSeecEswoIHjnPEgZuMk+jzjCkiRmG09 QfhOoy3Ua1HNcNkzW1QNcJr64fGKRX6b44JQ0YIQlVphnxoEmyYvpqYDRDZ8Y7MeWeC9 iapjQlQOMteyQqTRMpwByCHaTKC9qSI04pZRG7ZqdjcJtHewl7zmX4cr4H8515mTOx0z 3JUbTUBOHcjjjWxe3pBtbrtVgt0mYYoc9mQ5xC7DsVoMcx7v95ZgIX8WZjEXjXg5JIeK +fvw== X-Gm-Message-State: AOAM530vcgZDEJAoJg6QL3vHNtkrl+/Zv2xP4lg3Hmdk1VUXmqizUkT7 SINxJ6UKGp3GHCn8FNasBEjpXQvtrospfZifRr1NnA== X-Google-Smtp-Source: ABdhPJybwMGk+BRjP8uw8WmY54MgYOBltmLvi4bLyterN/RiE0hZ3RaFm0DNiFI7G17vp8k3pluNwEYwoe0AtNMayiw= X-Received: by 2002:ac8:6787:: with SMTP id b7mr2225099qtp.244.1615956349891; Tue, 16 Mar 2021 21:45:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Tue, 16 Mar 2021 22:45:38 -0600 Message-ID: Subject: Re: ThinkPad: reboots after successful shutdown -p To: Xin Li Cc: Xin LI , FreeBSD Current , Jung-uk Kim , "Conrad E. Meyer" , Marcel Moolenaar , Warner Losh , byuu@tutanota.com, interloper255@gmail.com X-Rspamd-Queue-Id: 4F0czf5tTQz4dwJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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:45:51 -0000 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? Warner