Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Thank God a million billion times you live in Texas.


computers / comp.sys.raspberry-pi / Power pins, aren't they powered down at poweroff/halt?

SubjectAuthor
* Power pins, aren't they powered down at poweroff/halt?Chris Green
`* Re: Power pins, aren't they powered down at poweroff/halt?Theo
 +* Re: Power pins, aren't they powered down at poweroff/halt?Andy Burns
 |`* Re: Power pins, aren't they powered down at poweroff/halt?Andy Burns
 | `* Re: Power pins, aren't they powered down at poweroff/halt?Chris Green
 |  `* Re: Power pins, aren't they powered down at poweroff/halt?Jim Jackson
 |   +* Re: Power pins, aren't they powered down at poweroff/halt?Martin Gregorie
 |   |+* Re: Power pins, aren't they powered down at poweroff/halt?Jim Jackson
 |   ||+- Re: Power pins, aren't they powered down at poweroff/halt?Computer Nerd Kev
 |   ||`* Re: Power pins, aren't they powered down at poweroff/halt?Theo
 |   || +- Re: Power pins, aren't they powered down at poweroff/halt?Jim Jackson
 |   || `* Re: Power pins, aren't they powered down at poweroff/halt?Computer Nerd Kev
 |   ||  `* Re: Power pins, aren't they powered down at poweroff/halt?Theo
 |   ||   `- Re: Power pins, aren't they powered down at poweroff/halt?Computer Nerd Kev
 |   |+* Re: Power pins, aren't they powered down at poweroff/halt?Ahem A Rivet's Shot
 |   ||+- Re: Power pins, aren't they powered down at poweroff/halt?druck
 |   ||+- Re: Power pins, aren't they powered down at poweroff/halt?Martin Gregorie
 |   ||`- Re: Power pins, aren't they powered down at poweroff/halt?The Natural Philosopher
 |   |+- Re: Power pins, aren't they powered down at poweroff/halt?Richard Kettlewell
 |   |`* Re: Power pins, aren't they powered down at poweroff/halt?The Natural Philosopher
 |   | `- Re: Power pins, aren't they powered down at poweroff/halt?Martin Gregorie
 |   `* Re: Power pins, aren't they powered down at poweroff/halt?The Natural Philosopher
 |    `* Re: Power pins, aren't they powered down at poweroff/halt?Andy Burns
 |     `* Re: Power pins, aren't they powered down at poweroff/halt?The Natural Philosopher
 |      `- Re: Power pins, aren't they powered down at poweroff/halt?Theo
 `* Re: Power pins, aren't they powered down at poweroff/halt?Chris Green
  +- Re: Power pins, aren't they powered down at poweroff/halt?Theo
  `* Re: Power pins, aren't they powered down at poweroff/halt?druck
   `- Re: Power pins, aren't they powered down at poweroff/halt?Chris Green

Pages:12
Power pins, aren't they powered down at poweroff/halt?

<rg114k-6r5.ln1@esprimo.zbmc.eu>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8127&group=comp.sys.raspberry-pi#8127

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl@isbd.net (Chris Green)
Newsgroups: comp.sys.raspberry-pi
Subject: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 13:41:15 +0000
Lines: 14
Message-ID: <rg114k-6r5.ln1@esprimo.zbmc.eu>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net ToOGKO4mcXswKOvJq60HFwdC26ZGhxX/3L4707IlOkuQAhAjE=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:2u+xjiUm0nD/WKXFTZsIAfTLMtQ= sha256:+6Vcqw08VampIOZwMbL4BrmBJqRkGbnDp8INeda+ZbM=
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-89-generic (x86_64))
 by: Chris Green - Mon, 4 Dec 2023 13:41 UTC

I'm amazed. It would appear that the power pins (that's pins 1, 2 and
4) remain powered up even when you do 'poweroff -p', that's crazy.

How do you prevent devices squirting 3.3v into the Pi's pins after
power down if there's no way to turn off their power?

The Beaglebone Black has both 5v and 3.3v output power pins that power
down when you shut the machine down.

Have I got this right?

--
Chris Green
·

Re: Power pins, aren't they powered down at poweroff/halt?

<-Yt*KF3wz@news.chiark.greenend.org.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8128&group=comp.sys.raspberry-pi#8128

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.network!news.neodome.net!news.mixmin.net!news2.arglkargh.de!news.karotte.org!news.szaf.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+news@chiark.greenend.org.uk (Theo)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: 04 Dec 2023 14:17:55 +0000 (GMT)
Organization: University of Cambridge, England
Message-ID: <-Yt*KF3wz@news.chiark.greenend.org.uk>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="17916"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Mon, 4 Dec 2023 14:17 UTC

Chris Green <cl@isbd.net> wrote:
> I'm amazed. It would appear that the power pins (that's pins 1, 2 and
> 4) remain powered up even when you do 'poweroff -p', that's crazy.

Which Pi?

At least on the earlier ones (can't speak for 5) they are a way to
power the Pi from HATs. The Pi doesn't have any means to control its own
power, so 'poweroff' does not in fact turn off the power, it just shuts down
the CPU.

This is quite common for embedded boards, where there's no separate power
management chip to manage 'standby' modes (a lot of embedded gear like wifi
routers are powered 24/7). On the 5 they added this chip, so I think it
does proper shutdowns like a PC.

> How do you prevent devices squirting 3.3v into the Pi's pins after
> power down if there's no way to turn off their power?

You use external power control if you want that.

> The Beaglebone Black has both 5v and 3.3v output power pins that power
> down when you shut the machine down.

The BBB I think powers those from voltage regulators, which stop when the
CPU shuts down. The Pi's power (on the early ones) is bidirectional so
powering it from the GPIO header is a feature.

Theo

Re: Power pins, aren't they powered down at poweroff/halt?

<kt667nF99ekU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8130&group=comp.sys.raspberry-pi#8130

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!nntp.comgw.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 14:32:22 +0000
Lines: 10
Message-ID: <kt667nF99ekU1@mid.individual.net>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Hxuab9DI/Rk3FytcOTwFXwigi1l/fR5myTd36B5KB+87mTZM3L
Cancel-Lock: sha1:Phs4YZ4ehe3RPWApnSQTvhl1o30= sha256:9N1qFgbyITrDTG8B9FrOcUM1jdGty764yT+rhY/Z99g=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <-Yt*KF3wz@news.chiark.greenend.org.uk>
 by: Andy Burns - Mon, 4 Dec 2023 14:32 UTC

Theo wrote:

> At least on the earlier ones (can't speak for 5) they are a way to
> power the Pi from HATs. The Pi doesn't have any means to control its own
> power, so 'poweroff' does not in fact turn off the power, it just shuts down
> the CPU.

I haven't had hands on an rPi5, but yes I understand that for the first
time, powering off should actually remove power, rather than just halt ...

Re: Power pins, aren't they powered down at poweroff/halt?

<kt66q8F99ejU2@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8131&group=comp.sys.raspberry-pi#8131

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 14:42:15 +0000
Lines: 8
Message-ID: <kt66q8F99ejU2@mid.individual.net>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 5iQFuJJAJojD5cvek00jmwZT/qdTNLEWfSGGXBTC0JfZHZ5QTG
Cancel-Lock: sha1:f0416enyWAwquikefdOHqHVuWrU= sha256:rEIXhRg5wf8f3vGqn8fjH/sSAdyKCw9k+1OYwhOdLTU=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <kt667nF99ekU1@mid.individual.net>
 by: Andy Burns - Mon, 4 Dec 2023 14:42 UTC

Andy Burns wrote:

> I haven't had hands on an rPi5, but yes I understand that for the first
> time, powering off should actually remove power, rather than just halt ...

Apparently shutdown still doesn't remove power, but there's a new
boot.conf option POWER_OFF_ON_HALT=1 that cuts it down to 100mW or so.

Re: Power pins, aren't they powered down at poweroff/halt?

<hv814k-m5k.ln1@esprimo.zbmc.eu>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8132&group=comp.sys.raspberry-pi#8132

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!nntp.comgw.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl@isbd.net (Chris Green)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 15:48:33 +0000
Lines: 47
Message-ID: <hv814k-m5k.ln1@esprimo.zbmc.eu>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net CyuepZHXto5LB+eZAXxndAVYFm3VuPS+RqmVfF+8ir5t/QhiA=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:Kd0PRb/36NJMLm1rT1nrdk/9Hcc= sha256:hTLDEwNV/jBW1AyQLGhZCpmWf8KfKCMp8cdzY5GUh3U=
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-89-generic (x86_64))
 by: Chris Green - Mon, 4 Dec 2023 15:48 UTC

Theo <theom+news@chiark.greenend.org.uk> wrote:
> Chris Green <cl@isbd.net> wrote:
> > I'm amazed. It would appear that the power pins (that's pins 1, 2 and
> > 4) remain powered up even when you do 'poweroff -p', that's crazy.
>
> Which Pi?
>
A Pi 4 (two of them).

> At least on the earlier ones (can't speak for 5) they are a way to
> power the Pi from HATs. The Pi doesn't have any means to control its own
> power, so 'poweroff' does not in fact turn off the power, it just shuts down
> the CPU.
>
> This is quite common for embedded boards, where there's no separate power
> management chip to manage 'standby' modes (a lot of embedded gear like wifi
> routers are powered 24/7). On the 5 they added this chip, so I think it
> does proper shutdowns like a PC.
>
> > How do you prevent devices squirting 3.3v into the Pi's pins after
> > power down if there's no way to turn off their power?
>
> You use external power control if you want that.
>
How? I.e. if I shut down the PI and there's still power on the
peripherals doesn't it damage the Pi? How then can you do any sort of
shutdown from the Pi without risking its hardware? E.g. wouldn't an
LED operated by the Pi still be pushing (some fraction of) 5v into the
GPIO pin driving it when you shut down the Pi?

It would seem the only safe way to shut down is to pull the power, but
then you risk corrupting software.

> > The Beaglebone Black has both 5v and 3.3v output power pins that power
> > down when you shut the machine down.
>
> The BBB I think powers those from voltage regulators, which stop when the
> CPU shuts down. The Pi's power (on the early ones) is bidirectional so
> powering it from the GPIO header is a feature.
>
The BBB can be powered from it's 'GPIO' header too, it has both 5v in
and 5v out as it were, on different pins.

--
Chris Green
·

Re: Power pins, aren't they powered down at poweroff/halt?

<28914k-m5k.ln1@esprimo.zbmc.eu>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8133&group=comp.sys.raspberry-pi#8133

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl@isbd.net (Chris Green)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 15:53:06 +0000
Lines: 12
Message-ID: <28914k-m5k.ln1@esprimo.zbmc.eu>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net mvsxMkzk7geO6nPPYaK+dAZLyGMy3Y6o4JvoWuzJRK2cRAfSc=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:J8P1iCsKtfpBmB3kOdVyIElzmQg= sha256:9NKP2nlzLYhzyPcMyjJqbl+LE5Bi7MfwaMPXK/rfQS0=
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-89-generic (x86_64))
 by: Chris Green - Mon, 4 Dec 2023 15:53 UTC

I'm still confused then.

How does one safely shut down a Pi?

Is it safe to drive GPIO even when the processor is halted? I suppose
it must be, in which case the correct sequence is to stop the
processor with 'shutdown' or 'poweroff' and then to pull the power. Is
this right?

