lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 15 Feb 2011 16:20:15 -0800
From:	"Benenati, Chris J" <chris.j.benenati@...el.com>
To:	"Hans J. Koch" <hjk@...sjkoch.de>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: power management of user-space drivers

[added line breaks]

Thanks for your reply. I understand (pretty much) the suspend/resume interface and
its registration via the Linux device model.

However, that is a kernel-level interface. Assuming you have a kernel component to 
your driver, I suppose it could register a suspend() function and communicate it to
the user space part of the driver.

But in a case like suspend-to-RAM, the kernel freezes user space threads before the
suspend() functions are invoked.  By the time the suspend function is called, it is
too late to communicate with user space. 

Is there a form of user-space driver notification supported by the kernel? Or does
the kernel portion of the driver have to register for kernel notifications (which
precede thread freezing) and alert the user space portion before it is frozen? 

-----Original Message-----
From: Hans J. Koch [mailto:hjk@...sjkoch.de] 
Sent: Tuesday, February 15, 2011 3:13 PM
To: Benenati, Chris J
Cc: hjk@...sjkoch.de
Subject: Re: power management of user-space drivers

On Tue, Feb 15, 2011 at 01:46:03PM -0800, Benenati, Chris J wrote:
> Somebody brought your web page http://www.kernel.org/doc/htmldocs/uio-howto.html
> to my attention.

Hi Chris,
first of all: Please don't send private mail to kernel maintainers unless
you're willing to pay for private consultation. UIO is discussed on the
Linux Kernel Mailing List (LKML), and it's a benefit for everyone if these
discussions are public and can be found in the archives by search engines.

So, please make sure you Cc: LKML (linux-kernel@...r.kernel.org) in any
further mails.

> 
> How do you handle power management with such a driver?  For example, if state
> has to be saved before a suspend-to-RAM, or reinitialized on the subsequent resume.

You need to do that yourself, e.g. for a PCI card by implementing a suspend()
and resume() function and setting the respective pointers in struct pci_driver.
These functions will be called automatically by the driver core, and you can do
whatever you need there.

A way to implement such a thing for platform devices can be found in
drivers/uio/uio_pdrv_genirq.c

Thanks,
Hans

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