From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 3 17:00:30 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B39410656C4 for ; Tue, 3 Mar 2009 17:00:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6188FC0A for ; Tue, 3 Mar 2009 17:00:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id EB76246B32; Tue, 3 Mar 2009 12:00:29 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n23H0IFB087453; Tue, 3 Mar 2009 12:00:24 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Tue, 3 Mar 2009 11:59:54 -0500 User-Agent: KMail/1.9.7 References: <200903030915.43037.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903031159.55299.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 03 Mar 2009 12:00:24 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9065/Tue Mar 3 05:43:41 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: FreeBSD Hackers , Navdeep Parhar Subject: Re: puc support for a generic card (patch attached) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2009 17:00:31 -0000 On Tuesday 03 March 2009 11:48:42 am Marcel Moolenaar wrote: > > On Mar 3, 2009, at 6:15 AM, John Baldwin wrote: > > >> diff -r 025cb00d19d7 sys/dev/puc/puc.c > >> --- a/sys/dev/puc/puc.c Sat Feb 28 12:42:37 2009 -0800 > >> +++ b/sys/dev/puc/puc.c Mon Mar 02 12:21:07 2009 -0800 > >> @@ -440,9 +440,6 @@ > >> sc->sc_dev = dev; > >> sc->sc_cfg = cfg; > >> > >> - /* We don't attach to single-port serial cards. */ > >> - if (cfg->ports == PUC_PORT_1S || cfg->ports == PUC_PORT_1P) > >> - return (EDOOFUS); > > > > FWIW, the traditional reason for this is that we made the sio/uart > > or ppc > > drivers claim single port devices directly and only use puc for > > multiple-port > > cards. I'm not sure if that should still be the case or not. > > Marcel, do you > > have an opinion? > > Yes :-) > > I explicitly added the test with that particular error code > to make it absolutely clear that puc(4) is not the driver > for single port cards. The reason being that it's pointless. > > There are 2 things that puc(4) facilitates in: resource > assignment and interrupt handling. For single port cards > there's nothing to distribute nor is there any interrupt > sharing. In other words: there's no value that puc(4) adds. > As such, uart(4) and ppc(4) can attach directly to those > cards and puc(4) does not have to be involved. > > BTW: Traditionally puc(4) was used to attach even to single > port cards. With the puc(4) rewrite I changed that, because > it was really a mixed bag. Some single-port cards were known > to puc(4) others to uart(4)/sio(4) or ppc(4). That typically > leads to confusion given that puc(4) is (still) not in GENERIC. > (i.e. why is this UART attached, but that one isn't, they're > both single port?) > > So, please do not apply the patch and instead add the IDs to > sys/dev/uart/uart_bus_pci.c... This sounds fine to me. :) Navdeep, can you develop a patch for uart(4) instead and test that? -- John Baldwin