From owner-freebsd-current@FreeBSD.ORG Thu Dec 11 16:40:54 2008 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C650106564A for ; Thu, 11 Dec 2008 16:40:54 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by mx1.freebsd.org (Postfix) with ESMTP id 27E968FC25 for ; Thu, 11 Dec 2008 16:40:53 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from vupadhyaya-t43.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KBQ0064O1046G90@asmtp022.mac.com> for freebsd-current@FreeBSD.org; Thu, 11 Dec 2008 08:40:53 -0800 (PST) Message-id: From: Marcel Moolenaar To: rea-fbsd@codelabs.ru In-reply-to: Date: Thu, 11 Dec 2008 08:40:53 -0800 References: <92804393@bb.ipt.ru> <26722819@bb.ipt.ru> <26719629@bb.ipt.ru> <19F75E66-0535-4982-9726-E2C0A03117EA@mac.com> X-Mailer: Apple Mail (2.929.2) Cc: Boris Samorodov , freebsd-current@FreeBSD.org Subject: Re: Timeda 8-multiport adapter: only 2 ports available 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: Thu, 11 Dec 2008 16:40:54 -0000 On Dec 11, 2008, at 12:50 AM, Eygene Ryabinkin wrote: > Marcel, Boris, good day. > > Wed, Dec 10, 2008 at 05:00:24PM -0800, Marcel Moolenaar wrote: >>> Seems that just the same card should work: >>> http://lists.freebsd.org/pipermail/freebsd-stable/2008-May/042505.html >>> >>> I've added some diagnistic. But 'rid' is not what you want, I guess: >> >> The RID is fine. It should always be 0. > > Seems like a dumb question, but nevertheless. > > What I don't understand is the following: BAR to port mapping for > the Timedia is tricky, it mixes BARs and offsets for the different > ports (you should know this, since you wrote the support ;)). Correct (on both accounts :-) > But in uart_bus_probe you're passing rid = 0 and it is used for > resource > allocation and consequently the same rid is used for all ports (at > least > I read the code in this way). But puc_get_bar() uses calculated rid > values, but does essentially the same thing: resource allocation via > bus_alloc_resource(). And sc->sc_bas is initialized from the obtained > sc->sc_rres (inside uart_bus_probe) and it is subsequently used for > ns8250_probe() that is failing. > > I see that uart_bus_pci.c calls uart_bus_probe() with the actual rid. > It does not mean that puc code should do the same, but ... It could have been done that way, but such is not necessary. It would not have been a problem for uart to do it, as can be seen from uart_bus_pci.c, but it would have introduced some complexity for sio(4). We needed to support sio(4) at that time and I didn't want to touch sio(4) at all. Since puc(4) needs to maintain a mapping from the child's device_t to some internal data structure, it was trivial to have the child use RID 0 in all cases and have that mapped to the right bus tag and handle pair... FYI, -- Marcel Moolenaar xcllnt@mac.com