From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 3 19:51:48 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 B6190106567B for ; Tue, 3 Mar 2009 19:51:48 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7138FC26 for ; Tue, 3 Mar 2009 19:51:48 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by wa-out-1112.google.com with SMTP id k34so1565906wah.27 for ; Tue, 03 Mar 2009 11:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Hgu7Rk5+KR/y8tLpnj+5Qd3/x4tfekfNgaT3jhdAQFQ=; b=FTS7vT0OZfVTHfLaX361GElZ6sGwp/YBwvGgc6GrwfKpQ4VEbMsKLvEkjDJfHI0vUk OuptNa93xCb0JpcXm8rsn/EmSlzoDiEy7TG3J3rZqYHrmScCOAfUtjHvs8HBl2SW27zk v/Fi+czeU74z09KuVvG3SQ/5t2B2eI3CT5A5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=MtUlDtPtQOpjvju2XMxmmmeXKvO/5586zi30Gz0K6utflcsJx+cNeYDGzYhhdxGSS+ KM24PBu95DSr+KrZeGSn8vt1epDwxBUzKjb6E+XPgPf60avo4vtx8QL4dtyevOhYXgs4 cTAMbfFWnoAViQBRYhcF6RgjFIkH3w3CnPeXw= Received: by 10.115.75.14 with SMTP id c14mr3566110wal.86.1236109908094; Tue, 03 Mar 2009 11:51:48 -0800 (PST) Received: from insightsol.com (h-67-100-74-36.snvacaid.covad.net [67.100.74.36]) by mx.google.com with ESMTPS id v39sm171996wah.54.2009.03.03.11.51.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Mar 2009 11:51:47 -0800 (PST) Date: Tue, 3 Mar 2009 11:51:22 -0800 From: Navdeep Parhar To: Marcel Moolenaar Message-ID: <20090303195122.GA30421@insightsol.com> Mail-Followup-To: Marcel Moolenaar , John Baldwin , FreeBSD Hackers References: <200903030915.43037.jhb@freebsd.org> <200903031159.55299.jhb@freebsd.org> <9B775F97-1E5A-4E55-A2AE-26DC78CD08C0@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9B775F97-1E5A-4E55-A2AE-26DC78CD08C0@mac.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: FreeBSD Hackers 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 19:51:49 -0000 On Tue, Mar 03, 2009 at 09:04:32AM -0800, Marcel Moolenaar wrote: > > On Mar 3, 2009, at 8:59 AM, John Baldwin wrote: > >> 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? > > BTW: I forgot to mention that puc(4) needs to back-off from this > particular card. That means that the catch-all that we have there > needs to be tweaked. > > So, the change to pucdata.c can still be made, but with a big > comment that states that the entry is added only to avoid puc(4) > from attaching to that particular 1-port card so that uart(4) > can claim it... OK, I'll keep this in mind and will modify the patch to have uart(4) claim the card and puc(4) ignore it. I'll post it once I've tested it. Regards, Navdeep > > -- > Marcel Moolenaar > xcllnt@mac.com > > >