All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: scameron@beardog.cca.cpqcorp.net, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, mikem@beardog.cca.cpqcorp.net
Subject: Re: [PATCH 2/2] cciss: Fix SCSI device reset handler
Date: Tue, 2 Jun 2009 19:58:14 +0200	[thread overview]
Message-ID: <20090602175814.GO11363@kernel.dk> (raw)
In-Reply-To: <20090602105114.fe754481.akpm@linux-foundation.org>

On Tue, Jun 02 2009, Andrew Morton wrote:
> On Tue, 2 Jun 2009 14:50:11 +0200
> Jens Axboe <jens.axboe@oracle.com> wrote:
> 
> > On Fri, May 29 2009, Andrew Morton wrote:
> > > On Wed, 27 May 2009 15:30:07 -0500
> > > scameron@beardog.cca.cpqcorp.net wrote:
> > > 
> > > > +static int wait_for_device_to_become_ready(ctlr_info_t *h,
> > > > +	unsigned char lunaddr[])
> > > > +{
> > > > +	int rc;
> > > > +	int count = 0;
> > > > +	int waittime = HZ;
> > > > +	CommandList_struct *c;
> > > > +
> > > > +	c = cmd_alloc(h, 1);
> > > > +	if (!c) {
> > > > +		printk(KERN_WARNING "cciss%d: out of memory in "
> > > > +			"wait_for_device_to_become_ready.\n", h->ctlr);
> > > > +		return IO_ERROR;
> > > > +	}
> > > > +
> > > > +	/* Send test unit ready until device ready, or give up. */
> > > > +	while (count < 20) {
> > > > +
> > > > +		/* Wait for a bit.  do this first, because if we send
> > > > +		 * the TUR right away, the reset will just abort it.
> > > > +		 */
> > > > +		set_current_state(TASK_INTERRUPTIBLE);
> > > > +		schedule_timeout(waittime);
> > > 
> > > That's schedule_timeout_interruptible().
> > > 
> > > The problem with interruptible sleeps of this nature is that they are
> > > no-ops if the calling process happens to have signal_pending().  I
> > > suspect that this condition will break your driver.
> > > 
> > > If so, switching to schedule_timeout_uninterruptible() will unbreak it.
> > 
> > I added Stephens patch and your fixup.
> 
> My cciss-fix-scsi-device-reset-handler-fix.patch was a simple cleanup -
> it uses schedule_timeout_interruptible().
> 
> I believe that this should be changed to
> schedule_timeout_uninterruptible() for the above reasons, but the cciss
> guys fell asleep on me.

It's an improvement, none the less. And I bet it should just be
uninterruptible sleep, unless it has a good reason to accept signals.
Mike? Stephen?

-- 
Jens Axboe


  reply	other threads:[~2009-06-02 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27 20:30 [PATCH 2/2] cciss: Fix SCSI device reset handler scameron
2009-05-29 19:42 ` Andrew Morton
2009-05-29 19:42   ` Andrew Morton
2009-06-02 12:50   ` Jens Axboe
2009-06-02 15:51     ` Mike Miller (OS Dev)
2009-06-02 17:51     ` Andrew Morton
2009-06-02 17:58       ` Jens Axboe [this message]
2009-06-02 18:20         ` scameron
2009-06-02 18:28           ` Jens Axboe
2009-06-02 18:40             ` scameron

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=20090602175814.GO11363@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cca.cpqcorp.net \
    --cc=scameron@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.