NetBSD Problem Report #2921

Received: (qmail-queue invoked from smtpd); 7 Nov 1996 13:50:52 -0000
Message-Id: <199611071348.FAA00503@pgoyette.bdt.com>
Date: Thu, 7 Nov 1996 05:48:51 -0800 (PST)
From: Paul Goyette <paul@pgoyette.bdt.com>
Reply-To: paul@whooppee.com
To: gnats-bugs@gnats.netbsd.org
Subject: Some SCSI devices do not work in interrupt driven xfer mode
X-Send-Pr-Version: 3.95

>Number:         2921
>Category:       port-mac68k
>Synopsis:       Some SCSI devices do not work in interrupt driven xfer mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bouyer
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 07 06:05:01 +0000 1996
>Closed-Date:    Sat Feb 20 16:56:49 +0000 2010
>Last-Modified:  Sat Feb 20 16:56:49 +0000 2010
>Originator:     Paul Goyette
>Release:        1.2B
>Organization:
>Environment:
System: NetBSD pgoyette.bdt.com 1.2B NetBSD 1.2B (PGOYETTE) #108: 
	Tue Nov 5 06:08:28 PST 1996 
	paul@pgoyette.bdt.com:/home/paul/src/sys/arch/mac68k/compile/PGOYETTE 
	(current as of Tue Nov 5 04:29:12 1996) mac68k
>Description:
	Some devices, such as Exabyte 8200 tape drive, do not work well
	in interrupt-driven transfer mode.  Mine, for example, always ends
	up writing a null (0x00) byte in the next-to-last byte of every
	transfer!  This is obviously a vagary of the mac68k SCSI hardware
	and this using a SCSI "quirk" is not appropriate to fix this, since
	quirks are processed in the MI portions of the SCSI drivers.
>How-To-Repeat:
	Standard mac68k SCSI driver and Exabyte 8200 - just write to the 
	tape, then dump the dump!
>Fix:
	The patch below implements two new kernel compilation options that,
	when defined, force specific SCSI targets to use only the polled
	transfer mode.  If the options are undefined, the driver behaves 
	exactlyu as it does without the patch.  Two separate options are
	defined, one for Reads and one for Writes, since this problem can
	occur for one but not the other.  (My tape drive only exhibits the
	problem on Writes;  Reads work just fine in interrupt mode.)


*** /usr/src/sys/arch/mac68k/dev/mac68k5380.c	Fri Jun  7 04:39:26 1996
--- /home/paul/src/sys/arch/mac68k/dev/mac68k5380.c	Sun Jul 14 10:05:28 1996
***************
*** 123,128 ****
--- 123,148 ----
  static volatile u_char	*ncr_5380_with_drq	= (volatile u_char *)  0x6000;
  static volatile u_char	*ncr_5380_without_drq	= (volatile u_char *) 0x12000;

+ /*
+  * Define flags to force use of pio rather than pdma.
+  * We only define the flags if one or the other is needed 
+  * and when we check them in transfer_pdma(), we skip the
+  * check if neither flag is needed.
+  */
+ 
+ #ifdef	NCR_PIO_WRITE
+ #ifdef	NCR_PIO_READ
+ static	u_int8_t	ncr5380_use_pio[2] = { NCR_PIO_WRITE,
+ 					       NCR_PIO_READ };
+ #else	/* def NCR_PIO_READ */
+ static	u_int8_t	ncr5380_use_pio[2] = { NCR_PIO_WRITE, 0 };
+ #endif	/* def NCR_PIO_READ */
+ #else	/* def NCR_PIO_WRITE */
+ #ifdef	NCR_PIO_READ
+ static	u_int8_t	ncr5380_use_pio[2] = { 0, NCR_PIO_READ };
+ #endif	/* def NCR_PIO_READ */
+ #endif	/* def NCR_PIO_WRITE */
+ 
  #define SCSI_5380		((struct scsi_5380 *) ncr)
  #define GET_5380_REG(rnum)	SCSI_5380->scsi_5380[((rnum)<<4)]
  #define SET_5380_REG(rnum,val)	(SCSI_5380->scsi_5380[((rnum)<<4)] = (val))
***************
*** 550,558 ****
  	PID("transfer_pdma0")

  	/*
!  	 * Don't bother with PDMA if we can't sleep or for small transfers.
   	 */
