Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-02-06 Thread David Wolfskill
[Closing the loop on this -- dhw]

On Tue, Jan 30, 2024 at 06:49:32AM -0800, David Wolfskill wrote:
> The machines where I track head (& stable/14) daily get powered off once
> they have finished their work for the day; this is done via "poweroff".
>  ...
> | 
> | The operating system has halted.
> | Please press any key to reboot.
> 
> So I hit "Enter" and then saw:
> 
> | 
> | acpi0: Powering system off
> 

As of main-n268079-e4ab361e5394, this is resolved.

See also the thread starting with
https://lists.freebsd.org/archives/dev-commits-src-main/2024-February/021637.html,
"git: e4ab361e5394 - main - fix poweroff regression from 9cdf326b4f by
delaying shutdown_halt"

Thanks, Andriy! :-)

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Do these ends really justify those means?

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-31 Thread Warner Losh
On Wed, Jan 31, 2024, 6:53 AM Mike Karels  wrote:

>
>
> On 31 Jan 2024, at 7:18, Olivier Cochard-Labbé wrote:
>
>
> On Tue, Jan 30, 2024 at 3:50 PM David Wolfskill 
> wrote:
>
>> The machines where I track head (& stable/14) daily get powered off once
>> they have finished their work for the day; this is done via "poweroff".
>>
>> I noticed (this morning) that one of them never actually powered off
>> yesterday.  After today's exercises (including the reboot & subsequent
>> poweroff), I saw on the (serial) console:
>>
>>
> Same problem here.
>
>
> I would check 9cdf326b4faef97f0d3314b5dd693308ac494d48, it changed
> shutdown ordering
>

Yea. Almost certainly. I think David is testing a patch from A


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-31 Thread David Wolfskill
On Wed, Jan 31, 2024 at 07:53:07AM -0600, Mike Karels wrote:
> On 31 Jan 2024, at 7:18, Olivier Cochard-Labbé wrote:
> ... 
> > Same problem here.
> 
> I would check 9cdf326b4faef97f0d3314b5dd693308ac494d48, it changed
> shutdown ordering.
> 

Yes; I have been corresponding with Andriy, and have confirmed that
backing out that change restores the previous behavior.

He's looking at some additional things, but he can speak to that.

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Do these ends really justify those means?

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-31 Thread Mike Karels


On 31 Jan 2024, at 7:18, Olivier Cochard-Labbé wrote:

> On Tue, Jan 30, 2024 at 3:50 PM David Wolfskill 
> wrote:
>
>> The machines where I track head (& stable/14) daily get powered off once
>> they have finished their work for the day; this is done via "poweroff".
>>
>> I noticed (this morning) that one of them never actually powered off
>> yesterday.  After today's exercises (including the reboot & subsequent
>> poweroff), I saw on the (serial) console:
>>
>>
> Same problem here.

I would check 9cdf326b4faef97f0d3314b5dd693308ac494d48, it changed
shutdown ordering.

Mike

Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-31 Thread Olivier Cochard-Labbé
On Tue, Jan 30, 2024 at 3:50 PM David Wolfskill 
wrote:

> The machines where I track head (& stable/14) daily get powered off once
> they have finished their work for the day; this is done via "poweroff".
>
> I noticed (this morning) that one of them never actually powered off
> yesterday.  After today's exercises (including the reboot & subsequent
> poweroff), I saw on the (serial) console:
>
>
Same problem here.


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread Gary Jennejohn
On Tue, 30 Jan 2024 08:12:23 -0800
David Wolfskill  wrote:

> On Tue, Jan 30, 2024 at 03:49:54PM +, Gary Jennejohn wrote:
> > ...
> > I use 'shutdown -p now' and it's never failed to power down my computers.
> > 
>
> I could say the same about "poweroff", up to the main-n267808-197944948e62
> -> main-n267841-0b3f9e435f2b transition.  And I probably wouldn't
> have mentioned anything, except that each of the 3 machines (one
> headless build machine; 2 laptops) I tested exhibited the same change.
>
> Note, too, from src/sbin/shutdown/shutdown.c:
>
> /*
>  * Test for the special case where the utility is called as
>  * "poweroff", for which it runs 'shutdown -p now'.
>  */
> if ((p = strrchr(argv[0], '/')) == NULL)
> p = argv[0];
> else
> ++p;
> if (strcmp(p, "poweroff") == 0) {
> if (getopt(argc, argv, "") != -1)
> usage((char *)NULL);
> argc -= optind;
> argv += optind;
> if (argc != 0)
> usage((char *)NULL);
> dopower = 1;
> offset = 0;
> (void)time();
> goto poweroff;
>
> (So I believe we are referring to the same code paths, whether by
> "shutdown -p now" or "poweroff".)
>

Interesting, I wasn't aware of this.  Reading shutdown(8) I see that
poweroff is equivalent to shutdown -p now.  Thanks!

--
Gary Jennejohn



Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread David Wolfskill
On Tue, Jan 30, 2024 at 03:49:54PM +, Gary Jennejohn wrote:
> ...
> I use 'shutdown -p now' and it's never failed to power down my computers.
> 

I could say the same about "poweroff", up to the main-n267808-197944948e62
-> main-n267841-0b3f9e435f2b transition.  And I probably wouldn't
have mentioned anything, except that each of the 3 machines (one
headless build machine; 2 laptops) I tested exhibited the same change.

Note, too, from src/sbin/shutdown/shutdown.c:

/*
 * Test for the special case where the utility is called as
 * "poweroff", for which it runs 'shutdown -p now'.
 */
if ((p = strrchr(argv[0], '/')) == NULL)
p = argv[0];
else
++p;
if (strcmp(p, "poweroff") == 0) {
if (getopt(argc, argv, "") != -1)
usage((char *)NULL);
argc -= optind;
argv += optind;
if (argc != 0)
usage((char *)NULL);
dopower = 1;
offset = 0;
(void)time();
goto poweroff;

(So I believe we are referring to the same code paths, whether by
"shutdown -p now" or "poweroff".)

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Do these ends really justify those means?

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread Gary Jennejohn
On Tue, 30 Jan 2024 07:10:45 -0800
David Wolfskill  wrote:

> On Tue, Jan 30, 2024 at 03:56:16PM +0100, Tomek CEDRO wrote:
> > On Tue, Jan 30, 2024 at 3:49?PM David Wolfskill wrote:
> > > The machines where I track head (& stable/14) daily get powered off once
> > > they have finished their work for the day; this is done via "poweroff".
> > >
> > > I noticed (this morning) that one of them never actually powered off
> > > yesterday.  After today's exercises (including the reboot & subsequent
> > > poweroff), I saw on the (serial) console:
> >
> > Have you tried hw.efi.poweroff=0 in /boot/loader.conf ? :-)
> > 
>
> No; I don't mess with /boot/*.conf without a (plausibly good) reason.  :-)
>
> But I can experiment... so I'm trying it now.
> ...
> Hmm... I don't see any difference in behavior.
>
> These systems each boot using BIOS (vs. UEFI), in case that's relevant.
>

I use 'shutdown -p now' and it's never failed to power down my computers.

--
Gary Jennejohn



Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread David Wolfskill
On Tue, Jan 30, 2024 at 03:56:16PM +0100, Tomek CEDRO wrote:
> On Tue, Jan 30, 2024 at 3:49 PM David Wolfskill wrote:
> > The machines where I track head (& stable/14) daily get powered off once
> > they have finished their work for the day; this is done via "poweroff".
> >
> > I noticed (this morning) that one of them never actually powered off
> > yesterday.  After today's exercises (including the reboot & subsequent
> > poweroff), I saw on the (serial) console:
> 
> Have you tried hw.efi.poweroff=0 in /boot/loader.conf ? :-)
> 

No; I don't mess with /boot/*.conf without a (plausibly good) reason.  :-)

But I can experiment... so I'm trying it now.
...
Hmm... I don't see any difference in behavior.

These systems each boot using BIOS (vs. UEFI), in case that's relevant.

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Do these ends really justify those means?

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: 'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread Tomek CEDRO
On Tue, Jan 30, 2024 at 3:49 PM David Wolfskill wrote:
> The machines where I track head (& stable/14) daily get powered off once
> they have finished their work for the day; this is done via "poweroff".
>
> I noticed (this morning) that one of them never actually powered off
> yesterday.  After today's exercises (including the reboot & subsequent
> poweroff), I saw on the (serial) console:

Have you tried hw.efi.poweroff=0 in /boot/loader.conf ? :-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



'poweroff' seems to (only) halt as of main-n267841-0b3f9e435f2b

2024-01-30 Thread David Wolfskill
The machines where I track head (& stable/14) daily get powered off once
they have finished their work for the day; this is done via "poweroff".

I noticed (this morning) that one of them never actually powered off
yesterday.  After today's exercises (including the reboot & subsequent
poweroff), I saw on the (serial) console:

| ...
| unknown: wake_prep disabled wake for \_SB_.PCI3.SR3A (S5)
| unknown: wake_prep disabled wake for \_SB_.PCI3.SR3B (S5)
| unknown: wake_prep disabled wake for \_SB_.PCI3.SR3C (S5)
| unknown: wake_prep disabled wake for \_SB_.PCI3.SR3D (S5)
| 
| The operating system has halted.
| Please press any key to reboot.

So I hit "Enter" and then saw:

| 
| acpi0: Powering system off

(and heard the fans stop spinning).

And that recurred this morning.

So I believe that the issue arose in the transition from what the
machine had built on Sunday:

FreeBSD 15.0-CURRENT #36 main-n267808-197944948e62: Sun Jan 28 16:22:34 UTC 
2024 
r...@freebeast.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC 
amd64 1500012 1500012

to what it built on Monday:

FreeBSD 15.0-CURRENT #37 main-n267841-0b3f9e435f2b: Mon Jan 29 12:17:47 UTC 
2024 
r...@freebeast.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC 
amd64 1500012 1500012

Glancing at the typescript from Monday's update/build
(197944948e62..0b3f9e435f2b), it looks to me as if there was a fair
amount of "churn" in boot-related code, so I will look further into
that as time permits.

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
Do these ends really justify those means?

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature