tech-kern archive

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

Re: CVS commit: src/sys/kern said:
> I still believe drivers needs to get more informations from PMF to
> know what's going on. 

As a general philosophy, I'd prefer in most cases to
tell the driver exactly what to do. Otherwise we get
all kinds of creative abuse, as we have in the disk
spindown case.
It is also a matter of policy-implementation separation -
the driver shouldn't second-guess the user's or the higher
kernel code's intentions. said:
>    3. Get rid of pmf_device_register completely, and treat  suspend/
> resume/shutdown as event handlers. said:
> 4. a message/event handler at the device level, so we don't have this
>    discussion every couple of months. 

We need both imho.
As I see it, we have two distinct ways how these driver functions
are called:
a)walking the device tree upwards or downwards, as pmf_suspend/
  resume do. This is needed at least for system sleep.
  It is relative expensive and relies on a lot of data structures
  to be still intact, thus it is less ideal for an emergency
b)without ordering constraints, as all the hooks. This could well be
  done with event handlers. At driver level, so that for 10 disks
  we don't get 10 memory allocations but just one call for all eg "wd"
  disks and one for all "sd"s. If done well, no big linked lists need
  to be scanned at event time. Reboot with/without poweroff are
  good candidates to be handled that way.

Whether a pmf_device_register function is used or another entry
in the cfdriver or cfattach struct, is secondary imo. I'd
stick with the former until things have settled a bit more,
because every change to the _DECL macros increases the mess we
already have there.

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