public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: ariga masahiro <ariga@link-lab.co.jp>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] How DSR is executed in interrupt ?
Date: Mon, 10 Sep 2007 08:52:00 -0000	[thread overview]
Message-ID: <20070910085235.GC19258@lunn.ch> (raw)
In-Reply-To: <001701c7f383$91bcbfc0$1c0110ac@ariga>

On Mon, Sep 10, 2007 at 05:21:21PM +0900, ariga masahiro wrote:
> Hi,
>
> Please help me next question ?
>
> I am trying to run LAN91CXX drive on interrupt,
> and it became to enter ISR routine when IRQ3 Line is asserted.
>
> But it looks like IRQ3 Line is ON-State forever and never become OFF-State.
> ISR is repetedly entered but never enter into DSR routine.
>
> ISR/DSR are setted like this in smsc_lan91cxx_init(),
>    // Initialize environment, setup interrupt handler
>    cyg_drv_interrupt_create(cpd->interrupt,
>                            8, // Priority - what goes here?
>                             (cyg_addrword_t)sc, //  Data item passed to 
> interrupt handler
>                             (cyg_ISR_t *)lan91cxx_isr,
>                             (cyg_DSR_t *)eth_drv_dsr, // The logical driver 
> DSR
>                             &lan91cxx_interrupt_handle,
>                             &lan91cxx_interrupt);
>    cyg_drv_interrupt_attach(lan91cxx_interrupt_handle);
>
> ISR is like below,
> static int
> lan91cxx_isr(cyg_vector_t vector, cyg_addrword_t data
>             /* , HAL_SavedRegisters *regs */ )
> {
>    struct eth_drv_sc *sc = (struct eth_drv_sc *)data;
>    struct lan91cxx_priv_data *cpd =
>        (struct lan91cxx_priv_data *)sc->driver_private;
>
>    DEBUG_FUNCTION();
>
>    INCR_STAT( interrupts );
>
>    cyg_drv_interrupt_mask(cpd->interrupt);
>    cyg_drv_interrupt_acknowledge(cpd->interrupt);
>    return (CYG_ISR_HANDLED|CYG_ISR_CALL_DSR);  // Run the DSR
> }

Are you sure the ISR is being called multiple times? 

This masks the interrupt. i.e. it should disable the interrupt
controller from causing further interrupts from this source. The
interrupt is usually unmasked in the delivery function once the
hardware has been reprogrammed to de-assert the interrupt. Since you
say the DSR is not getting called, i don't see how the interrupt can
get unmasked and so i don't see how the ISR can be called again.....

This suggests that cyg_drv_interrupt_mask() is not working. It is not
masking the interrupt. I would take a look at your HAL and check the
interrupt handling code.

> I think /packages/io/eth/v2_0/src/net/eth_drv.c file's

As i've said before v2_0 is very old. It could be this has been fixed
in newer code....

   Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-09-10  8:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10  8:21 ariga masahiro
2007-09-10  8:52 ` Andrew Lunn [this message]
2007-09-11  2:44   ` ariga masahiro
2007-09-11 14:19     ` Andrew Lunn
2007-09-12  4:51       ` ariga masahiro
2007-09-12  5:14         ` Paul D. DeRocco
2007-09-12  8:19 ariga masahiro
2007-09-12  8:25 ` Andrew Lunn

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=20070910085235.GC19258@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ariga@link-lab.co.jp \
    --cc=ecos-discuss@ecos.sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).