Re: [PATCH 1/3] 2.6.0 aacraid driver update

Mark Haverkamp
2003-10-08T17:43:14Z

On Mon, 2003-10-06 at 14:55, Jeff Garzik wrote:
> Mark Haverkamp wrote:
>
> > +static void aac_io_done(Scsi_Cmnd * scsicmd)
> > +{
> > + unsigned long cpu_flags;
> > + struct Scsi_Host *host = scsicmd->device->host;
> > + spin_lock_irqsave(host->host_lock, cpu_flags);
> > + scsicmd->scsi_done(scsicmd);
> > + spin_unlock_irqrestore(host->host_lock, cpu_flags);
> > +}
>
> Do you really need the host lock to end an IO?

I ran an experiment and found that the host lock is held when the
aac_queuecommand function is called, which calls aac_scsi_cmd. This
function calls the __aac_io_done without taking the host lock. The
functions that call the version that take the lock do not already hold
it. I'm not sure that totally answers the question though but the code
is being consistent in how scsi_done is being called. Does anyone else
have some thoughts on this?

>
>
> > +static void __aac_io_done(Scsi_Cmnd * scsicmd)
> > +{
> > + scsicmd->scsi_done(scsicmd);
> > +}
>
> This stuff should be in scsi_lib.c or a header in include/scsi, don't
> you think?