From 1f45f9dbb392f9ca0919e9cd2370ab66ae752ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20St=C3=BCbner?= Date: Sat, 28 Apr 2012 12:19:10 +0200 Subject: fb_defio: add first_io callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this optional callback the driver is notified when the first page is entered into the pagelist and a new deferred_io call is scheduled. A possible use-case for this is runtime-pm. In the first_io call pm_runtime_get() could be called, which starts an asynchronous runtime_resume of the device. In the deferred_io callback a call to pm_runtime_barrier() makes the sure, the device is resumed by then and a pm_runtime_put() may put the device back to sleep. Also, some SoCs may use the runtime-pm system to determine if they are able to enter deeper idle states. Therefore it is necessary to keep the use-count from the first written page until the conclusion of the screen update, to prevent the system from going to sleep before completing the pending update. Two users of defio were using kmalloc to allocate the structure. These allocations are changed to kzalloc, to prevent uninitialised .first_io members in those drivers. Signed-off-by: Heiko Stübner Signed-off-by: Florian Tobias Schandinat --- drivers/video/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/udlfb.c') diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index a159b63e18b9..e9d43b403432 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -893,7 +893,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); + fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); if (fbdefio) { fbdefio->delay = DL_DEFIO_WRITE_DELAY; -- cgit v1.2.3