Re: PLIP is still broken :(

1999-07-27 Thread Garrett Wollman

< said:

> This is also something that should be changed since we are to modify
> things anyway, it introduces un-needed delays (and jitter) in the
> interrupt delivery.

Plus, the resource manager has built-in hooks to manage resources
which are time-shared by multiple devices.  (The thing it's lacking,
but ought to have, is a ``gang'' notion to claim several resources at
once.)

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
[EMAIL PROTECTED]  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-26 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Nicolas Souchu writes:

>Moreover, in the ppbus model, the ppc_intr() function is _always_
>the registered interrupt handler and it dispatches the interrupt
>depending on the device driver which currently owns the bus when
>the interrupt occurs.

This is also something that should be changed since we are to modify
things anyway, it introduces un-needed delays (and jitter) in the
interrupt delivery.

--
Poul-Henning Kamp FreeBSD coreteam member
[EMAIL PROTECTED]   "Real hackers run -current on their laptop."
FreeBSD -- It will take a long time before progress goes too far!


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-26 Thread Nicolas Souchu

On Mon, Jul 26, 1999 at 05:04:42AM +1000, Bruce Evans wrote:
>
>>>Otherwise,
>>>the generic code is missing mainly update of the interrupt masks when
>>>an interrupt is unregistered.
>>
>>For the low level side, we could consider something like the following code.
>>But this shall be called by the nexus layer and then needs generic newbus
>>support (as you said above, didn't you?).
>
>>/*
>> * Switch an irq from a maskptr to another without unregistering the irq
>> * handler.
>> * This function is supposed to work with only one handler per irq.
>> */
>>void
>>switch_masks(intrmask_t *oldmaskptr, intrmask_t *newmaskptr, int irq)
>
>
>I don't like most of this.  Driver level code won't even know the
>correct maskptrs.  (irq, maskptr) pairs depend on i386 implementation
>details for uniqueness.  Use { s = splhigh(); BUS_TEARDOWN_INTR(...);
>BUS_SETUP_INTR(...); splx(s); } until/unless the newbus level provides

This is what I meant when I said the nexus layer shall do the switch_masks()
call. The current implementation of SETUP_INTR/TEARDOWN involves the overhead
of unregistering and registering the interrupt. This is why I propose
switch_masks() which doesn't.

Moreover, in the ppbus model, the ppc_intr() function is _always_ the registered
interrupt handler and it dispatches the interrupt depending on the device driver
which currently owns the bus when the interrupt occurs.

>a better interface.  The problem with the masks not being updated when
>interrupts are unregistered should be fixed in update*_masks().

I agree if unregistering/registering is declared better than switching masks
for the current registered handler.

>
>Bruce
>

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-25 Thread Bruce Evans

>>Otherwise,
>>the generic code is missing mainly update of the interrupt masks when
>>an interrupt is unregistered.
>
>For the low level side, we could consider something like the following code.
>But this shall be called by the nexus layer and then needs generic newbus
>support (as you said above, didn't you?).

>/*
> * Switch an irq from a maskptr to another without unregistering the irq
> * handler.
> * This function is supposed to work with only one handler per irq.
> */
>void
>switch_masks(intrmask_t *oldmaskptr, intrmask_t *newmaskptr, int irq)
...

I don't like most of this.  Driver level code won't even know the
correct maskptrs.  (irq, maskptr) pairs depend on i386 implementation
details for uniqueness.  Use { s = splhigh(); BUS_TEARDOWN_INTR(...);
BUS_SETUP_INTR(...); splx(s); } until/unless the newbus level provides
a better interface.  The problem with the masks not being updated when
interrupts are unregistered should be fixed in update*_masks().

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-25 Thread Nicolas Souchu

On Sun, Jul 25, 1999 at 09:35:36AM +1000, Bruce Evans wrote:
>
>>>Possible quick fix (hack): change all the spltty()'s in lpt.c to
>>>splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
>>>splnet() instead should work OK for lpt and fix if_plip.
>>
>>This seems good until the intr stuff handle dynamic update of a interrupt spl.
>>Is there some work in progress on that?
>
>Not much.  ppc needs to do most of the work by registering its interrupt
>with the correct interrupt maskptr for the currently attached device.
>This may involve unregistering the interrupt when the device changes.
>The generic code could help here by supporting atomic changing of
>interrupt maskptrs without unregistering the interrupt.  Otherwise,
>the generic code is missing mainly update of the interrupt masks when
>an interrupt is unregistered.

For the low level side, we could consider something like the following code.
But this shall be called by the nexus layer and then needs generic newbus
support (as you said above, didn't you?).

/*
 * Switch an irq from a maskptr to another without unregistering the irq
 * handler.
 * This function is supposed to work with only one handler per irq.
 */
void
switch_masks(intrmask_t *oldmaskptr, intrmask_t *newmaskptr, int irq)
{
int s;
intrec *idesc;
intrmask_t mask = 1 << irq;

if ((oldmaskptr == NULL) || (newmaskptr == NULL))
return;

if (((idesc = find_idesc(oldmaskptr, irq)) == NULL) ||
(find_idesc(newmaskptr, irq) != NULL))
return;

/* block all interrupts */
s = splhigh();

/* update the irq mask ptr */
idesc->maskptr = newmaskptr;

/* remove the irq from the old mask and add it to the new one */
INTRUNMASK(*oldmaskptr, mask);
INTRMASK(*newmaskptr, mask);

/* we need to update all values in the intr_mask[irq] array */
update_intr_masks();
/* update mask in chains of the interrupt multiplex handler as well */
update_mux_masks();

/* restore interrupts */
splx(s);

return;
}

Your opinion?

Nicholas.

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-24 Thread Bruce Evans

>>Possible quick fix (hack): change all the spltty()'s in lpt.c to
>>splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
>>splnet() instead should work OK for lpt and fix if_plip.
>
>This seems good until the intr stuff handle dynamic update of a interrupt spl.
>Is there some work in progress on that?

Not much.  ppc needs to do most of the work by registering its interrupt
with the correct interrupt maskptr for the currently attached device.
This may involve unregistering the interrupt when the device changes.
The generic code could help here by supporting atomic changing of
interrupt maskptrs without unregistering the interrupt.  Otherwise,
the generic code is missing mainly update of the interrupt masks when
an interrupt is unregistered.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-24 Thread Nicolas Souchu

On Mon, Jul 19, 1999 at 07:37:02PM +1000, Bruce Evans wrote:
>
>>You misunderstood what Bruce wrote. PLIP has always been broken. It
>>used to be possible to hack around the brokenness by setting the
>>interrupt mask to net instead of tty. With newbus, this hack is no
>>longer possible (it was never correct anyway; it broke printing).

Or we shall consider changing isa_compat.c if we choose splnet for lpt.

>
>Or by statically configuring SLIP (which forced tty = net), or maybe
>by dynamically configuring PPP.  The tty = net hack went away with
>old-bus, so SLIP is broken in much the same way as PLIP.
>
>>The problem with PLIP is that it tries to do splnet stuff in at
>>spltty. If you force the parallell port driver to run at splnet, PLIP
>>works but you get panics when you print because it tries to do spltty
>>stuff at splnet.
>
>Possible quick fix (hack): change all the spltty()'s in lpt.c to
>splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
>splnet() instead should work OK for lpt and fix if_plip.

This seems good until the intr stuff handle dynamic update of a interrupt spl.
Is there some work in progress on that?

>
>Bruce
>
>
>To Unsubscribe: send mail to [EMAIL PROTECTED]
>with "unsubscribe freebsd-current" in the body of the message
>

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-24 Thread Nicolas Souchu

On Mon, Jul 19, 1999 at 11:15:24AM +0200, Poul-Henning Kamp wrote:
>
>
>This is actually a deficiency in the ppbus stuff, there is no
>telling what SPL level the subdriver wants to use, so the interrupt

This is changing. I'm currently working on porting ppbus to newbus.

>should actually be released back to the system when no subdrivers

What do you exactly call back to the system? Not served? If so, this
is the current behaviour of the generic ppbus interrupt dispatcher
(eg ppb_intr())

>are open and be grabbed the way the subdriver wants it once it
>aquires the bus.

But the newbus which relies on the old machdep intr stuff doesn't seem
to offer such a service. Doesn't it?

Why was the SLIP hack removed then? And I noticed the PPP workaround is
still alive in net/ppp_tty.c...

Nicholas.

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-22 Thread Bruce Evans

>> Possible quick fix (hack): change all the spltty()'s in lpt.c to
>> splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
>> splnet() instead should work OK for lpt and fix if_plip.
>
>What about vpo?

vpo uses only polled mode.  I think its "interrupt" handler is attached
to a cam software interrupt handler of timeout handler.  In any case, it
is not attached to ppcintr(), so ppc's interrupt class doesn't affect it.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-22 Thread Maxim Sobolev

Dag-Erling Smorgrav wrote:

> Maxim Sobolev <[EMAIL PROTECTED]> writes:
> > Bruce Evans wrote:
> > > Possible quick fix (hack): change all the spltty()'s in lpt.c to
> > > splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
> > > splnet() instead should work OK for lpt and fix if_plip.
> > It doesn't help much because I'm not using lpt device in my kernel so
> > lpt.c never get compiled in it ;).
>
> ppc.c

But ppc.c doesn't contain spltty()'s in it...

-Max



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-22 Thread Dag-Erling Smorgrav

Maxim Sobolev <[EMAIL PROTECTED]> writes:
> Bruce Evans wrote:
> > Possible quick fix (hack): change all the spltty()'s in lpt.c to
> > splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
> > splnet() instead should work OK for lpt and fix if_plip.
> It doesn't help much because I'm not using lpt device in my kernel so
> lpt.c never get compiled in it ;).

ppc.c

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-22 Thread Maxim Sobolev

Bruce Evans wrote:

> Possible quick fix (hack): change all the spltty()'s in lpt.c to
> splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
> splnet() instead should work OK for lpt and fix if_plip.

It doesn't help much because I'm not using lpt device in my kernel so
lpt.c never get compiled in it ;).

Maxim




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-21 Thread Mike Smith

> >The problem with PLIP is that it tries to do splnet stuff in at
> >spltty. If you force the parallell port driver to run at splnet, PLIP
> >works but you get panics when you print because it tries to do spltty
> >stuff at splnet.
> 
> Possible quick fix (hack): change all the spltty()'s in lpt.c to
> splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
> splnet() instead should work OK for lpt and fix if_plip.

What about vpo?
-- 
\\  The mind's the standard   \\  Mike Smith
\\  of the man.   \\  [EMAIL PROTECTED]
\\-- Joseph Merrick   \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-19 Thread Bruce Evans

>You misunderstood what Bruce wrote. PLIP has always been broken. It
>used to be possible to hack around the brokenness by setting the
>interrupt mask to net instead of tty. With newbus, this hack is no
>longer possible (it was never correct anyway; it broke printing).

Or by statically configuring SLIP (which forced tty = net), or maybe
by dynamically configuring PPP.  The tty = net hack went away with
old-bus, so SLIP is broken in much the same way as PLIP.

>The problem with PLIP is that it tries to do splnet stuff in at
>spltty. If you force the parallell port driver to run at splnet, PLIP
>works but you get panics when you print because it tries to do spltty
>stuff at splnet.

Possible quick fix (hack): change all the spltty()'s in lpt.c to
splnet()'s.  lpt isn't a tty driver; it just abuses spltty().  Abusing
splnet() instead should work OK for lpt and fix if_plip.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-19 Thread Poul-Henning Kamp


This is actually a deficiency in the ppbus stuff, there is no
telling what SPL level the subdriver wants to use, so the interrupt
should actually be released back to the system when no subdrivers
are open and be grabbed the way the subdriver wants it once it
aquires the bus.

The ZIP driver would probably want splcam/splbio, the pps wants
splabsolutelynobody() (and FAST_IRQ) and plip wants splnet().


In message <[EMAIL PROTECTED]>, Dag-Erling Smorgrav writes:
>Maxim Sobolev <[EMAIL PROTECTED]> writes:
>> Some time ago I
>> had rised this question and Bruce Evans told that this problem arise
>> because of switch to newbus.
>
>You misunderstood what Bruce wrote. PLIP has always been broken. It
>used to be possible to hack around the brokenness by setting the
>interrupt mask to net instead of tty. With newbus, this hack is no
>longer possible (it was never correct anyway; it broke printing).
>
>The problem with PLIP is that it tries to do splnet stuff in at
>spltty. If you force the parallell port driver to run at splnet, PLIP
>works but you get panics when you print because it tries to do spltty
>stuff at splnet.
>
>SLIP and PPPD do black magic with interrupt masks so spltty and splnet
>become essentially equivalen (or so I understand). They do this
>because they have the exact same problems as PLIP - they need to do
>splnet stuff at spltty.
>
>DES
>-- 
>Dag-Erling Smorgrav - [EMAIL PROTECTED]
>
>
>To Unsubscribe: send mail to [EMAIL PROTECTED]
>with "unsubscribe freebsd-current" in the body of the message
>

--
Poul-Henning Kamp FreeBSD coreteam member
[EMAIL PROTECTED]   "Real hackers run -current on their laptop."
FreeBSD -- It will take a long time before progress goes too far!


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-19 Thread Dag-Erling Smorgrav

Maxim Sobolev <[EMAIL PROTECTED]> writes:
> Some time ago I
> had rised this question and Bruce Evans told that this problem arise
> because of switch to newbus.

You misunderstood what Bruce wrote. PLIP has always been broken. It
used to be possible to hack around the brokenness by setting the
interrupt mask to net instead of tty. With newbus, this hack is no
longer possible (it was never correct anyway; it broke printing).

The problem with PLIP is that it tries to do splnet stuff in at
spltty. If you force the parallell port driver to run at splnet, PLIP
works but you get panics when you print because it tries to do spltty
stuff at splnet.

SLIP and PPPD do black magic with interrupt masks so spltty and splnet
become essentially equivalen (or so I understand). They do this
because they have the exact same problems as PLIP - they need to do
splnet stuff at spltty.

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-18 Thread David O'Brien

> Does anybody have a plans to fix plip code which is broken a quite
> awhile (several months or so)? 

Since I used it just last week on two -CURRENT boxes, I'd say there is
some other problem you are experecing.

-- 
-- David([EMAIL PROTECTED]  -or-  [EMAIL PROTECTED])


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: PLIP is still broken :(

1999-07-18 Thread Maxim Sobolev

David O'Brien wrote:

> > Does anybody have a plans to fix plip code which is broken a quite
> > awhile (several months or so)?
>
> Since I used it just last week on two -CURRENT boxes, I'd say there is
> some other problem you are experecing.

I'm also using two -current boxes (P133 and K6-2/300) and when trying to
do more or less massive file transfer one of the boxes dying with panic
(usually one with a slower processor, but not alvays). Changing ppc
flags also doesn't resolve a problem. If you can please try to test it
by doing "ping -f -s 8000 other_side" - this test actually bring one
side to its knees it several seconds (at lease for me). Some time ago I
had rised this question and Bruce Evans told that this problem arise
because of switch to newbus. Maybe you can look at his original meassage
at:
http://www.freebsd.org/cgi/getmsg.cgi?fetch=1692956+1694453+/usr/local/www/db/text/1999/freebsd-current/19990607.freebsd-current

-Maxim


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message