All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Juergen E. Fischer" <fischer@linux-buechse.de>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com,
	fischer@norbit.de
Subject: Re: [PATCH] [v2] aha152x cmnd->device oops
Date: Wed, 29 Oct 2003 13:20:09 +0100	[thread overview]
Message-ID: <20031029122008.GA5903@linux-buechse.de> (raw)
In-Reply-To: <20031028162610.6dcfd06e.rddunlap@osdl.org>

Hi Randy,

On Tue, Oct 28, 2003 at 16:26:10 -0800, Randy.Dunlap wrote:
> On Tue, 28 Oct 2003 14:50:28 -0800 Mike Christie <mikenc@us.ibm.com> wrote:
> 
> | Hi Randy,
> | 
> | >  			if(!(DONE_SC->SCp.Status & not_issued)) {
> | > -				Scsi_Cmnd *cmnd = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
> | > +				Scsi_Cmnd *cmnd = scsi_get_command(DONE_SC->device, GFP_ATOMIC);
> | 
> | Do you need to add a scsi_put_command to balance this get when the 
> | command completes?
> | 
> | > +					cmnd->device          = ptr->device;
> | 
> | Don't even need this now. scsi_get_command will set the device for you.
> | 
> | Mike
> 
> Hers's v3 of the aha152x patch.  However, I'm not satisfied with it,
> so I'm not asking James to apply it.  I don't know the state machine
> or the hardware well enough to understand and patch it.

> Things that I don't like about it:
> 
> a.  calling aha152x_internal_queue() with cmnd pointer in 2 places.
>     Probably the second one should be NULL.
> b.  Easy to confuse the state machine by changing just one variable,
>     like DONE_SC (i.e., it's risky and I can't test it, although we
>     do have a bug report and can ask that reporter to test it).
> c.  int result = SCpnt->SCp.Status; /*FIXME*/
>     SCp.Status is not valid here AFAIK, and I don't know how to get
>     the current command status at this point.

There are 2 specially "commands" which are used internally in the driver
only (so I don't see a problem in using kmalloc instead of
scsi_get_command; but nevertheless ->device needs to be intialized
correctly, which is what scsi_get_command() does and the current code
fails to do). 

The first is when a command returns with status CHECK CONDITION and the
driver needs to do a REQUEST SENSE to fetch sense data and add that to
the Ssci_Cmnd which resulted in the CHECK CONDITION.  The internally
queued command fills the sense_buffer of the offending command and then
calls its ->scsi_done().

The second it when the controller needs to be resetted.  Both are purely
internal to the driver.

I'll test this in the evening.


Jürgen

-- 
Phase 1: Where do you want to go today?
Phase 2: This is where you want to go today.
Phase 3: You're not going anywhere today.
  -- seen on /.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2003-10-29 12:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27 15:57 [PATCH] scsi_device refcounting and list lockdown Christoph Hellwig
2003-10-28  0:01 ` Randy.Dunlap
2003-10-28  9:06   ` Christoph Hellwig
2003-10-28 20:45     ` [PATCH] [v2] aha152x cmnd->device oops Randy.Dunlap
2003-10-28 22:50       ` Mike Christie
2003-10-28 22:50         ` Randy.Dunlap
2003-10-29  0:26         ` Randy.Dunlap
2003-10-29 12:20           ` Juergen E. Fischer [this message]
2003-10-29 14:58             ` James Bottomley
2003-10-29 17:56               ` Juergen E. Fischer
2003-10-29 18:10                 ` James Bottomley
2003-10-30 21:19                   ` Juergen E. Fischer
2003-10-29 13:42       ` Christoph Hellwig
2003-10-28  2:32 ` [PATCH] scsi_device refcounting and list lockdown Mike Anderson
2003-10-28  9:07   ` Christoph Hellwig
2003-10-28 15:52     ` James Bottomley
2003-10-28 17:37       ` Christoph Hellwig
2003-10-30 22:41 ` James Bottomley
2003-10-31  9:11   ` Christoph Hellwig
2003-11-14 11:50 ` Christoph Hellwig

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=20031029122008.GA5903@linux-buechse.de \
    --to=fischer@linux-buechse.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=fischer@norbit.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    /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.