Subject: port-arm32/10539: Kernel hangs probing SCSI devices attached to Acorn SCSI card
To: None <gnats-bugs@gnats.netbsd.org>
From: Mike Pumford <mpumford@black-star.demon.co.uk>
List: netbsd-bugs
Date: 07/08/2000 06:17:15
>Number:         10539
>Category:       port-arm32
>Synopsis:       Kernel hangs probing SCSI devices attached to Acorn SCSI card
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm32-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 08 06:18:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mike Pumford
>Release:        1.5ALPHA
>Organization:
>Environment:
	
System: NetBSD black-star.demon.co.uk 1.5_ALPHA NetBSD 1.5_ALPHA (BLACK-STAR) #3: Mon Jul 3 01:51:03 BST 2000 mpumford@black-star.demon.co.uk:/usr/src/netbsd/sys/arch/arm32/compile/BLACK-STAR arm32


>Description:
	The system will hang on booting at the point where it attempts to
probe the SCSI bus attached via the Acorn SCSI card.
>How-To-Repeat:
	Boot a RiscPC system with an Acorn SCSI card installed in it.
>Fix:
	The following patch will fixes the hang and returns the SCSI bus
	to normal behavior. It was derived from a fix made to a driver
	for the same chip in the architecture specific portion of another
	port.

Index: sbic.c
===================================================================
RCS file: /overflow/cvsrep/netbsd/sys/arch/arm32/podulebus/sbic.c,v
retrieving revision 1.1.1.7
diff -c -r1.1.1.7 sbic.c
*** sbic.c      2000/07/01 18:38:56     1.1.1.7
--- sbic.c      2000/07/02 19:51:16
***************
*** 533,543 ****
        dev->target = slp->scsipi_scsi.target;
        dev->lun = slp->scsipi_scsi.lun;
        if ( flags & XS_CTL_POLL || ( !sbic_parallel_operations
!                                  && (/*phase == STATUS_PHASE ||*/
!                                      sbicdmaok(dev, xs) == 0) ) )
                stat = sbicicmd(dev, slp->scsipi_scsi.target, slp->scsipi_scsi.lun, &acb->cmd,
                    acb->clen, acb->sc_kv.dc_addr, acb->sc_kv.dc_count);
!       else if (sbicgo(dev, xs) == 0) {
                SBIC_TRACE(dev);
                return;
        } else
--- 533,542 ----
        dev->target = slp->scsipi_scsi.target;
        dev->lun = slp->scsipi_scsi.lun;
        if ( flags & XS_CTL_POLL || ( !sbic_parallel_operations
!                                  && (sbicdmaok(dev, xs) == 0) ) )
                stat = sbicicmd(dev, slp->scsipi_scsi.target, slp->scsipi_scsi.lun, &acb->cmd,
                    acb->clen, acb->sc_kv.dc_addr, acb->sc_kv.dc_count);
!       else if (sbicgo(dev, xs) == 0 && xs->error != XS_SELTIMEOUT) {
                SBIC_TRACE(dev);
                return;
        } else
***************
*** 722,728 ****
        struct sbic_softc *dev;
        struct scsipi_xfer *xs;
  {
!       if (sbic_no_dma || xs->datalen & 0x1 || (u_int)xs->data & 0x3)
                return(0);
        /*
         * controller supports dma to any addresses?
--- 721,727 ----
        struct sbic_softc *dev;
        struct scsipi_xfer *xs;
  {
!       if (sbic_no_dma || !xs->datalen || xs->datalen & 0x1 || (u_int)xs->data & 0x3)
                return(0);
        /*
         * controller supports dma to any addresses?

>Release-Note:
>Audit-Trail:
>Unformatted: