Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Mar 2009 14:48:24 -0800
From:      Navdeep Parhar <nparhar@gmail.com>
To:        Marcel Moolenaar <xcllnt@mac.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: puc support for a generic card (patch attached)
Message-ID:  <d04e16b70903031448w5fa5f69aod1dc28d02250b4e3@mail.gmail.com>
In-Reply-To: <20090303195122.GA30421@insightsol.com>
References:  <d04e16b70903021305u69138cfav8b6838c7199a60ed@mail.gmail.com> <200903030915.43037.jhb@freebsd.org> <C428B1A1-7F4F-4DD2-8BBD-C88CA7B659AE@mac.com> <200903031159.55299.jhb@freebsd.org> <9B775F97-1E5A-4E55-A2AE-26DC78CD08C0@mac.com> <20090303195122.GA30421@insightsol.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--001636ed65778f233d04643ebb99
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 3, 2009 at 11:51 AM, Navdeep Parhar <nparhar@gmail.com> wrote:
> 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 =A0 Sat Feb 28 12:42:37 2009 -0800
>>>>>> +++ b/sys/dev/puc/puc.c =A0 Mon Mar 02 12:21:07 2009 -0800
>>>>>> @@ -440,9 +440,6 @@
>>>>>> =A0 sc->sc_dev =3D dev;
>>>>>> =A0 sc->sc_cfg =3D cfg;
>>>>>>
>>>>>> - /* We don't attach to single-port serial cards. */
>>>>>> - if (cfg->ports =3D=3D PUC_PORT_1S || cfg->ports =3D=3D PUC_PORT_1P=
)
>>>>>> - =A0 =A0 =A0 =A0 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. =A0I'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. :) =A0Navdeep, 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. =A0I'll post it once I've tested
> it.

Reworked patch attached.  Works for me.

Navdeep

>
> Regards,
> Navdeep
>
>>
>> --
>> Marcel Moolenaar
>> xcllnt@mac.com
>>
>>
>>
>

--001636ed65778f233d04643ebb99
Content-Type: application/octet-stream; name="puc.2.patch"
Content-Disposition: attachment; filename="puc.2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dCBGZWIgMjggMTI6NDI6MzcgMjAwOSAtMDgwMAorKysgYi9zeXMvZGV2L3VhcnQv
dWFydF9idXNfcGNpLmMJVHVlIE1hciAwMyAxNDozMjowMSAyMDA5IC0wODAwCkBAIC0xMTAsNiAr
MTEwLDcgQEAKIHsgMHgxNDE1LCAweDk1MGIsIDB4ZmZmZiwgMCwgIk94Zm9yZCBTZW1pY29uZHVj
dG9yIE9YQ0I5NTAgQ2FyZGJ1cyAxNjk1MCBVQVJUIiwKIAkweDEwLCAxNjM4NDAwMCB9LAogeyAw
eDE1MWYsIDB4MDAwMCwgMHhmZmZmLCAwLCAiVE9QSUMgU2VtaWNvbmR1Y3RvciBUUDU2MCA1Nmsg
bW9kZW0iLCAweDEwIH0sCit7IDB4OTcxMCwgMHg5ODM1LCAweDEwMDAsIDEsICJOZXRNb3MgTk05
ODM1IFNlcmlhbCBQb3J0IiwgMHgxMCB9LAogeyAweGRlYWYsIDB4OTA1MSwgMHhmZmZmLCAwLCAi
TWlkZGxlIERpZ2l0YWwgUEMgV2Vhc2VsIFNlcmlhbCBQb3J0IiwgMHgxMCB9LAogeyAweGZmZmYs
IDAsIDB4ZmZmZiwgMCwgTlVMTCwgMCwgMH0KIH07Cg==
--001636ed65778f233d04643ebb99--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d04e16b70903031448w5fa5f69aod1dc28d02250b4e3>