Subject: re: kern/30549
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Rudi Ludwig <rudihl@gmx.de>
List: netbsd-bugs
Date: 07/05/2005 07:30:05
The following reply was made to PR kern/30549; it has been noted by GNATS.

From: Rudi Ludwig <rudihl@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: rudihl@gmx.de
Subject: re: kern/30549
Date: Tue, 5 Jul 2005 09:25:40 +0200

 This is a multi-part message in MIME format.
 
 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 
 Looks like gnats doesn't like base64 encoded attachments, although
 they are plain text.
 
 When looking at the code again, I disliked starting
 with zero delay when waiting for the busy bit to clear. Thus a minor
 change there.
 
 Please test and report. I am not a commiter, so it will take someone
 else to get this into the kernel (if its a real fix, and doesn't just
 work okay for me)
 
 /rudi
 
 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: application/octet-stream;
  name="wi.c.patch"
 Content-Disposition: attachment;
  filename="wi.c.patch"
 Content-Transfer-Encoding: quoted-printable
 
 *** src/sys/dev/ic/wi.c	Mon Jul  4 23:35:13 2005
 --- src/sys/dev/ic/wi.c.orig	Mon Jul  4 16:03:27 2005
 ***************
 *** 1,6 ****
   /*	$NetBSD: wi.c,v 1.194 2005/01/17 01:48:56 dyoung Exp $	*/
 - /* kern/30549 2005/7/5 by rl */
 - /* L2536: increasing delay time when waiting for the busy bit to clear */
 - /* L2587: changed delay after wi_com_ini from 100ms to 200ms	*/
  =20
   /*-
 --- 1,3 ----
 ***************
 *** 2535,2542 ****
  =20
   	/* wait for the busy bit to clear */
 ! 	for (i =3D 500; i > 0; i--) {	/* 1s total */
   		if ((CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY) =3D=3D 0)
   			break;
 ! 		DELAY(8*(512-i)); /* increasing delay times */
   	}
   	if (i =3D=3D 0) {
 --- 2532,2539 ----
  =20
   	/* wait for the busy bit to clear */
 ! 	for (i =3D 500; i > 0; i--) {	/* 5s */
   		if ((CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY) =3D=3D 0)
   			break;
 ! 		DELAY(1000);	/* 1 m sec */
   	}
   	if (i =3D=3D 0) {
 ***************
 *** 2586,2590 ****
   	if (cmd =3D=3D WI_CMD_INI) {
   		/* XXX: should sleep here. */
 ! 		DELAY(200*1000);
   	}
   	rc =3D wi_cmd_wait(sc, cmd, val0);
 --- 2583,2587 ----
   	if (cmd =3D=3D WI_CMD_INI) {
   		/* XXX: should sleep here. */
 ! 		DELAY(100*1000);
   	}
   	rc =3D wi_cmd_wait(sc, cmd, val0);
 
 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur
 Content-Type: application/octet-stream;
  name="wireg.h.patch"
 Content-Disposition: attachment;
  filename="wireg.h.patch"
 Content-Transfer-Encoding: quoted-printable
 
 *** src/sys/dev/ic/wireg.h	Mon Jul  4 23:17:48 2005
 --- src/sys/dev/ic/wireg.h.orig	Mon Jul  4 23:17:36 2005
 ***************
 *** 38,42 ****
    */
  =20
 ! #define WI_DELAY       8
   #define WI_TIMEOUT     (500000/WI_DELAY)       /* 500 ms */
  =20
 --- 38,42 ----
    */
  =20
 ! #define WI_DELAY       5
   #define WI_TIMEOUT     (500000/WI_DELAY)       /* 500 ms */
  =20
 
 --Multipart=_Tue__5_Jul_2005_09_25_40_+0200_pk1n/Mu4ME7Xssur--