--
Chris Green
·

Re: Power pins, aren't they powered down at poweroff/halt?

<8Yt*z-3wz@news.chiark.greenend.org.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8134&group=comp.sys.raspberry-pi#8134

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+news@chiark.greenend.org.uk (Theo)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: 04 Dec 2023 16:33:40 +0000 (GMT)
Organization: University of Cambridge, England
Message-ID: <8Yt*z-3wz@news.chiark.greenend.org.uk>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <hv814k-m5k.ln1@esprimo.zbmc.eu>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="14621"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Mon, 4 Dec 2023 16:33 UTC

Chris Green <cl@isbd.net> wrote:
> Theo <theom+news@chiark.greenend.org.uk> wrote:
> >
> > You use external power control if you want that.
> >
> How? I.e. if I shut down the PI and there's still power on the
> peripherals doesn't it damage the Pi? How then can you do any sort of
> shutdown from the Pi without risking its hardware? E.g. wouldn't an
> LED operated by the Pi still be pushing (some fraction of) 5v into the
> GPIO pin driving it when you shut down the Pi?
>
> It would seem the only safe way to shut down is to pull the power, but
> then you risk corrupting software.

'shutdown' or 'poweroff' commands shut down the OS, so the OS flushes disc
caches, puts the CPU into an idle state and then stops executing
instructions. There's no power control, so the board remains powered. The
chip is still 'on', so electrically speaking everything is as it is when the
system is running, just the software isn't doing anything any more.

In the case of an LED on a GPIO, either the pin is still driving low or high
as the last time it was set, or it's turned into a high-impedance input so
no current will flow into/out of the I/O pin. Either way won't cause harm.

The 'shutdown'/'poweroff' procedure will put the software in a safe state so
you can pull the plug, but it doesn't have the hardware to pull the plug for
you.

If you choose to disconnect things, eg unplug a HAT, while the Pi is still
powered that's your lookout. You should physically remove power before
doing so (just like you should work on mains equipment unless physically
unplugged). There are cables for that:
https://thepihut.com/products/usb-c-cable-with-switch

> > > The Beaglebone Black has both 5v and 3.3v output power pins that power
> > > down when you shut the machine down.
> >
> > The BBB I think powers those from voltage regulators, which stop when the
> > CPU shuts down. The Pi's power (on the early ones) is bidirectional so
> > powering it from the GPIO header is a feature.
> >
> The BBB can be powered from it's 'GPIO' header too, it has both 5v in
> and 5v out as it were, on different pins.

OK, so it's not bidirectional, it can turn off the power on the 'out' pin
while being powered from the 'in' pin. The Pi doesn't have such hardware:
there are electrical connections between all of the 5V inputs (via some
limiting for USB, on some boards).

Theo

Re: Power pins, aren't they powered down at poweroff/halt?

<uklejn$3ica6$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8136&group=comp.sys.raspberry-pi#8136

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@druck.org.uk (druck)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 20:59:35 +0000
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uklejn$3ica6$2@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <hv814k-m5k.ln1@esprimo.zbmc.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 4 Dec 2023 20:59:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="da2ffc436a3a14fedffab4285d028778";
logging-data="3748166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Q5Px6ONJW1MNY6GldktZl"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nhDmbwgAgj9QNCUICXiDY5xW3T4=
In-Reply-To: <hv814k-m5k.ln1@esprimo.zbmc.eu>
Content-Language: en-GB
 by: druck - Mon, 4 Dec 2023 20:59 UTC

On 04/12/2023 15:48, Chris Green wrote:
> Theo <theom+news@chiark.greenend.org.uk> wrote:
>> You use external power control if you want that.
>>
> How? I.e. if I shut down the PI and there's still power on the
> peripherals doesn't it damage the Pi? How then can you do any sort of
> shutdown from the Pi without risking its hardware? E.g. wouldn't an
> LED operated by the Pi still be pushing (some fraction of) 5v into the
> GPIO pin driving it when you shut down the Pi?

If you are putting 5V on a GPIO pin you are going to damage it, all Pis
have 3.3V GPIO. On power off all pins go open collector, so they become
neither inputs or outputs, just as when first powered on. Any connected
LEDs will go off, nothing will be damaged.

> It would seem the only safe way to shut down is to pull the power, but
> then you risk corrupting software.

Nonsense. Do a shutdown from the desktop, or halt from the command line,
wait for the activity LED to stop flashing then it is safe to power off
without any storage corruption.

---druck

Re: Power pins, aren't they powered down at poweroff/halt?

<4gs14k-4sr1.ln1@esprimo.zbmc.eu>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8137&group=comp.sys.raspberry-pi#8137

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: cl@isbd.net (Chris Green)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Mon, 4 Dec 2023 21:21:40 +0000
Lines: 33
Message-ID: <4gs14k-4sr1.ln1@esprimo.zbmc.eu>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <hv814k-m5k.ln1@esprimo.zbmc.eu> <uklejn$3ica6$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net qlaT2XJE+0CWo8RVpKNvxQdVovFh215TZE7oXupFn7YuIIFUE=
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:UPnwvYyamhJS/tkHWtFyZ2I0sR8= sha256:Kt6mn2HaPcBH+sKEtlez3eL07b1O+bzVADpbrw/2G/Q=
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-89-generic (x86_64))
 by: Chris Green - Mon, 4 Dec 2023 21:21 UTC

