From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 1/4 (final?)] ps3fb: thread updates Date: Wed, 21 Feb 2007 15:20:47 -0800 Message-ID: <20070221152047.0d3da74c.akpm@linux-foundation.org> References: <20070215152301.573853000@sonycom.com> <20070215152432.264415000@sonycom.com> <20070215175007.GA10817@lst.de> <1171575817.5644.44.camel@localhost.localdomain> <20070215165916.de546f0d.akpm@linux-foundation.org> <20070216163811.GB32051@lst.de> Reply-To: linux-fbdev-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1HK0lZ-0000eM-5x for linux-fbdev-devel@lists.sourceforge.net; Wed, 21 Feb 2007 15:20:54 -0800 Received: from smtp.osdl.org ([65.172.181.24]) by mail.sourceforge.net with esmtps (TLSv1:DES-CBC3-SHA:168) (Exim 4.44) id 1HK0lY-0000zS-Rq for linux-fbdev-devel@lists.sourceforge.net; Wed, 21 Feb 2007 15:20:53 -0800 In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: Geert Uytterhoeven Cc: Linux/PPC Development , Linux Frame Buffer Device Development , Christoph Hellwig On Tue, 20 Feb 2007 11:42:04 +0100 (CET) Geert Uytterhoeven wrote: > ps3fb: Replace the kernel_thread and the semaphore by a proper kthread, which is > simply woken up when the screen must be updated diff -puN drivers/video/ps3fb.c~ps3fb-thread-updates-2 drivers/video/ps3fb.c --- a/drivers/video/ps3fb.c~ps3fb-thread-updates-2 +++ a/drivers/video/ps3fb.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -808,16 +807,13 @@ static int ps3fb_ioctl(struct fb_info *i static int ps3fbd(void *arg) { - DEFINE_WAIT(wait); - DECLARE_WAIT_QUEUE_HEAD(wq); - while (!kthread_should_stop()) { - prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE); - if (!ps3fb.is_kicked) - schedule(); - finish_wait(&wq, &wait); - ps3fb.is_kicked = 0; - ps3fb_sync(0); /* single buffer */ + set_current_state(TASK_INTERRUPTIBLE); + if (ps3fb.is_kicked) { + ps3fb.is_kicked = 0; + ps3fb_sync(0); /* single buffer */ + } + schedule(); } return 0; } _ There's still no try_to_freeze() in there. Shouldn't we have one? ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV