Re: [PATCH] [v2] aha152x cmnd->device oops

James Bottomley
2003-10-29T14:58:43Z

On Wed, 2003-10-29 at 06:20, Juergen E. Fischer wrote:
> 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().

You don't actually need a new command for this. The struct scsi_cmnd
layout is designed to allow you to reuse the current command for
clearing contingent allegiance conditions (the fields you need to alter
all have copies stored somewhere which you can restore when you have the
sense data. See for example how the 53c700 does this, or aic7xxx_old)

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

As a rule of thumb: as long as the command is never seen outside the
driver, then using kmalloc is fine. If it is ever seen outside the
driver (like in requeueing conditions) then you should use
scsi_get_command().

James

James