Re: NAK new drivers without proper power management?



On Monday, 12 February 2007 17:52, Pavel Machek wrote:
Hi!

Neither am I. I'm just asking that new drivers have power management as
standard.

What if the hardware doesn't support power management ?

You would still want to do the cleanup and configuration that you'd do
for module load/unload.

By adding dummy functions, wouldn't that just look awkward ?

If all you need to do is say 'I don't need to do anything' and we have a
shared function that does that, all we're talking about doing is adding
to your struct pci_device (or whatever)

.resume = generic_empty_resume;

To me at least, that doesn't look awkward, and says cleanly and clearly
that you've checked things over and decided you know what's required.

Actually, I'd like it to be

.resume = generic_empty_resume; /* Explain, why your driver needs no
resume */

Okay, but we can't define an empty .resume(), because, for example, the PCI's
generic suspend/resume won't be called.

I think we can introduce a "pm_safe" flag that will indicate if the driver
handles suspend/resume correctly. If we do it, we can flag all of the drivers
currently in the tree as "pm_safe" unless we know that they aren't. Next,
we can convert the core to fail the suspend for any driver that is not flagged
as "pm_safe". But I think that will take time.

In the meantime, I'd like to ask the authors of new drivers to define
error-returning .suspend() if they don't intend to define "real" .suspend()
and .resume() for now. When we are ready with the conversion, we'll be able
to drop the error-returning .suspend()s and clear "pm_safe" for them.

Greetings,
Rafael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [PATCH 1/3] leds: fix led-bd2802 errors while resuming
    ... LED_CORE_SUSPENDRESUME flag is not needed in the bd2802 driver, ... because all works for suspend/resume is done in bd2802_suspend and ... And this patch allows bd2802 to be configured again when it resumes ...
    (Linux-Kernel)
  • cvs-src summary for May 24-31
    ... Tony Ackerman committed the first release of the ixgb driver, ... Brooks Davis added support for a /etc/eui64 file, ... Oliver Eikemeier added a "-depth n" flag to find. ... Dag-Erling Smorgrav fixed a bug in the msync system call that permitted ...
    (freebsd-current)
  • Re: How to find out whether Reboot is needed after SetupDiRemoveDevice(...),...?
    ... // Flag to indicate the setting properties for this Device caused a change ... // Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver ... // This flag is set if the Class Install params should be used. ... public IntPtr InstallMsgHandler; ...
    (microsoft.public.development.device.drivers)
  • Re: NAK new drivers without proper power management?
    ... why not just implement power management? ... code to cleanup and configure hardware state; things that the driver ... Well, it couldn't actually be an empty routine (at least not for a PCI device), since the generic PCI suspend/resume handling doesn't get called if you have suspend/resume functions defined, so you'd have to do ...
    (Linux-Kernel)
  • Re: HOTKEY / MOD_KEYUP
    ... It was *not* designed to allow you to be part of the keyboard driver, ... To get both UP dan DOWN keys, I use the MOD_LKEYUP flag. ... When I put the app on the foreground I do see both WM_KEYDOWN, ...
    (microsoft.public.windowsce.platbuilder)