public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: alain meirhaeghe <ame@technord.com>
To: linux-kernel@vger.kernel.org
Subject: PROBLEM: module i2c_pca_isa PC9564, interrupt problem
Date: Mon, 21 May 2007 17:47:09 +0200	[thread overview]
Message-ID: <4651BEFD.2080700@technord.com> (raw)

Hello,
I think there is a bug in i2c_pca_isa driver.
Problem is interrupt running on arm720 system linux-2.6.20.1.

Description of the problem:
When driver write to pc9564 an infinite loop interrupt appear (bloquing 
the system).


J think it is because the acknowledge of interrupt is not do correctly.
Acknowledge of interrupt is done outside interrupt .
J think it is dangerous if latency time of interrupt is short (as in ARM 
processor).

See existing code below:
static int pca_isa_waitforinterrupt(struct i2c_algo_pca_data *adap)
{
    int ret = 0;
    if (irq > -1)
    {
        ret = wait_event_interruptible(pca_wait,pca_isa_readbyte(adap, 
I2C_PCA_CON) & I2C_PCA_CON_SI);
      
    } else
    {
        while ((pca_isa_readbyte(adap, I2C_PCA_CON) & I2C_PCA_CON_SI) == 0)
            udelay(100);
    }
    return ret;
}

static irqreturn_t pca_handler(int this_irq, void *dev_id) {
   
    wake_up_interruptible(&pca_wait);
    return IRQ_HANDLED;
}

Isa_wait is never waked because pca_handler is always call, because j 
think it is necessary to acknowledge the interrupt in the interrupt 
handler as usual.
My temporary solution is:
static irqreturn_t pca_handler(int this_irq, void *dev_id) {
    disable_irq(irq);   // !!!!!!!!!!!!!!!!!!! temporary patch
    wake_up_interruptible(&pca_wait);
    return IRQ_HANDLED;
}



How can we correct this  ?

Thank to all
Alain Meirhaeghe





                 reply	other threads:[~2007-05-21 15:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4651BEFD.2080700@technord.com \
    --to=ame@technord.com \
    --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