druck <news@druck.org.uk> wrote:
> On 04/12/2023 15:48, Chris Green wrote:
> > Theo <theom+news@chiark.greenend.org.uk> wrote:
> >> You use external power control if you want that.
> >>
> > How? I.e. if I shut down the PI and there's still power on the
> > peripherals doesn't it damage the Pi? How then can you do any sort of
> > shutdown from the Pi without risking its hardware? E.g. wouldn't an
> > LED operated by the Pi still be pushing (some fraction of) 5v into the
> > GPIO pin driving it when you shut down the Pi?
>
> If you are putting 5V on a GPIO pin you are going to damage it, all Pis
> have 3.3V GPIO. On power off all pins go open collector, so they become
> neither inputs or outputs, just as when first powered on. Any connected
> LEDs will go off, nothing will be damaged.
>
Yes, sorry, just a slip of the pen/finger! :-) The BBB is just the
same, maximum of 3.3 volts.

> > It would seem the only safe way to shut down is to pull the power, but
> > then you risk corrupting software.
>
> Nonsense. Do a shutdown from the desktop, or halt from the command line,
> wait for the activity LED to stop flashing then it is safe to power off
> without any storage corruption.
>
OK, yes, if you read down the thread I had sort of arrived at this
result. It just feels slightly odd having been used to the BBB for a
long time.

--
Chris Green
·

Re: Power pins, aren't they powered down at poweroff/halt?

<slrnun42aa.53h.jj@iridium.wf32df>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8175&group=comp.sys.raspberry-pi#8175

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 18:04:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <slrnun42aa.53h.jj@iridium.wf32df>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
Injection-Date: Thu, 7 Dec 2023 18:04:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c79f002761243e0d5e53c2c399e701dc";
logging-data="1434280"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PY69Fmo/nNnNzzktEErE25h5m/3lG8D0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:UI93KncsM650Lbqp2L04Q114pcc=
 by: Jim Jackson - Thu, 7 Dec 2023 18:04 UTC

On 2023-12-04, Chris Green <cl@isbd.net> wrote:
> I'm still confused then.
>
> How does one safely shut down a Pi?
>
> Is it safe to drive GPIO even when the processor is halted? I suppose
> it must be, in which case the correct sequence is to stop the
> processor with 'shutdown' or 'poweroff' and then to pull the power. Is
> this right?

You're actually stopping the operating system which puts it into a safe
state so that power can be safely removed.

Not actually sure if the processor is "shutdown" or goes into some sort
of infinite loop after all servidces etc are stopped. Anybody know?

Re: Power pins, aren't they powered down at poweroff/halt?

<ukt6vr$17mo2$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8178&group=comp.sys.raspberry-pi#8178

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martin@mydomain.invalid (Martin Gregorie)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <ukt6vr$17mo2$3@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4092124b00fa81efa495a9fe9492df11";
logging-data="1301250"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rCJVWXCvxc9tSkz8SdOXoe9aosE9z6qI="
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:ZO2TLQLYP0aTKY1m3Uyx8l8nqZY=
 by: Martin Gregorie - Thu, 7 Dec 2023 19:38 UTC

On Thu, 7 Dec 2023 18:04:58 -0000 (UTC), Jim Jackson wrote:

> On 2023-12-04, Chris Green <cl@isbd.net> wrote:
>> I'm still confused then.
>>
>> How does one safely shut down a Pi?
>>
>> Is it safe to drive GPIO even when the processor is halted? I suppose
>> it must be, in which case the correct sequence is to stop the processor
>> with 'shutdown' or 'poweroff' and then to pull the power. Is this
>> right?
>
> You're actually stopping the operating system which puts it into a safe
> state so that power can be safely removed.
>
> Not actually sure if the processor is "shutdown" or goes into some sort
> of infinite loop after all servidces etc are stopped. Anybody know?

Surely any multi-tasking OS never stops: even when all the programs that
are apparently stopped, waiting for input are in fact still polling all
the devices and files it has open.

The only systems that actually stop during normal operation will only be
those running single-tasking operating systems on hardware which does not
use memory-mapped displays and that does use external devices (keyboards,
mice, printers etc.) and that relies entirely on externally generated
interrupts to trigger any activity.

Anything else can't stop because, even when its apparently idle, it must
be actively scanning for interrupts that require handling.

--

Martin | martin at
Gregorie | gregorie dot org

Re: Power pins, aren't they powered down at poweroff/halt?

<slrnun498v.53h.jj@iridium.wf32df>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8179&group=comp.sys.raspberry-pi#8179

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 20:03:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <slrnun498v.53h.jj@iridium.wf32df>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
Injection-Date: Thu, 7 Dec 2023 20:03:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c79f002761243e0d5e53c2c399e701dc";
logging-data="1473662"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E04pl+0mbDZMb2Y6A304EgqCFiwQUYOc="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:W2vXaPWzjCMBX4GP08bOMi7eSz4=
 by: Jim Jackson - Thu, 7 Dec 2023 20:03 UTC

On 2023-12-07, Martin Gregorie <martin@mydomain.invalid> wrote:
> On Thu, 7 Dec 2023 18:04:58 -0000 (UTC), Jim Jackson wrote:
>
>> On 2023-12-04, Chris Green <cl@isbd.net> wrote:
>>> I'm still confused then.
>>>
>>> How does one safely shut down a Pi?
>>>
>>> Is it safe to drive GPIO even when the processor is halted? I suppose
>>> it must be, in which case the correct sequence is to stop the processor
>>> with 'shutdown' or 'poweroff' and then to pull the power. Is this
>>> right?
>>
>> You're actually stopping the operating system which puts it into a safe
>> state so that power can be safely removed.
>>
>> Not actually sure if the processor is "shutdown" or goes into some sort
>> of infinite loop after all servidces etc are stopped. Anybody know?
>
> Surely any multi-tasking OS never stops: even when all the programs that
> are apparently stopped, waiting for input are in fact still polling all
> the devices and files it has open.
>
> The only systems that actually stop during normal operation will only be
> those running single-tasking operating systems on hardware which does not
> use memory-mapped displays and that does use external devices (keyboards,
> mice, printers etc.) and that relies entirely on externally generated
> interrupts to trigger any activity.
>
> Anything else can't stop because, even when its apparently idle, it must
> be actively scanning for interrupts that require handling.

yawn - I think you miss the point! This is AFTER the OS has shutdown.
Anyway I googled and best I got on a cursory search was ...

https://unix.stackexchange.com/questions/122557/how-does-the-system-shutdown-of-a-linux-kernel-work-internally

which is 9 years old.

Seemingly the the last thing init will do after shutting down all the
services is call the reboot() syscall in the kernel. It appears the name
is misleading - the syscall can do lots of things that are not reboot'ing!

man 2 reboot

should describe what it can do.

LINUX_REBOOT_CMD_HALT
(RB_HALT_SYSTEM, 0xcdef0123; since Linux 1.1.76). The
message "System halted." is printed, and the system is
halted. Control is given to the ROM monitor, if there is
one. If not preceded by a sync(2), data will be lost.

I suspect in the Raspberry Pi <5 the processor will sit in tight forever
loop, given there is no hardware to turn power off, and in a Pi5 it will
turn power off.

Anyway I've learnt something.

Re: Power pins, aren't they powered down at poweroff/halt?

<65722f46@news.ausics.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8181&group=comp.sys.raspberry-pi#8181

  copy link   Newsgroups: comp.sys.raspberry-pi
Message-ID: <65722f46@news.ausics.net>
From: not@telling.you.invalid (Computer Nerd Kev)
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Newsgroups: comp.sys.raspberry-pi
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu> <slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me> <slrnun498v.53h.jj@iridium.wf32df>
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i586))
NNTP-Posting-Host: news.ausics.net
Date: 8 Dec 2023 06:47:03 +1000
Organization: Ausics - https://ausics.net
Lines: 20
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: Computer Nerd Kev - Thu, 7 Dec 2023 20:47 UTC

Jim Jackson <jj@franjam.org.uk> wrote:
>
> I suspect in the Raspberry Pi <5 the processor will sit in tight forever
> loop, given there is no hardware to turn power off, and in a Pi5 it will
> turn power off.

I do know that the GPU keeps going. If you set it executing
something on its spare VPU processor then it will continue blindly
after a "sudo poweroff", hence the need for a hard poweroff after
you lock it up. The GPU configures the CPU clock etc., so it might
stop the CPU at power-off. The power consumption goes down a fair
bit on the Pi Zero after power-off one way or other. If you could
figure out how to wake the CPU up again using your own GPU code, it
could even be useful in embeedded applications to use that as a
sort of sleep mode while still running something on the GPU (which
can access GPIOs).

--
__ __
#_ < |\| |< _# | Note: I won't see posts made from Google Groups |

Re: Power pins, aren't they powered down at poweroff/halt?

<20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8183&group=comp.sys.raspberry-pi#8183

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 20:41:49 +0000
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk>
<kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net>
<28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df>
<ukt6vr$17mo2$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="a00f3f70576c8d220d9ffb7a107e18be";
logging-data="1489411"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Q7+FieoVWochQ0yKLk4qd5vbguNhA/Q4="
Cancel-Lock: sha1:BD2QZsmVggL7tWFAWF3XmoUibAE=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1)
X-Clacks-Overhead: "GNU Terry Pratchett"
 by: Ahem A Rivet's - Thu, 7 Dec 2023 20:41 UTC

On Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
Martin Gregorie <martin@mydomain.invalid> wrote:

> Anything else can't stop because, even when its apparently idle, it must
> be actively scanning for interrupts that require handling.

Until multi-core CPUs became common and kernels became threaded it
was normal for a multi-tasking OS to execute a HALT when there were no
tasks to run and rely on the timer tick interrupt to break it out of the
halted state. Interrupts don't need to be scanned for.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

Re: Power pins, aren't they powered down at poweroff/halt?

<uktd43$1ddn2$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8184&group=comp.sys.raspberry-pi#8184

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: news@druck.org.uk (druck)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 21:23:15 +0000
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <uktd43$1ddn2$1@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
<20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 7 Dec 2023 21:23:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="47195af8a478227ec11e965447db3c75";
logging-data="1488610"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cyvveyQdTOrBYiZCE378o"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Qclm6TRzWdYXETeEKFvrU+6cfcQ=
Content-Language: en-GB
In-Reply-To: <20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
 by: druck - Thu, 7 Dec 2023 21:23 UTC

On 07/12/2023 20:41, Ahem A Rivet's Shot wrote:
> On Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
> Martin Gregorie <martin@mydomain.invalid> wrote:
>
>> Anything else can't stop because, even when its apparently idle, it must
>> be actively scanning for interrupts that require handling.

The whole point of an interrupt is they aren't being actively scanned.
Some external input results in the interrupt controller hardware
changing the state of the processor.

> Until multi-core CPUs became common and kernels became threaded it
> was normal for a multi-tasking OS to execute a HALT when there were no
> tasks to run and rely on the timer tick interrupt to break it out of the
> halted state. Interrupts don't need to be scanned for.

Multi-core CPUs do exactly the same thing, halt each core, and a timer
interrupt will wake up one core. It can then decide to wake up other
cores or not.

---druck

Re: Power pins, aren't they powered down at poweroff/halt?

<Y+b*0bjxz@news.chiark.greenend.org.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8185&group=comp.sys.raspberry-pi#8185

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+news@chiark.greenend.org.uk (Theo)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: 07 Dec 2023 22:06:10 +0000 (GMT)
Organization: University of Cambridge, England
Message-ID: <Y+b*0bjxz@news.chiark.greenend.org.uk>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu> <slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me> <slrnun498v.53h.jj@iridium.wf32df>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="31658"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Thu, 7 Dec 2023 22:06 UTC

