Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 15:34:22 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Warner Losh <imp@bsdimp.com>
Cc:        arch@freebsd.org, Don Lewis <truckman@freebsd.org>, adrian@freebsd.org
Subject:   Re: [patch] axe RF_TIMESHARE?
Message-ID:  <20140710151043.G985@besplex.bde.org>
In-Reply-To: <2174B753-A1C9-4F8A-8E25-28612030AF78@bsdimp.com>
References:  <201407082254.s68MsaPS028312@gw.catspoiler.org> <20140709200848.Q1201@besplex.bde.org> <2174B753-A1C9-4F8A-8E25-28612030AF78@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 9 Jul 2014, Warner Losh wrote:

>
> On Jul 9, 2014, at 4:08 AM, Bruce Evans <brde@optusnet.com.au> wrote:
>> RF_TIMESHARE doesn't simplify this significantly.  Ownership of the
>> interrupt should be claimed somewhere so that the interrupt resource
>> is available at first open time.  That can probably be done using
>> a super-device or some hack to own the interrupt by the first device
>> that can share it.  Then you don't need a flag for it.  It seems too
>> hard (bloated) to generalize RF_TIMESHARE so that all of the OUT2
>> complications can be handled at the new-bus level.
>
> I think that, while interesting, none of this has a bearing on RF_TIMESHARE.

It shows that RF_TIMESHARE was hard to use and was never used for one of the
cases that it was designed for.

> For shared interrupts, we\x92ve used RF_SHARED for a long time. I don\x92t think anybody ever actually implemented RF_TIMESHARE apart from an aborted attempt by the ppcbus code which later wound up abandoning that effort (I think before it even made it into the tree).

Please use the ASCII apostrophe character and the ASCII line feed character
in mail.

pp[c?]bus is just another example for IRQ sharing of ISA IRQ7.  It is even
more interesting, since IRQ7 should be shareable across devices.  It is not
clear even what RF_TIMESHARE means for that.  IRQ7 is special since
"spurious" interrupts are directed to it.  It should have a special handler
for them.  The correct handling seems to be to turn each spurious interrupt
into a broadcast to all interrupt handlers.  This was never implemented in
FreeBSD.  You don't want IRQ7 attached to a real device since the interrupt
handling to distinguish between a real interrupt and a spurious one is
more complicated and slower than normal interrupt handling.  IRQ7 is
normally attached to a printer.  Printers used to be slow devices in 1982,
so the extra slowness in the interrupt handler didn't matter.  Now (but
without ACPI), IRQ7 can be attached to the printer, a 1 Gbps ethernet, and
even more devices, so slowness in it is not so good.  OTOH, the printer
driver is a good bit bucket for spurious interrupts since it mishandles
them less badly than most.  I rarely use[d] printers, and now have only
a USB/wireless one not used under FreeBSD.  I used to try to keep IRQ7
attached to lpt0 for use as a bit bucket.  Now I disable the printer IRQ
on all systems and use IRQ7 for ethernet on some systems.  The BIOS
configuration for this is painful.  Just yesterday I had to type it in
again since the CMOS battery is too dead to hold the state over a long
mains power shutdown.

Timedsharing of IRQ7 across devices would make the configuration work
more automatically.  It should be attached to lpt0 only while lpt0 is
actually being used.  Similarly for other devices.  For simple timesharing,
"use" could be delimited by open/close for some devices and up/down for
ethernet devices.  Sophisticated timesharing would attach it dynamically
(move it automatically from ethernet to lpt if lpt needs it and ethernet
has not been used recently).  I don't want that complication.

> It was an interesting concept, but we never used it and I think we can light a bonfire under it. There are other ways to share resources that have been used instead...

Indeed.

Bruce



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