Skip to contentSkip to conversation

Patch: linux-2.5.42/kernel/sys.c - warm reboot should not suspend devices

DISCUSSION Adam J. Richter 2 participants 2 messages Oct 21, 2002 – Oct 22, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Eric Biederman

My big concern is with getting the shutdown path setup in a manner that works, and gets testing.

Rebooting without traversing the device tree seems to have
essentially worked fine for 2.4.x.

Quoted 3 lines

When booting linux from linux with
sys_kexec a lot of my problems come back to some device driver not getting shutdown.

kmonte and sys_kexec skip the BIOS reset code and therefore
may need to do more elaborate shutdown, but please do not saddle the normal reboot case with the reliability risk of calling code in each driver when a user might be rebooting a remote machine precisely because of a a confused device driver or the potential slow down (especially since you want an interface where the function that gets called before reboot may need to do blocking IO). For kmonte/sys_kexec, this high cost might be necessary, but for the normal reboot the cost is not worth the benefit.

By way, given the ability to register reboot notifiers in the
device tree, I would be happy to see one registered at the top of the PCI bus tree (so it would be called last) that would shut off the PCI bus before reboot, along the lines of what Richard B. Johnson posted. That would not involve walking a lot of data structures in many different device drivers and it would be just a few instrutions.

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#1 lore raw
Quoted 6 lines · Adam J. Richter
Quoted 2 lines · Eric Biederman

My big concern is with getting the shutdown path setup in a manner that works, and gets testing.

Rebooting without traversing the device tree seems to have
essentially worked fine for 2.4.x.

Yes. I expect that most of the shutdown routines will be made conditional on something like, like CONFIG_HOTPLUG so you can disable the cleanly. Or perhaps, device_shutdown will be made a compile time conditional.

But please note a number of 2.4.x drivers are starting to grow reboot notifiers. So it appears that some people have needed code to shut down their driver at reboot time in 2.4.x

Quoted 4 lines
Quoted 3 lines

When booting linux from linux with
sys_kexec a lot of my problems come back to some device driver not getting shutdown.

Quoted 9 lines

kmonte and sys_kexec skip the BIOS reset code and therefore
may need to do more elaborate shutdown, but please do not saddle the normal reboot case with the reliability risk of calling code in each driver when a user might be rebooting a remote machine precisely because of a a confused device driver or the potential slow down (especially since you want an interface where the function that gets called before reboot may need to do blocking IO). For kmonte/sys_kexec, this high cost might be necessary, but for the normal reboot the cost is not worth the benefit.

In general if a routine takes a long time, that is a bug.

Quoted 6 lines

By way, given the ability to register reboot notifiers in the
device tree, I would be happy to see one registered at the top of the PCI bus tree (so it would be called last) that would shut off the PCI bus before reboot, along the lines of what Richard B. Johnson posted. That would not involve walking a lot of data structures in many different device drivers and it would be just a few instrutions.

That code was chipset specific, so it may be a good thing for a host bridge driver to do that but it is by no means generally possible.

Eric