[linux-dvb] saa7146_i2c_writeout: timed out waiting for end of xfer

Oliver Endriss o.endriss at gmx.de
Tue Jul 17 04:40:33 CEST 2007

e9hack wrote:
> Manfred Petz wrote:
> > actually, both patches help. no more timeouts, and the frontend drivers
> > get loaded correctly (tried each patch separately). tried with latest hg
> > & 2.6.22.
> I don't understand why both patches do solve the timeout problem. The message 'timed out waiting for
> end of xfer' means, that no i2c-interrupt was delivered. In this case, the return value of
> saa7146_i2c_writeout() is -EIO. The first patch has only an effect, if the return value is
> -EREMOTEIO. The second patch reduces the i2c bit-rate. Usually, it has nothing to do with the
> interrupts.

A lower i2c bit rate might have changed the timing.

> Independently of this, I've found some strange things. The drivers for the TT-C2300 and the Cinergy
> DVB-C cards probe some i2c devices which don't exist. This results in an address error (missing ACK
> after the device address). I see three interrupts for this error. The first sets I2C_BUSY and
> I2C_APERR within I2C_STATUS. It does not wake-up the waiting thread and may print the message
> 'unhandled irq: i2c'. The second interrupt is the normal error interrupt which does wake-up the
> thread. I2C_BUSSY, I2C_ERR and I2C_APERR are set. The third interrupt has set the same three status
> bits. It may print the message 'unexpected irq: i2c', because the thread was already wake-up. If the
> chip-set is only able to deliver the first interrupt, the error interrupt will be never delivered
> and the timeout occurs.

Imho the interrupt processing was broken:
- The first I2C interrupt should be used to wake-up the task.
  It does not matter that it takes some time until ERR in IIC_STA
  will be updated. We don't need it.
- Interrupts must be acknowledged at the end of the ISR.

Please test the attached patch.
There shouldn't be any unexpected I2C interrupts anymore.


VDR Remote Plugin 0.3.9: http://www.escape-edv.de/endriss/vdr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: saa7146_i2c_interrupt_fix.diff
Type: text/x-diff
Size: 2095 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070717/5c46cbac/attachment.diff 

More information about the linux-dvb mailing list