Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 31 Jul 2002 06:07:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 31 Jul 2002 06:07:55 -0400 Received: from twilight.ucw.cz ([195.39.74.230]:32992 "EHLO twilight.ucw.cz") by vger.kernel.org with ESMTP id ; Wed, 31 Jul 2002 06:07:54 -0400 Date: Wed, 31 Jul 2002 12:10:54 +0200 From: Vojtech Pavlik To: David Woodhouse Cc: Vojtech Pavlik , Russell King , linux-kernel@vger.kernel.org, linuxconsole-dev@lists.sourceforge.net Subject: Re: [patch] Fix suspend of the kseriod thread Message-ID: <20020731121054.A26396@ucw.cz> References: <20020730225736.K7677@flint.arm.linux.org.uk> <20020730122638.A11153@ucw.cz> <20020730122918.A11248@ucw.cz> <20020730152255.A20071@ucw.cz> <20020730152342.B20071@ucw.cz> <20020730221722.A22761@ucw.cz> <20020730225736.K7677@flint.arm.linux.org.uk> <9658.1028109354@redhat.com> <20020731115818.A26329@ucw.cz> <10657.1028110041@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <10657.1028110041@redhat.com>; from dwmw2@infradead.org on Wed, Jul 31, 2002 at 11:07:21AM +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1101 Lines: 36 On Wed, Jul 31, 2002 at 11:07:21AM +0100, David Woodhouse wrote: > vojtech@suse.cz said: > > Ok. Is the use in drivers/input/serio.c buggy? > > If it matters that the thread can miss wakeup events and sleep indefinitely > while there's a 'SERIO_RESCAN' event pending, then yes it looks buggy. > > serio_thread() serio_rescan() > -------------- -------------- > > serio_handle_events(); > serio->event |= SERIO_RESCAN; > wake_up(&serio_wait); > sleep_on(&serio_wait); > > ...sleeps... > > If both serio_thread() and serio_rescan() hold the BKL you're OK. It looks > like serio_rescan() doesn't, though. Thanks for the explanation. Yes, this could happen. > > What should be it replaced with? > > In general, the response 'anything but sleep_on' is considered appropriate. > Try wait_event(). -- Vojtech Pavlik SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/