From owner-freebsd-current@FreeBSD.ORG Fri Dec 1 03:33:48 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FFAD16A407; Fri, 1 Dec 2006 03:33:48 +0000 (UTC) (envelope-from sepotvin@videotron.ca) Received: from tomts29-srv.bellnexxia.net (tomts29.bellnexxia.net [209.226.175.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B8A843CA3; Fri, 1 Dec 2006 03:33:36 +0000 (GMT) (envelope-from sepotvin@videotron.ca) Received: from toip41-bus.srvr.bell.ca ([67.69.240.42]) by tomts29-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061201033346.NAFW11757.tomts29-srv.bellnexxia.net@toip41-bus.srvr.bell.ca>; Thu, 30 Nov 2006 22:33:46 -0500 Received: from unknown (HELO mail.telcobridges.com) ([67.70.237.76]) by toip41-bus.srvr.bell.ca with ESMTP; 30 Nov 2006 22:33:39 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAA4wb0VDRu1M/2dsb2JhbAA Received: from [192.168.0.102] (modemcable120.208-83-70.mc.videotron.ca [70.83.208.120]) (authenticated bits=0) by mail.telcobridges.com (8.13.3/8.13.3) with ESMTP id kB13XFdD062145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 30 Nov 2006 22:33:29 -0500 (EST) (envelope-from sepotvin@videotron.ca) Message-ID: <456FA276.6050706@videotron.ca> Date: Thu, 30 Nov 2006 22:33:10 -0500 From: "Stephane E. Potvin" User-Agent: Thunderbird 1.5.0.8 (X11/20061111) MIME-Version: 1.0 To: John Baldwin References: <4564996D.50808@FreeBSD.org> <200611291216.55424.jhb@freebsd.org> <456E0C38.7010103@videotron.ca> <200611301443.31419.jhb@freebsd.org> In-Reply-To: <200611301443.31419.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Doug Barton Subject: Re: EHCI problem on -current, and unknown devs X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2006 03:33:48 -0000 John Baldwin wrote: > On Wednesday 29 November 2006 17:39, Stephane E. Potvin wrote: >> John Baldwin wrote: >>> On Thursday 16 November 2006 03:34, Stephane E. Potvin wrote: >>>> Doug Barton wrote: >>>>> [ No response from the -usb list, so I'll try here. ] >>>>> >>>>> Howdy, >>>>> >>>>> I have a new Dell Latitude D620, and using recent -current I get this: >>>>> >>>>> ehci0: mem >>>>> 0xffa80000-0xffa803ff irq 20 at device 29.7 on pci0 >>>>> ehci0: Could not map memory >>>>> device_attach: ehci0 attach returned 6 >>>>> >>>>> FWIW, I also saw a user on the -stable list report this same problem. >>>>> I'm assuming this is bad, but what to do about it? >>>>> >>>>> >>>>> I'm also getting some unknown devices: >>>>> >>>>> uhub4: >>>> 2> on uhub0 >>>>> uhub5: >>>> 3> on uhub4 >>>>> ugen2: >>>> addr 6> on uhub4 >>>>> uhub6: >>>> 2> on uhub3 >>>>> >>>>> Vendor ID 0x413c is Dell, and is already in the usbdevs file. The >>>>> other vendor is O2, and I got their ID for the attached patch from the >>>>> list at http://www.usb.org/developers/tools. The 0x0058 device is >>>>> already in our usbdevs file, it's the port replicator (docking >>>>> station) that the laptop is plugged into currently. I added the 0x8103 >>>>> device in the attached patch based on an entry in the NetBSD usbdevs >>>>> file. (The entry makes sense to me as well, since I have one of those.) >>>>> >>>>> So I have two questions ... for the devices (and vendors) that are >>>>> already in my local usbdevs file, why are they still showing up by ID? >>>>> And how do I find the device IDs for the two unknown devices? I >>>>> imagine that the O2 device is related to my built in smart card >>>>> reader, not sure about the other one. >>>>> >>>> Hi Doug, >>>> >>>> I had the same problem with my Dell Inspiron 9400 and fixed it using the >>>> following patch: >>>> >>>> Index: sys/kern/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 >>>> --- sys/kern/subr_rman.c 11 Sep 2006 19:31:52 -0000 1.53 >>>> +++ sys/kern/subr_rman.c 2 Nov 2006 03:05:34 -0000 >>>> @@ -170,7 +170,7 @@ >>>> >>>> /* Skip entries before us. */ >>>> for (s = TAILQ_FIRST(&rm->rm_list); >>>> - s && s->r_end + 1 < r->r_start; >>>> + s && s->r_end < r->r_start; >>>> s = TAILQ_NEXT(s, r_link)) >>>> ; >>>> >>>> This code was added in revision 1.53 when support for intelligent >>>> merging was added. When r_end is equal to UINT_MAX, adding one will >>>> cause it to overflow, creating quite a mess in the entries ordering. I'm >>>> not sure the fix I did is completely correct as I didn't had time to >>>> check if the +1 is needed at all in this case. At least it fixed the >>>> problem for me. >>> It is needed to avoid overlaps. Can you show me which > rman_manage_region() is >>> breaking? Rather, enable the DPRINTF() in rman_manage_region() and > provide >>> the output? >>> >> Here's the output of booting an unmodified kernel with debug.rman_debug=1 > > Try this: > > Index: subr_rman.c > =================================================================== > RCS file: /usr/cvs/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 30 Nov 2006 19:42:23 -0000 > @@ -169,10 +169,12 @@ > 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_link, 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) { > I had to modify the patch a little to make it compile: 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 03:20:46 -0000 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -169,10 +170,12 @@ 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) { When I try to boot after patching nearly all the drivers fail to allocate their resources, making the laptop unable to mount root as the ata driver failed to attach. I can't provide any log yet as I don't have a serial port on the laptop to grab the output. Steph