Modem + Network in Xircom cards, and maybe others

Carlos Velasco freebsd at newipnet.com
Mon May 17 04:31:44 PDT 2004


On 06/05/2004 at 16:44 Bruce Evans wrote:

>On Wed, 5 May 2004, Carlos Velasco wrote:
>
>> On 06/05/2004 at 0:26 Bruce Evans wrote:
>>
>> >However, you may need only this part of it.  This part permits software
>> >interrupts to be delayed by 38 ticks instead of the expected maximim
>> >of 2 ticks.  I keep forgetting to fix this.  Scaling by hz is not quite

Yes, this patch in sio.c seems to work perfectly. So I think sio swi is
being delayed somewhere by Giant or any other thing.

>> >right, because hz may be set to values that are too small to work all
>> >the time or even most of the time.  There is a clamp to 128 (min), but
>> >this is a bit small.  E.g., with hz = 1000 and speed = 115200, the
>> >original code in the above gives cp4ticks = 44 and ibufsize = 128.  If

what about if we fix the value or making it adjustable via sysctl?

>The broken interrupt priorities are easy to see in "ps laxw | sort -n +4"
>output.  Note that the highest priorities are numerically lowest:
>    0    27     0   0 -48  0     0   12 -      WL    ??    0:00.06  (swi8:
>tty:cy+ clock)
>
>    [I think this is supposed to be the low priority softclock ithread
>     (the "slow" cy and sio SWIs attach to it and misname themselves as
>     tty:cy and tty:sio instead of clk:cy and clk:sio).  It actually has
>     _highest_ priority among SWIs, so the problem is sort of the opposite
>     of what I thought, but mostly worse.  The "slow" cy and sio SWIs
>     actually have the same bogus high priority, so they don't compete
>     with other SWIs.  However, they compete with softclock, and all
>     other SWIs have lower priority than softclock so they don't even
>     compete with it.  This is the reverse of what is supposed to
>     happen.  I think softclock starts with the correct low priority, but
>     its priority gets clobbered when the cy and sio SWIs attach to it.
>
>    0    37     0   0 -48  0     0   12 -      WL    ??    0:00.00  (swi0:
>tty:cy+)
>
>    [I think this is the "fast" cy and sio SWI.  Verbose names which get
>     truncated complicate debugging.]

I have here:

    0    22     0   0 -80  0     0   12 -      WL    ??    0:00.01  (irq11:
cbb0 cbb1+)
...
    0    28     0   0 -48  0     0   12 -      WL    ??    0:01.74  (swi8:
tty:sio clock)
    0    39     0   0 -48  0     0   12 -      WL    ??    0:00.00  (swi0:
tty:sio)

So, I assume you are right.

>> I believe this patch to sio.c is only a temporary solution that should
be
>> removed when GIANT dissapears in most drivers, am I right?
>
>No, it (the cp4ticks one) is a more general patch, though it is temporary
>because it is not in its final form.  Best-case interrupt latency cannot
>be guaranteed for SWIs, and even a saftey margin of a factor of 4 is not
>enough even without the Giant and priority bugs, since it doesn't scale
>right when "hz" is configured to large values, and configuring "hz" to
>too-large values is now encouraged by DEVICE_POLLING.

Could we commit it or something similar?
I think sio is normal mode is broken for high speeds cause this like my
problem with modem pccard.

Regards,
Carlos Velasco




More information about the freebsd-mobile mailing list