Subject: Re: More on se0
To: NetBSD port-atari mailing list <port-atari@netbsd.org>
From: Julian Coleman <J.D.Coleman@newcastle.ac.uk>
List: port-atari
Date: 08/09/1998 11:18:33
I wrote:
> 		scsipi_execute_xs()
> 		ncr5380_scsi_cmd()
> 		run_main()
> 		scsi_main()
> 		information_transfer()
> 		handle_message()
> 
> This is where I think the problem is.  In ncr5380_scsi_cmd() (file
> ... src/sys/arch/atari/dev/ncr5380.c), there are the lines :
> 
> 	run_main(xs->sc_link->adaptor_softc);
> 	if (xs->flags & SCSI_POLL|ITSDONE)
> 		return (COMPLETE);
> 	return (SUCESSFULLY_QUEUED);
> 
> Back in scsipi_execute_xs() (file ... src/sys/dev/scsipi/scsipi_base.c),
> returning 'SUCESSFULLY_QUEUED' causes :
> 
> 	case SUCESSFULLY_QUEUED:
> 		...
> 		tsleep (xs, PRIBIO + 1, "scsipi_cmd", 0);

Now I'm confused.  handle_message() (case CMD_COMPLETE: )calls finish_req(),
which OR's reqp->xs->flags with ITSDONE.  reqp is a pointer to connected
(set in information_transfer()).  This has no affect on xs->flags in
ncr5380_scsi_cmd(), because that returns 'SUCESSFULLY_QUEUED'.  I notice
this also happens with disk transfers, but they seem to do a disconnect
before command complete and don't have any problems.

Trouble is, I don't know what the solution is.  I also don't see what
connected is set to.  I presume that setting reqp->xs->flags in
finish_req() should be equivalent to setting xs->flags in
ncr5380_scsi_cmd(), but am I missing something obvious here [*]?

J

[*]  Very probably, because I haven't really looked at the SCSI code in
much detail before.  Then again, I haven't needed to before ... :-)
-- 
    1024/55A5BC19        0F 3F 62 56 18 10 8B 84  43 8F F4 94 93 37 76 AA

S.E.P.