! 	if (reqp->dr_flag & DRIVER_NOINT) {
  		PID("pdma, falling back to transfer_pio.")
  		transfer_pio(phasep, data, count, 0);
  		return -1;
--- 570,583 ----
  	PID("transfer_pdma0")

  	/*
!  	 * Don't bother with PDMA if we can't sleep or if 
! 	 * target is flagged as needing to use pio.
   	 */
! 	if   ((reqp->dr_flag & DRIVER_NOINT)
! #if	defined(NCR_PIO_READ) || defined(NCR_PIO_WRITE)
! 	  ||  (ncr5380_use_pio[(*phasep == PH_DATAOUT) ?1 : 0] & (1 << reqp->targ_id))
! #endif
! 	      ) {
  		PID("pdma, falling back to transfer_pio.")
  		transfer_pio(phasep, data, count, 0);
  		return -1;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: briggs 
State-Changed-When: Mon Nov 24 10:24:43 PST 1997 
State-Changed-Why:  

This is not a bad idea, but I think it would be better to fix the code to 
work in pdma mode on all devices.  Failing that, there should probably be 
an option to enable PIO mode on a per-target basis.  When PIO is enabled 
for a device, it should be enabled for both read and write. 

Responsible-Changed-From-To: gnats-admin->port-mac68k-maintainer 
Responsible-Changed-By: fair 
Responsible-Changed-When: Mon Dec 28 09:37:52 PST 1998 
Responsible-Changed-Why:  

This PR is the responsibility of the portmaster, 
not the GNATS database administrator. 

Responsible-Changed-From-To: port-mac68k-maintainer->bouyer 
Responsible-Changed-By: fair 
Responsible-Changed-When: Fri Apr 23 01:51:18 UTC 2004 
Responsible-Changed-Why:  

Manuel Bouyer is our SCSI guru, and I think he can take a look 
at this old PR to see if we can resolve it... 


From: Scott Reynolds <scottr@clank.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: port-mac68k/2921
Date: Sat, 1 May 2004 10:16:26 -0500

 This is a hardware issue, I'm almost entirely certain, but Manuel is 
 welcome to take a look.

State-Changed-From-To: suspended->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 27 Mar 2008 13:36:02 +0000
State-Changed-Why:
Is this issue still relevant? The world's changed quite a lot in the
interim (e.g. scsipi...)


From: Hauke Fath <hauke@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/2921 CVS commit: src/sys/arch/mac68k/conf
Date: Thu, 27 Mar 2008 20:00:24 +0000 (UTC)

 Module Name:	src
 Committed By:	hauke
 Date:		Thu Mar 27 20:00:24 UTC 2008

 Modified Files:
 	src/sys/arch/mac68k/conf: GENERICSBC INSTALLSBC SMALLRAM

 Log Message:
 Add explanation for the sbc flags to the kernel configurations that
 use the sbc 53c80 driver. Until now, this information has lived in the
 source code, only; neither sbc nor ncrscsi have a man page.

 Triggered by PR port-mac68k/2921


 To generate a diff of this commit:
 cvs rdiff -r1.55 -r1.56 src/sys/arch/mac68k/conf/GENERICSBC
 cvs rdiff -r1.31 -r1.32 src/sys/arch/mac68k/conf/INSTALLSBC
 cvs rdiff -r1.30 -r1.31 src/sys/arch/mac68k/conf/SMALLRAM

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: gnats-bugs@NetBSD.org
Cc: bouyer@NetBSD.org, gnats-admin@NetBSD.org, dholland@NetBSD.org,
        paul@whooppee.com
Subject: Re: port-mac68k/2921 (Some SCSI devices do not work in interrupt
 driven xfer mode)
Date: Thu, 27 Mar 2008 21:02:53 +0100

 At 13:36 Uhr +0000 27.3.2008, dholland@NetBSD.org wrote:
 >Synopsis: Some SCSI devices do not work in interrupt driven xfer mode
 >
 >Is this issue still relevant? The world's changed quite a lot in the
 >interim (e.g. scsipi...)

 Like Scott said, it's a hardware issue, in that case with the ncrscsi
 driver, AFAICS. NetBSD/mac68k has two drivers for the 53c80 still, because
 each of them  works with different devices (they both do not have a man
 page, is that right?). The MD code hasn't changed much throughout the years.

 That said, the sbc driver has the flags

 # SBC_PDMA      0x01    Use PDMA for polled transfers
 # SBC_INTR      0x02    Allow SCSI IRQ/DRQ interrupts
 # SBC_RESELECT  0x04    Allow disconnect/reselect

 They are not per-device, though, but globally.

 	hauke

 --
 "It's never straight up and down"     (DEVO)


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 27 Mar 2008 21:51:30 +0000
State-Changed-Why:
Issue is probably still alive. If anyone has suitable hardware and wants to
work on it, please go ahead...


From: Allen Briggs <briggs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: bouyer@NetBSD.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org,
  dholland@NetBSD.org, paul@whooppee.com
Subject: Re: port-mac68k/2921 (Some SCSI devices do not work in interrupt driven xfer mode)
Date: Thu, 27 Mar 2008 22:20:39 -0400

 FWIW, I have a scsi bus analyzer that was donated for working on
 mac68k scsi, but arrived after my time to work on it had dwindled.
 If anyone has time/interest, I would be willing to pass it along.

 -allen

 -- 
 Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: bouyer@NetBSD.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, 
    dholland@NetBSD.org
Subject: Re: port-mac68k/2921 (Some SCSI devices do not work in interrupt
 driven xfer mode)
Date: Fri, 28 Mar 2008 03:40:19 -0700 (PDT)

 On Thu, 27 Mar 2008, dholland@NetBSD.org wrote:

 > Synopsis: Some SCSI devices do not work in interrupt driven xfer mode
 >
 > State-Changed-From-To: suspended->feedback
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Thu, 27 Mar 2008 13:36:02 +0000
 > State-Changed-Why:
 > Is this issue still relevant? The world's changed quite a lot in the
 > interim (e.g. scsipi...)

 I have no idea - i has been years sinceI owned a Mac!

 Close thie PR!
 >

 ----------------------------------------------------------------------
 |   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
 | Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul@whooppee.com   |
 | Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette@juniper.net |
 ----------------------------------------------------------------------

State-Changed-From-To: open->closed
State-Changed-By: hubertf@NetBSD.org
State-Changed-When: Sat, 20 Feb 2010 16:56:49 +0000
State-Changed-Why:
Closed on request by the submitter.
If this still is a problem with a recent NetBSD version, please re-submit.

 - Hubert



>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.