Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 00:01:39 -0800
From:      "Justin T. Gibbs" <gibbs@freefall.freebsd.org>
To:        Keith Mitchell <kmitch@unix.guru.org>
Cc:        ache, scsi
Subject:   Re: SCB paging is most dangerous option now! 
Message-ID:  <199611140801.AAA21994@freefall.freebsd.org>
In-Reply-To: Your message of "Wed, 13 Nov 1996 18:48:10 EST." <199611132348.SAA00360@unix.guru.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> Can you see if this patch to current affects that behavior at all?
>
>No change. 
>

How about this one.  You will have to back out the other diff I sent.
--
Justin T. Gibbs
===========================================
  FreeBSD: Turning PCs into workstations
===========================================

Index: dev/aic7xxx/aic7xxx.seq
===================================================================
RCS file: /usr/cvs/src/sys/dev/aic7xxx/aic7xxx.seq,v
retrieving revision 1.48
diff -c -r1.48 aic7xxx.seq
*** aic7xxx.seq	1996/11/11 05:16:36	1.48
--- aic7xxx.seq	1996/11/14 07:25:49
***************
*** 540,546 ****
  	mvi	CLRSINT1,CLRATNO			/* drop ATN */
  p_mesgout_outb:
  	dec	DINDEX
! 	or	CLRSINT1, CLRREQINIT
  	mov	SCSIDATL,SINDIR
  	
  p_mesgout4:
--- 540,546 ----
  	mvi	CLRSINT1,CLRATNO			/* drop ATN */
  p_mesgout_outb:
  	dec	DINDEX
! 	mvi	CLRSINT1, CLRREQINIT
  	mov	SCSIDATL,SINDIR
  	
  p_mesgout4:
***************
*** 839,850 ****
  
  /*
   * Bus free phase.  It might be useful to interrupt the device
!  * driver if we aren't expecting this.  For now, make sure that
!  * ATN isn't being asserted and look for a new command.
   */
  p_busfree:
! 	mvi	CLRSINT1,CLRATNO
! 	clr	LASTPHASE
  
  /*
   * if this is an immediate command, perform a psuedo command complete to
--- 839,848 ----
  
  /*
   * Bus free phase.  It might be useful to interrupt the device
!  * driver if we aren't expecting this.
   */
  p_busfree:
! 	mvi	LASTPHASE, P_BUSFREE
  
  /*
   * if this is an immediate command, perform a psuedo command complete to
***************
*** 901,916 ****
   */
  
  inb_next:
! 	or	CLRSINT1, CLRREQINIT
  	mov	NONE,SCSIDATL			/*dummy read from latch to ACK*/
  inb_next_wait:
- 	test	SSTAT1,REQINIT	jz inb_next_wait /* wait for next byte */
- inb_first:
  	test	SSTAT1,PHASEMIS	jnz mesgin_phasemis
  	mov	DINDEX,SINDEX
  	mov	DINDIR,SCSIBUSL	ret		/*read byte directly from bus*/
  inb_last:
- 	or	CLRSINT1, CLRREQINIT
  	mov	NONE,SCSIDATL ret		/*dummy read from latch to ACK*/
  
  mesgin_phasemis:
--- 899,913 ----
   */
  
  inb_next:
! 	mvi	CLRSINT0, CLRSPIORDY
  	mov	NONE,SCSIDATL			/*dummy read from latch to ACK*/
  inb_next_wait:
  	test	SSTAT1,PHASEMIS	jnz mesgin_phasemis
+ 	test	SSTAT0, SPIORDY jz inb_next_wait
+ inb_first:
  	mov	DINDEX,SINDEX
  	mov	DINDIR,SCSIBUSL	ret		/*read byte directly from bus*/
  inb_last:
  	mov	NONE,SCSIDATL ret		/*dummy read from latch to ACK*/
  
  mesgin_phasemis:
Index: dev/aic7xxx/aic7xxx_reg.h
===================================================================
RCS file: /usr/cvs/src/sys/dev/aic7xxx/aic7xxx_reg.h,v
retrieving revision 1.16
diff -c -r1.16 aic7xxx_reg.h
*** aic7xxx_reg.h	1996/11/11 05:16:41	1.16
--- aic7xxx_reg.h	1996/11/13 07:03:04
***************
*** 439,444 ****
--- 439,446 ----
  						 * beyond the bounds of its
  						 * command.
  						 */
+ #define			SCB_TRACE_POINT	0xf1
+ 
  #define 	BRKADRINT 0x08
  #define		SCSIINT	  0x04
  #define		CMDCMPLT  0x02
***************
*** 530,535 ****
--- 532,538 ----
  #define		MK_MESSAGE      0x80
  #define		DISCENB         0x40
  #define		TAG_ENB		0x20
+ #define		TRACE_SCB	0x10
  #define		ABORT_SCB	0x08
  #define		DISCONNECTED	0x04
  #define		SCB_TAG_TYPE	0x03
***************
*** 681,686 ****
--- 684,691 ----
  #define MSG5			0x03a
  
  #define LASTPHASE		0x03b
+ #define		P_BUSFREE	0x01
+ 
  #define ARG_1			0x03c
  #define RETURN_1		0x03c
  #define		SEND_MSG	0x80
