linux-mips-fnet
[Top] [All Lists]

Re: question re keyboard/serial driver in general?

To: Dave Airlie <airlied@csn.ul.ie>
Subject: Re: question re keyboard/serial driver in general?
From: "Gleb O. Raiko" <raiko@niisi.msk.ru>
Date: Mon, 13 Sep 1999 19:42:09 +0400
Cc: linux-mips@fnet.fr
Organization: NIISI RAN
References: <Pine.LNX.3.96.990913154428.9902v-100000@skynet.csn.ul.ie>
Dave Airlie wrote:
> 
> Should I be enabling interrupts during the boot-up stage for the serial
> port keyboard? or should I be doing this later on ?

To save interrupt overhead, serial drivers enable interrupts during the
open call, i.e. at the moment the interrupts are really needed. The
console driver opens a low-level serial driver anyway. So, you don't
need to enable interrupts at the boot stage even for console.

The zs driver is reliable enough (if Harald applied all patches) to be a
source for references. Or just look at standard serial.c. Note, the zs
driver allocates irq (in request_irq) in zs_init, but _enables_
interrupts in startup() (called from zs_open, in particular). The
standard serial driver allocates and enables irq in one place, during
open.

Also, what might puzzles you is the fact the zs driver has additional
code for the debugger/keyboard support. The code programs interrupts for
lines that are used for debuuging/keyboard IO. But in this case, those
lines are excluded from the open procedure, so high-level drivers can't
use them and it's very special case.

Hope this helps,
Gleb.

<Prev in Thread] Current Thread [Next in Thread>