Jim Jackson <jj@franjam.org.uk> wrote:
> Seemingly the the last thing init will do after shutting down all the
> services is call the reboot() syscall in the kernel. It appears the name
> is misleading - the syscall can do lots of things that are not reboot'ing!
>
> man 2 reboot
>
> should describe what it can do.
>
> LINUX_REBOOT_CMD_HALT
> (RB_HALT_SYSTEM, 0xcdef0123; since Linux 1.1.76). The
> message "System halted." is printed, and the system is
> halted. Control is given to the ROM monitor, if there is
> one. If not preceded by a sync(2), data will be lost.
>
> I suspect in the Raspberry Pi <5 the processor will sit in tight forever
> loop, given there is no hardware to turn power off, and in a Pi5 it will
> turn power off.

https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/kernel/reboot.c#L108

void machine_power_off(void)
{ local_irq_disable(); // turn off interrupts
smp_send_stop(); // disable other cores
do_kernel_power_off();// call the system's power off handlers
}

At this point we work through a list of power off handlers, but I can't find
where those are registered in the 32-bit ARM tree. Doing the handlers is
the last thing Linux does - the expectation is that they never return.

I would expect ultimately the ARM executes a Wait For Interrupt instruction,
which means it can't be woken since interrupts are turned off. That means
it's in its lowest power state.

It is possible the Pi's GPU does other things like turning off power to
various peripherals, but we don't have visibility of that side of the
firmware.

Theo

Re: Power pins, aren't they powered down at poweroff/halt?

<slrnun4ibi.53h.jj@iridium.wf32df>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8186&group=comp.sys.raspberry-pi#8186

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jj@franjam.org.uk (Jim Jackson)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Thu, 7 Dec 2023 22:38:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <slrnun4ibi.53h.jj@iridium.wf32df>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
<slrnun498v.53h.jj@iridium.wf32df> <Y+b*0bjxz@news.chiark.greenend.org.uk>
Injection-Date: Thu, 7 Dec 2023 22:38:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c79f002761243e0d5e53c2c399e701dc";
logging-data="1515629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/A/ilE9nQ62M2dAMcSShtKaYUnpKT5Hf8="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:kaCdPO/KWF1kNT3t6Y+zpZh+tjU=
 by: Jim Jackson - Thu, 7 Dec 2023 22:38 UTC

On 2023-12-07, Theo <theom+news@chiark.greenend.org.uk> wrote:
> Jim Jackson <jj@franjam.org.uk> wrote:
>> Seemingly the the last thing init will do after shutting down all the
>> services is call the reboot() syscall in the kernel. It appears the name
>> is misleading - the syscall can do lots of things that are not reboot'ing!
>>
>> man 2 reboot
>>
>> should describe what it can do.
>>
>> LINUX_REBOOT_CMD_HALT
>> (RB_HALT_SYSTEM, 0xcdef0123; since Linux 1.1.76). The
>> message "System halted." is printed, and the system is
>> halted. Control is given to the ROM monitor, if there is
>> one. If not preceded by a sync(2), data will be lost.
>>
>> I suspect in the Raspberry Pi <5 the processor will sit in tight forever
>> loop, given there is no hardware to turn power off, and in a Pi5 it will
>> turn power off.
>
> https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/kernel/reboot.c#L108
>
> void machine_power_off(void)
> {
> local_irq_disable(); // turn off interrupts
> smp_send_stop(); // disable other cores
> do_kernel_power_off();// call the system's power off handlers
> }
>
>
> At this point we work through a list of power off handlers, but I can't find
> where those are registered in the 32-bit ARM tree. Doing the handlers is
> the last thing Linux does - the expectation is that they never return.
>
> I would expect ultimately the ARM executes a Wait For Interrupt instruction,
> which means it can't be woken since interrupts are turned off. That means
> it's in its lowest power state.
>
> It is possible the Pi's GPU does other things like turning off power to
> various peripherals, but we don't have visibility of that side of the
> firmware.
>

That makes sense. Thanks for the info.

Re: Power pins, aren't they powered down at poweroff/halt?

<65725e4d@news.ausics.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8187&group=comp.sys.raspberry-pi#8187

  copy link   Newsgroups: comp.sys.raspberry-pi
Message-ID: <65725e4d@news.ausics.net>
From: not@telling.you.invalid (Computer Nerd Kev)
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Newsgroups: comp.sys.raspberry-pi
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu> <slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me> <slrnun498v.53h.jj@iridium.wf32df> <Y+b*0bjxz@news.chiark.greenend.org.uk>
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i686))
NNTP-Posting-Host: news.ausics.net
Date: 8 Dec 2023 10:07:42 +1000
Organization: Ausics - https://ausics.net
Lines: 23
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: Computer Nerd Kev - Fri, 8 Dec 2023 00:07 UTC

Theo <theom+news@chiark.greenend.org.uk> wrote:
>
> It is possible the Pi's GPU does other things like turning off power to
> various peripherals, but we don't have visibility of that side of the
> firmware.

There are different power states that the GPU can be commanded to
enter:

#define Get_Power_State 0x00020001 // Power: Get Power State (Response: Device ID, State)
#define Set_Power_State 0x00028001 // Power: Set Power State (Response: Device ID, State)

In Linux, the routines for setting power states are in:
drivers/soc/bcm/raspberrypi-power.c
https://sources.debian.org/src/linux/6.5.13-1/drivers/soc/bcm/raspberrypi-power.c

