Re: [PATCH] get rid of ->finish method for highlevel drivers

Mike Anderson
2002-10-22T23:17:14Z

Patrick Mansfield [patmans@us.ibm.com] wrote:
> On Tue, Oct 22, 2002 at 10:48:19AM -0500, James Bottomley wrote:
> >
> > I tracked down the essential problem: the CD rom finish method expects to have
> > allocated command blocks to do a mode sense. I also fixed a trivial
> > initialisation problem (the device pointer in Scsi_CD was being used before it
> > was initialised).
> >
> > The attached patch fixes the problem for me.
> >
> > I still can't detach and add a CD-ROM, but the panic is in sr_init, so doesn't
> > look to be affected by these changes, but I'll continue debugging.
> >
> > James
> >
>
> James -
>
> How do we end up with no command blocks if the slave_attach is
> calling scsi_build_commandblocks via scsi_adjust_queue_depth?

It appears after looking at this with Patrick that in drivers where
slave_attach is is not calling scsi_adjust_queue_depth the
scsi_build_commandblocks will not be called. In my case ips.c and in
James case 53c700.c.

If post calling slave_attach the new_queue_depth is 0 and the device is
not offline we should ensure there is at least a new_queue_depth of
1 which is what your patch does by later on calling
scsi_build_commandblocks directly.

-andmike
--
Michael Anderson
andmike@us.ibm.com