public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>
Cc: James.Bottomley@HansenPartnership.com, jens.axboe@oracle.com,
	linux-scsi@vger.kernel.org, coldwell@redhat.com, hare@novell.com
Subject: Re: [PATCH 1/1] cciss: resubmit kernel scan thread for MSA2012
Date: Mon, 15 Jun 2009 15:41:50 -0700	[thread overview]
Message-ID: <20090615154150.fd02f22c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090615221735.GF6471@beardog.cca.cpqcorp.net>

On Mon, 15 Jun 2009 17:17:35 -0500
"Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net> wrote:

> On Mon, Jun 15, 2009 at 02:25:50PM -0700, Andrew Morton wrote:
> > On Mon, 15 Jun 2009 15:39:55 -0500
> > "Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net> 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.
> 
> Yeah, I guess so. Here's a patch to fix that problem. I add a call to
> complete to cciss_remove_one to stop the thread for rmmod. Please consider
> this for inclusion. Or should I submit separately from this mail?

Well it's a bit crappy - someone need to cook up a suitable title and
write a suitable changelog.  I'd prefer that it be you ;)

<writes a title and changelog.  Sigh>

> Signed-off-by: Mike Miller <mike.miller@hp.com>
> 
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 4d4d5e0..e51a0b2 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -3935,6 +3935,7 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
>  		return;
>  	}
>  
> +	complete(hba[i]->rescan_wait);
>  	kthread_stop(hba[i]->cciss_scan_thread);
>  
>  	remove_proc_entry(hba[i]->devname, proc_cciss);

Has this been confirmed to fix things?

This is needed in 2.6.30.x, yes?

  reply	other threads:[~2009-06-15 22:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 15:17 [PATCH 1/1] cciss: resubmit kernel scan thread for MSA2012 Mike Miller (OS Dev)
2009-03-10 15:46 ` Mike Miller (OS Dev)
2009-03-10 15:50 ` James Bottomley
2009-03-10 16:34   ` Mike Miller (OS Dev)
2009-03-10 22:39     ` Andrew Morton
2009-03-11 14:31       ` Mike Miller (OS Dev)
2009-03-11 15:21       ` Mike Miller (OS Dev)
2009-03-11 16:17       ` Mike Miller (OS Dev)
2009-03-11 22:14         ` Andrew Morton
2009-03-12 16:26           ` Mike Miller (OS Dev)
2009-06-15 20:39             ` Mike Miller (OS Dev)
2009-06-15 21:25               ` Andrew Morton
2009-06-15 22:17                 ` Mike Miller (OS Dev)
2009-06-15 22:41                   ` Andrew Morton [this message]
2009-06-16 19:07                     ` Mike Miller (OS Dev)
2009-06-16 19:17                       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090615154150.fd02f22c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=coldwell@redhat.com \
    --cc=hare@novell.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cca.cpqcorp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox