Re: [PARPORT] disable/elable_irq() in parport_claim/release().


Joerg Dorchain (dorchain@wirbel.com)
Wed, 24 Feb 1999 09:37:33 +0100


On Tue, Feb 23, 1999 at 10:17:30PM +0100, Andrea Arcangeli wrote:
> The reason of the enable_irq() in parport_release() was only to undo the
> disable_irq() that I was doing a bit before changing the cad if the next
> cad was not using irqs. disabling irqs I was avoiding the irq handler to
> run and return doing nothing.

I understand the idea. In this case weīd better remove the handler
completely (free_irq()) instead of brute-force disabling.
I also donīt like the idea of having a mid- or highlevel function caring
about hardware things like irqs. They donīt know about the specific
hardware (at least 4 different chip for different m68k parallel port
types) and do usually more harm than good when they try to play with the
hardware.
>
> I agree that we could drop the enable_irq() completly in claim/restore.

Yes, this is necessary. You canīt (shouldnīt ;-) disable an irq level when it is
used by more than one device. This was in the patch I sent to the list.

>
> is automagically done in the parport_pc only saving/restoring the control
> port.

I would consider this a side effect of PC-ish hardware. When I wrote the
amiga parport drivers, I found it quite confusing that the irq-mask was
in the same register as the control lines.

How about documenting the semantics clearly?
>
> So I see completly not needed to call the enable/disable_irq()
> parport_lowlevel operations while claiming the port. That should be done
> only at once in the lowlevel init_state operation.

This is currently done automatically for m68k-ports. Here, request_irq()
also enables the irq-level. (When you register an irq-handler, you
usually wish it to be called, and you can always register an additional
handler when you have shared irqs.)

BTW, what do I have to do to get the sources for m68k into the parport
development tree?

Bye,

Joerg

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 24 Feb 1999 - 03:40:20 EST