Subject: kern/19299: Patch to make twe(4) driver work with large capacity Escalade cards.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <buhrow@lothlorien.nfbcal.org>
List: netbsd-bugs
Date: 12/06/2002 01:53:26
>Number:         19299
>Category:       kern
>Synopsis:       The twe(4) driver is too quic to time out on large capacity cards.
>Confidential:   yes
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 06 01:54:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Brian Buhrow
>Release:        1.6, 1.6-current
>Organization:
	NFB of California
>Environment:
    	All platforms supporting the twe(4) driver.
System: NetBSD 1.6/i386


>Description:
	
	Following up again on my own adventures with the twe(4) driver, I've
got things working.  Below is the patch I needed to use to get the card
communicating with the driver.  The stock driver is very quick to timeout
when polling the card.  This is a 12-port card with 12 200GB disks attached
to it.  It takes a while to do a soft reset and a config.
	I'll send-pr this diff file, which should easily 
apply to 1.6 and 1.6-current, and hope it gets integrated into the release.
 I think we should be able to support any sized Escalade card out of the
box, and I believe this simple patch does just that.
-thanks
-Brian

*** twe.c	Fri Dec  6 00:21:48 2002
--- twe.c.fcs	Sun May 26 09:05:36 2002
***************
*** 373,379 ****
  	    TWE_CTL_CLEAR_ERROR_STS |
  	    TWE_CTL_DISABLE_INTRS);
  
! 	if (twe_status_wait(sc, TWE_STS_ATTN_INTR, 150)) {
  		printf("%s: no attention interrupt\n",
  		    sc->sc_dv.dv_xname);
  		return (-1);
--- 373,379 ----
  	    TWE_CTL_CLEAR_ERROR_STS |
  	    TWE_CTL_DISABLE_INTRS);
  
! 	if (twe_status_wait(sc, TWE_STS_ATTN_INTR, 15)) {
  		printf("%s: no attention interrupt\n",
  		    sc->sc_dv.dv_xname);
  		return (-1);
***************
*** 633,639 ****
  	/* Submit the command and either wait or let the callback handle it. */
  	if (func == NULL) {
  		s = splbio();
! 		rv = twe_ccb_poll(sc, ccb, 500);
  		twe_ccb_unmap(sc, ccb);
  		twe_ccb_free(sc, ccb);
  		splx(s);
--- 633,639 ----
  	/* Submit the command and either wait or let the callback handle it. */
  	if (func == NULL) {
  		s = splbio();
! 		rv = twe_ccb_poll(sc, ccb, 5);
  		twe_ccb_unmap(sc, ccb);
  		twe_ccb_free(sc, ccb);
  		splx(s);

>How-To-Repeat:
See above for the patch.
-Brian
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: