public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux ARM Kernel list  <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: tricky challenge for getting round level-driven interrupt problem: help!
Date: Fri, 6 May 2005 11:57:31 +0100	[thread overview]
Message-ID: <20050506105731.GF7632@lkcl.net> (raw)
In-Reply-To: <1115243014.19844.62.camel@localhost.localdomain>

On Wed, May 04, 2005 at 10:43:35PM +0100, Alan Cox wrote:

> On Mer, 2005-05-04 at 21:58, Luke Kenneth Casson Leighton wrote:
> >  i believe i get it: you raise a level-triggered interrupt which _stays_
> >  raised until such time as your fifo is empty.
> 
> Bingo. It only goes away when the chip really has nothing left to say.
> 
> >  all - that sometimes (frequently, in fact - about 1 in every
> >  50 times) it hasn't got round to clearing the level-driven
> >  interrupt by the time we come out of the ARM ISR (!)
> 
> So you'll poll again and find there is no pending work to do.
> 
> >  hence the redesign to do alternate read-write-read-write, and making
> >  reads exclusive of writes, etc.
> 
> and maybe even turn the IRQ off and use a timer if its slow and not
> sensitive to latency.. ?

 okay.

 you will be pleased to know that the switch-off-irqs-in-the-isr
 and then switch-it-back-on-in-the-FIQ approach works.

 *gibber*

 basically i am doing this:

 * in the ARM interrupt read routine, first thing i do is mask
   read interrupts.

 * i then set up the ARM port for "read", including disabling the
   keyboard which shares some of the port lines.

 * i then read the byte (which causes an edge-triggered interrupt
   to the PIC, which then sets about clearing the interrupt).
 
 * i then re-enable the keyboard.

 * at the end of the routine, i then set a flag.


 some time later, within 1/8000th of a second, this flag is checked.
 if it's set, read interrupts are unmasked.

 
 ... btw when you say "using the linux interrupt management" routines,
 what exactly do you mean?

 at the moment (because that's what was done when i stepped in
 to sort out this code) i am directly accessing the INTMR1 and
 INTSR1 registers - _not_ calling enable_irq() or disable_irq()
 or other)

 (and in the FIQ handler of course i _can't_ call those functions).

 is that a problem?

 l.


  parent reply	other threads:[~2005-05-06 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-03 21:56 tricky challenge for getting round level-driven interrupt problem: help! Luke Kenneth Casson Leighton
2005-05-04  1:50 ` Alan Cox
2005-05-04 20:58   ` Luke Kenneth Casson Leighton
2005-05-04 21:43     ` Alan Cox
2005-05-04 23:20       ` Luke Kenneth Casson Leighton
2005-05-05 11:32       ` Luke Kenneth Casson Leighton
2005-05-06 10:57       ` Luke Kenneth Casson Leighton [this message]
2005-05-08 12:32     ` Luke Kenneth Casson Leighton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050506105731.GF7632@lkcl.net \
    --to=lkcl@lkcl.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox