Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262078AbVAIJCE (ORCPT ); Sun, 9 Jan 2005 04:02:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262077AbVAIJCD (ORCPT ); Sun, 9 Jan 2005 04:02:03 -0500 Received: from einhorn.in-berlin.de ([192.109.42.8]:11984 "EHLO einhorn.in-berlin.de") by vger.kernel.org with ESMTP id S262263AbVAIJBg (ORCPT ); Sun, 9 Jan 2005 04:01:36 -0500 X-Envelope-From: stefanr@s5r6.in-berlin.de Date: Sun, 09 Jan 2005 10:01:21 +0100 Subject: Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Message-ID: <17a9eec54394ded0a28295a6548a5c65@localhost> MIME-Version: 1.0 (Generated by Pantomime 1.2.0) From: Stefan Richter To: linux1394-devel@lists.sourceforge.net Cc: kj , lkml , bcollins@debian.org, Nishanth Aravamudan In-Reply-To: <20050107213400.GD2924@us.ibm.com> X-Mailer: GNUMail (Version 1.2.0) Content-Type: text/plain; charset="us-ascii"; format="flowed" X-Spam-Score: (-1.635) AWL,BAYES_00 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1466 Lines: 37 Nishanth Aravamudan wrote: > Description: Use ssleep() instead of schedule_timeout() to guarantee > the task > delays as expected. The existing code should not really need to run in > TASK_INTERRUPTIBLE, as there is no check for signals (or even an > early return > value whatsoever). ssleep() takes care of these issues. > --- 2.6.10-v/drivers/ieee1394/sbp2.c 2004-12-24 13:34:00.000000000 > -0800 > +++ 2.6.10/drivers/ieee1394/sbp2.c 2005-01-05 14:23:05.000000000 -0800 > @@ -902,8 +902,7 @@ alloc_fail: > * connected to the sbp2 device being removed. That host would > * have a certain amount of time to relogin before the sbp2 device > * allows someone else to login instead. One second makes sense. */ > - set_current_state(TASK_INTERRUPTIBLE); > - schedule_timeout(HZ); > + ssleep(1); Maybe the current code is _deliberately_ accepting interruption by signals but trying to complete sbp2_probe() anyway. However it seems more plausible to me to abort the device probe, for example like this: if (msleep_interruptible(1000)) { sbp2_remove_device(scsi_id); return -EINTR; } Anyway, signal handling does not appear to be critical there. -- Stefan Richter -=====-=-=-= ---= -=--= http://arcgraph.de/sr/ - 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/