Subject: Re: NVIDIA nForce2/3/4 SMBus controller
To: None <njoly@pasteur.fr>
From: KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp>
List: current-users
Date: 07/18/2007 02:07:21
Hi! Nicolas,


I apologize for a slow reply.


From: Nicolas Joly <njoly@pasteur.fr>
Date: Sat, 14 Jul 2007 22:56:59 +0200

> For the record, i forgot to say that i needed a slightly patched
> version of nfsmb_check_done() to make it work (taken from FreeBSD):

Oops..

> Index: sys/dev/pci/nfsmb.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/pci/nfsmb.c,v
> retrieving revision 1.1
> diff -u -r1.1 nfsmb.c
> --- sys/dev/pci/nfsmb.c	11 Jul 2007 07:53:29 -0000	1.1
> +++ sys/dev/pci/nfsmb.c	14 Jul 2007 20:46:37 -0000
> @@ -291,21 +291,19 @@

> +	for (i = 10000; i > 0; i--) {
> +		stat = bus_space_read_1(sc->sc_iot, sc->sc_ioh, NFORCE_SMB_PROTOCOL);
> +		if (stat == 0)
> +			break;
>  		delay(500);

>  	}

First of all, it doesn't keep spending long time CPU like that us. (max
5 seconds)  We should use not delay(9) but tsleep(9).  See man delay(9).
 
Next, I corrected it to tsleep(9).  However, protocol became 0 and
status became busy in my amd64. 
I think that it should check that we are not busy.  However, I was not
able to test because there was no time. 

Thanks,
--
kiyohara