* PROBLEM: module i2c_pca_isa PC9564, interrupt problem
@ 2007-05-21 15:47 alain meirhaeghe
0 siblings, 0 replies; only message in thread
From: alain meirhaeghe @ 2007-05-21 15:47 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-21 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-21 15:47 PROBLEM: module i2c_pca_isa PC9564, interrupt problem alain meirhaeghe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.