Index: i386/scsi/aic7xxx.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/scsi/aic7xxx.c,v
retrieving revision 1.85
diff -c -r1.85 aic7xxx.c
*** aic7xxx.c	1996/11/11 05:24:44	1.85
--- aic7xxx.c	1996/11/13 05:38:59
***************
*** 1206,1227 ****
  			if (xs->error == XS_NOERROR)
  				xs->error = XS_DRIVER_STUFFUP;
  			break;
  		case SCSI_BUSY:
  			xs->error = XS_BUSY;
  			sc_print_addr(xs->sc_link);
  			printf("Target Busy\n");
  			break;
- 		case SCSI_QUEUE_FULL:
- 			/*
- 			 * The upper level SCSI code will someday
- 			 * handle this properly.
- 			 */
- 			printf("Queue Full\n");
- 			/*
- 			 * XXX requeue this unconditionally.
- 			 */
- 			STAILQ_INSERT_HEAD(&ahc->waiting_scbs, scb, links);
- 			break;
  		default:
  			sc_print_addr(xs->sc_link);
  			printf("unexpected targ_status: %x\n", hscb->status);
--- 1206,1243 ----
  			if (xs->error == XS_NOERROR)
  				xs->error = XS_DRIVER_STUFFUP;
  			break;
+ 		case SCSI_QUEUE_FULL:
+ 			if (scb->hscb->control & TAG_ENB) {
+ 				/*
+ 				 * The upper level SCSI code in 3.0
+ 				 * handles this properly...
+ 				 */
+ 				struct scsi_link *sc_link;
+ 
+ 				sc_link = xs->sc_link;
+ 				if (sc_link->active > 2
+ 				 && sc_link->opennings != 0) {
+ 					/* truncate the opennings */
+ 					sc_link->opennings = 0;
+ 					sc_print_addr(sc_link);
+ 					printf("Tagged openings reduced to "
+ 					       "%d\n", sc_link->active);
+ 				}
+ 				/*
+ 				 * XXX requeue this unconditionally.
+ 				 */
+ 				STAILQ_INSERT_TAIL(&ahc->waiting_scbs, scb,
+ 						   links);
+ 				break;
+ 			}
+ 			/* Else treat as if it is a BUSY condition */
+ 			scb->hscb->status = SCSI_BUSY;
+ 			/* Fall Through... */
  		case SCSI_BUSY:
  			xs->error = XS_BUSY;
  			sc_print_addr(xs->sc_link);
  			printf("Target Busy\n");
  			break;
  		default:
  			sc_print_addr(xs->sc_link);
  			printf("unexpected targ_status: %x\n", hscb->status);
***************
*** 1371,1376 ****
--- 1387,1430 ----
  	case MSGIN_PHASEMIS:
  		break;
  #endif
+ 	case SCB_TRACE_POINT:
+ 	{
+ 		/*
+ 		 * Print out the bus phase
+ 		 */
+ 		char	 *phase;
+ 		u_int8_t scbindex = ahc_inb(ahc, SCB_TAG);
+ 		u_int8_t lastphase = ahc_inb(ahc, LASTPHASE);
+ 
+ 		scb = ahc->scb_data->scbarray[scbindex];
+ 		sc_print_addr(scb->xs->sc_link);
+ 
+ 		switch (lastphase) {
+ 		case P_DATAOUT:
+ 			phase = "Data-Out";
+ 			break;
+ 		case P_DATAIN:
+ 			phase = "Data-In";
+ 			break;
+ 		case P_COMMAND:
+ 			phase = "Command";
+ 			break;
+ 		case P_MESGOUT:
+ 			phase = "Message-Out";
+ 			break;
+ 		case P_STATUS:
+ 			phase = "Status";
+ 			break;
+ 		case P_MESGIN:
+ 			phase = "Message-In";
+ 			break;
+ 		default:
+ 			phase = "busfree";
+ 			break;
+ 		}
+ 		printf("- %s\n", phase);
+ 		break;
+ 	}
  	default:
  		printf("ahc_intr: seqint, "
  		       "intstat == 0x%x, scsisigi = 0x%x\n",
***************
*** 2090,2095 ****
--- 2144,2154 ----
  		if (ahc->tagenable & mask)
  			hscb->control |= TAG_ENB;
  	}
+ 
+ 	/* Set the trace flag if this is the target we want to trace */
+ 	if (ahc->unit == 2 && xs->sc_link->target == 3)
+ 		hscb->control |= TRACE_SCB;
+ 
  	hscb->tcl = ((xs->sc_link->target << 4) & 0xF0)
  		  | (IS_SCSIBUS_B(ahc,xs->sc_link)? SELBUSB : 0)
  		  | (xs->sc_link->lun & 0x07);
***************
*** 2490,2496 ****
  	 */
  	bus_state = ahc_inb(ahc, LASTPHASE);
  
! 	switch(bus_state & PHASE_MASK)
  	{
  	case P_DATAOUT:
  		printf("in dataout phase");
--- 2549,2555 ----
  	 */
  	bus_state = ahc_inb(ahc, LASTPHASE);
  
! 	switch(bus_state)
  	{
  	case P_DATAOUT:
  		printf("in dataout phase");




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611140801.AAA21994>