Re: EHCI problem on -current, and unknown devs

From: Doug Barton <dougb_at_FreeBSD.org>
Date: Mon, 04 Dec 2006 13:19:49 -0800
Stephane E. Potvin wrote:

> I had to modify the patch a little again to make it compile. With this
> slight modification (changing rm->link to rm->list), the patch seems to
> be working fine and I got back my ehci controller.
> 
> Index: subr_rman.c
> ===================================================================
> RCS file: /home/FreeBSD/ncvs/src/sys/kern/subr_rman.c,v
> retrieving revision 1.53
> diff -u -r1.53 subr_rman.c
> --- subr_rman.c 11 Sep 2006 19:31:52 -0000      1.53
> +++ subr_rman.c 1 Dec 2006 15:25:59 -0000
> _at__at_ -61,6 +61,7 _at__at_
>  #include <sys/param.h>
>  #include <sys/systm.h>
>  #include <sys/kernel.h>
> +#include <sys/limits.h>
>  #include <sys/lock.h>
>  #include <sys/malloc.h>
>  #include <sys/mutex.h>
> _at__at_ -169,10 +170,12 _at__at_
>         mtx_lock(rm->rm_mtx);
> 
>         /* Skip entries before us. */
> -       for (s = TAILQ_FIRST(&rm->rm_list);
> -            s && s->r_end + 1 < r->r_start;
> -            s = TAILQ_NEXT(s, r_link))
> -               ;
> +       TAILQ_FOREACH(s, &rm->rm_list, r_link) {
> +               if (s->r_end == ULONG_MAX)
> +                       break;
> +               if (s->r_end + 1 >= r->r_start)
> +                       break;
> +       }
> 
>         /* If we ran off the end of the list, insert at the tail. */
>         if (s == NULL) {
> 
> Thanks a lot!

With Stephane's change this works for me as well.

Doug

-- 

    This .signature sanitized for your protection
Received on Mon Dec 04 2006 - 20:26:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:03 UTC