They seem to be called "power domains" in kernel speak, and there's
RPI_POWER_DOMAIN_ARM. That might mean the CPU, but I don't see any
useful comments that state it explicitly.

--
__ __
#_ < |\| |< _# | Note: I won't see posts made from Google Groups |

Re: Power pins, aren't they powered down at poweroff/halt?

<wwvcyvhf6gz.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8197&group=comp.sys.raspberry-pi#8197

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 08 Dec 2023 08:23:24 +0000
Organization: terraraq NNTP server
Message-ID: <wwvcyvhf6gz.fsf@LkoBDZeT.terraraq.uk>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk>
<kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net>
<28914k-m5k.ln1@esprimo.zbmc.eu> <slrnun42aa.53h.jj@iridium.wf32df>
<ukt6vr$17mo2$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="101737"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:wzSf4AndrPxvXFxgQ3XvEGAzw6U=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Fri, 8 Dec 2023 08:23 UTC

Martin Gregorie <martin@mydomain.invalid> writes:
> Surely any multi-tasking OS never stops: even when all the programs
> that are apparently stopped, waiting for input are in fact still
> polling all the devices and files it has open.

Processes are suspended when waiting for input and as others have
pointed out, when there’s no work to do the CPU will be halted until an
interrupt arrives.

It’s possible to write programs that continuously check for some kind of
state change but usually there are better options available.

--
https://www.greenend.org.uk/rjk/

Re: Power pins, aren't they powered down at poweroff/halt?

<ukv79r$1o5na$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8208&group=comp.sys.raspberry-pi#8208

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: martin@mydomain.invalid (Martin Gregorie)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 8 Dec 2023 13:56:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <ukv79r$1o5na$3@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
<20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Dec 2023 13:56:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="79df898d28d83e9838db25f5f4b47935";
logging-data="1840874"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ty5AwEGgN7Ie42xtPNTJbMqqjTkpcK7c="
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:SeN/R8ESCRsxDdt4G090rscka6E=
 by: Martin Gregorie - Fri, 8 Dec 2023 13:56 UTC

On Thu, 7 Dec 2023 20:41:49 +0000, Ahem A Rivet's Shot wrote:

> On Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
> Martin Gregorie <martin@mydomain.invalid> wrote:
>
>> Anything else can't stop because, even when its apparently idle, it
>> must be actively scanning for interrupts that require handling.
>
> Until multi-core CPUs became common and kernels became threaded it
> was normal for a multi-tasking OS to execute a HALT when there were no
> tasks to run and rely on the timer tick interrupt to break it out of the
> halted state. Interrupts don't need to be scanned for.

Good info. Thanks.

AFAIK my first personally owned system (MC6809 based, running TSC's FLEX
OS) didn't stop: the innermost firmware loop scanned the keyboard for key-
press interrupts. Its display was based on a MC6845 display controller
with a dedicated chunk of RAM. The 6845 scanned this to paint a monochrome
80x24 screen on a portable monochrome TV and code in a chunk of EEPROM at
the top of the memory space was called to update the display.

--

Martin | martin at
Gregorie | gregorie dot org

Re: Power pins, aren't they powered down at poweroff/halt?

<Y+b*BHmxz@news.chiark.greenend.org.uk>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8219&group=comp.sys.raspberry-pi#8219

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.hispagatos.org!news.nntp4.net!nntp.terraraq.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: theom+news@chiark.greenend.org.uk (Theo)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: 08 Dec 2023 14:00:14 +0000 (GMT)
Organization: University of Cambridge, England
Message-ID: <Y+b*BHmxz@news.chiark.greenend.org.uk>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu> <-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net> <kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu> <slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me> <slrnun498v.53h.jj@iridium.wf32df> <Y+b*0bjxz@news.chiark.greenend.org.uk> <65725e4d@news.ausics.net>
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:212.13.197.229";
logging-data="7410"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-22-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([212.13.197.229])
 by: Theo - Fri, 8 Dec 2023 14:00 UTC

Computer Nerd Kev <not@telling.you.invalid> wrote:
> Theo <theom+news@chiark.greenend.org.uk> wrote:
> >
> > It is possible the Pi's GPU does other things like turning off power to
> > various peripherals, but we don't have visibility of that side of the
> > firmware.
>
> There are different power states that the GPU can be commanded to
> enter:
>
> #define Get_Power_State 0x00020001 // Power: Get Power State (Response: Device ID, State)
> #define Set_Power_State 0x00028001 // Power: Set Power State (Response: Device ID, State)

Those are the mailbox property interface:
https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface

> In Linux, the routines for setting power states are in:
> drivers/soc/bcm/raspberrypi-power.c
> https://sources.debian.org/src/linux/6.5.13-1/drivers/soc/bcm/raspberrypi-power.c
>
> They seem to be called "power domains" in kernel speak, and there's
> RPI_POWER_DOMAIN_ARM. That might mean the CPU, but I don't see any
> useful comments that state it explicitly.

Device tree usually tells you which power domains need to be up, eg need to
power SD card controller before you can talk to it. But I don't see any
mechanism for the CPU to tell the GPU to turn things off on shutdown -
there's no 'I'm shutting down now' message documented.

Theo

Re: Power pins, aren't they powered down at poweroff/halt?

<ukv9q8$1p5cp$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8223&group=comp.sys.raspberry-pi#8223

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 8 Dec 2023 14:39:04 +0000
Organization: A little, after lunch
Lines: 38
Message-ID: <ukv9q8$1p5cp$2@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Dec 2023 14:39:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="168e5519fcf721083c47c1a2564251f6";
logging-data="1873305"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WsggMGnpiTszCjkkpbfh8a0X7T+y/3R4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nDtpZ8PecD31PUhW/iXrg7M9pcA=
In-Reply-To: <slrnun42aa.53h.jj@iridium.wf32df>
Content-Language: en-GB
 by: The Natural Philosop - Fri, 8 Dec 2023 14:39 UTC

On 07/12/2023 18:04, Jim Jackson wrote:
> On 2023-12-04, Chris Green <cl@isbd.net> wrote:
>> I'm still confused then.
>>
>> How does one safely shut down a Pi?
>>
>> Is it safe to drive GPIO even when the processor is halted? I suppose
>> it must be, in which case the correct sequence is to stop the
>> processor with 'shutdown' or 'poweroff' and then to pull the power. Is
>> this right?
>
> You're actually stopping the operating system which puts it into a safe
> state so that power can be safely removed.
>
> Not actually sure if the processor is "shutdown" or goes into some sort
> of infinite loop after all servidces etc are stopped. Anybody know?
>
No, but I would like to.

Is there an ARM 'HALT' instruction ?
One thing I have found is this gem

" in the bootconf.txt I changed to:

WAKE_ON_GPIO=0
POWER_OFF_ON_HALT=1"

What this actually means in the context of a Pi is not 100% clear though

--
I would rather have questions that cannot be answered...
....than to have answers that cannot be questioned

Richard Feynman

Re: Power pins, aren't they powered down at poweroff/halt?

<ukv9vj$1p5cp$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8224&group=comp.sys.raspberry-pi#8224

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 8 Dec 2023 14:41:55 +0000
Organization: A little, after lunch
Lines: 24
Message-ID: <ukv9vj$1p5cp$3@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Dec 2023 14:41:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="168e5519fcf721083c47c1a2564251f6";
logging-data="1873305"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1973wqMFgdi/FmDpdeAqwYWb7m/qcIisCE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:2r4M5x2MFS+xWEFuAf0x/yhpkmY=
In-Reply-To: <ukt6vr$17mo2$3@dont-email.me>
Content-Language: en-GB
 by: The Natural Philosop - Fri, 8 Dec 2023 14:41 UTC

On 07/12/2023 19:38, Martin Gregorie wrote:

> Anything else can't stop because, even when its apparently idle, it must
> be actively scanning for interrupts that require handling.
>
Ah, I see you do not understand hardware interrupts AT ALL.

Hardware interrupts are not 'scanned' They actually toggle a hardware
pin on the CPU (at leasts conceptually)

That can and sometimes is configured to restart the program counter
altogether as well as set it to the interrupt vector

>
>
>
>

--
"The great thing about Glasgow is that if there's a nuclear attack it'll
look exactly the same afterwards."

Billy Connolly

Re: Power pins, aren't they powered down at poweroff/halt?

<ukva3r$1p5cp$4@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8225&group=comp.sys.raspberry-pi#8225

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 8 Dec 2023 14:44:11 +0000
Organization: A little, after lunch
Lines: 25
Message-ID: <ukva3r$1p5cp$4@dont-email.me>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukt6vr$17mo2$3@dont-email.me>
<20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Dec 2023 14:44:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="168e5519fcf721083c47c1a2564251f6";
logging-data="1873305"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J5APaWfi6br1DCnuYDUsFrRXCCiCXMqk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:LVfvW4ysVrLtlVyCZp7zqvtJKZg=
Content-Language: en-GB
In-Reply-To: <20231207204149.3bae107f08734e6b3c0a8a91@eircom.net>
 by: The Natural Philosop - Fri, 8 Dec 2023 14:44 UTC

On 07/12/2023 20:41, Ahem A Rivet's Shot wrote:
> On Thu, 7 Dec 2023 19:38:35 -0000 (UTC)
> Martin Gregorie <martin@mydomain.invalid> wrote:
>
>> Anything else can't stop because, even when its apparently idle, it must
>> be actively scanning for interrupts that require handling.
>
> Until multi-core CPUs became common and kernels became threaded it
> was normal for a multi-tasking OS to execute a HALT when there were no
> tasks to run and rely on the timer tick interrupt to break it out of the
> halted state. Interrupts don't need to be scanned for.
>
Yup.

Timer tick or any other hardware interrupt.

essentially a 'sleep until()' type state

--
The lifetime of any political organisation is about three years before
its been subverted by the people it tried to warn you about.

Anon.

Re: Power pins, aren't they powered down at poweroff/halt?

<ktgppkFga3qU3@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=8226&group=comp.sys.raspberry-pi#8226

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@andyburns.uk (Andy Burns)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Power pins, aren't they powered down at poweroff/halt?
Date: Fri, 8 Dec 2023 15:07:33 +0000
Lines: 8
Message-ID: <ktgppkFga3qU3@mid.individual.net>
References: <rg114k-6r5.ln1@esprimo.zbmc.eu>
<-Yt*KF3wz@news.chiark.greenend.org.uk> <kt667nF99ekU1@mid.individual.net>
<kt66q8F99ejU2@mid.individual.net> <28914k-m5k.ln1@esprimo.zbmc.eu>
<slrnun42aa.53h.jj@iridium.wf32df> <ukv9q8$1p5cp$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net /BN1i89ECKq4UZLDo2ZpRA4r3oikNRREocelYOJ6xhHu2VqldP
Cancel-Lock: sha1:IbDxCwGfW3OboPHzhHAkaefrH3c= sha256:Fq6gcolJcHQ1woCCrR3DYBB6I0R9qnzj3uKXI1qF9ko=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <ukv9q8$1p5cp$2@dont-email.me>
 by: Andy Burns - Fri, 8 Dec 2023 15:07 UTC

The Natural Philosopher wrote:

> in the bootconf.txt I changed to:
> POWER_OFF_ON_HALT=1"
>
> What this actually means in the context of a Pi is not 100% clear though

I think that only affects a Pi5

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor