tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [ CVS commit: src/sys/kern] said:
> (1) It reintroduces the behaviour of letting devices active

I think enough reasons habe been given that the set
of actions to be taken at shutdown time is different
from those needed for suspend.
"active" isn't a very exact term, but generally it is OK
to leave devices "active" on shutdown so that eg. the
console stays operating.

> bus master DMA

Right, that should be disabled. This got lost in my change.
(Actually, this also wasn't done before in many cases -
just look at the many PCI devices which register NULL
suspend handlers. So the actual regression is small.)
Since there is a common PCI way to disable DMA, it
should be done in common PCI code.
For sanity, it would make sense to also disable IRQs explicitely,
but that would be left to the individual drivers.

> (2) The changes for wd/sd once again make it impossible to correctly
> order dependencies

Well, in the meantime I came to the conclusion that it
is better for shutdown to use the same ordering algorithm
as "suspend".

> Consider RAID.

That's a not a great example because file systems are already
unmounted at that point, but I can imagine strange bus bridges
containing DMA engines (at least some VME bridges do that)
which need ordering.
Since the hooks are run in reverse order, the ordering is
provided as things look now, but a general event notification
framework wouldn't do it.

> The correct handling of console devices has to consider power management
> and whether or not the device used is currently active.

There are different cases:
On system suspend, we can't take care a lot of the console. The
PCI PM spec is explicit about the fact that for all devices on
the bus io/memory/dma must be disabled in the command register
and D3 invoked. No exceptions. That's why the special handling
of graphics devices in the common PCI suspend function is wrong
and should be removed eventually. (The vga handler needs to
be told to discard output before.)
That's how I read the spec -- if I missed something, someone
please tell me.
On shutdown (w/o detach), everything just keeps running, in
polling mode.
On shutdown with detach, the console device's detach() function
retuns an error, as Jared wrote. So it stays alive, and the
bus path to it as well.
This looks quite clean to me. No special cases for device
classes, no assumptions whether devices stay usable after
suspend, and no compromises in following the power management

I've got some ideas how to seperate the shutdown functions
from suspend while using the pmf structures for ordering.
Please give me an hour to two to formulate this in C.

best regards

Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt

Home | Main Index | Thread Index | Old Index