From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 1/1] cciss: resubmit kernel scan thread for MSA2012 Date: Mon, 15 Jun 2009 14:25:50 -0700 Message-ID: <20090615142550.7a840730.akpm@linux-foundation.org> References: <20090310151738.GA18243@beardog.cca.cpqcorp.net> <1236700241.14822.4.camel@localhost.localdomain> <20090310163426.GC18243@beardog.cca.cpqcorp.net> <20090310153933.7a7fc224.akpm@linux-foundation.org> <20090311161733.GF28208@beardog.cca.cpqcorp.net> <20090311151436.c9be9ab4.akpm@linux-foundation.org> <20090312162653.GA10839@beardog.cca.cpqcorp.net> <20090615203955.GD6471@beardog.cca.cpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:60626 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935281AbZFOV0S (ORCPT ); Mon, 15 Jun 2009 17:26:18 -0400 In-Reply-To: <20090615203955.GD6471@beardog.cca.cpqcorp.net> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: "Mike Miller (OS Dev)" Cc: James.Bottomley@HansenPartnership.com, jens.axboe@oracle.com, linux-scsi@vger.kernel.org, coldwell@redhat.com, hare@novell.com On Mon, 15 Jun 2009 15:39:55 -0500 "Mike Miller (OS Dev)" wrote: > I'm getting reports that the driver hangs in the scan thread during rmmod. I > call kthread_stop in cciss_remove_one. Do I also neesd to call complete()? Yep. static int scan_thread(void *data) { ctlr_info_t *h = data; int rc; DECLARE_COMPLETION_ONSTACK(wait); h->rescan_wait = &wait; for (;;) { rc = wait_for_completion_interruptible(&wait); if (kthread_should_stop()) break; if (!rc) rebuild_lun_table(h, 0); } return 0; } Two things will cause that wait_for_completion_interruptible() to return: a complete() and a signal_pending(). But this is a kernel thread, and kernel threads start out with all signals blocked. > During my testing everything seemed to working OK. That's odd.