Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Erroneous unsupported PLL synthesizer: foundit!!



Michael Hunold wrote:
Hello Holger, hello Andrew,

Here you are.. this should also still report address errors correctly.
looks good,

This change is not as good as it looks. It may work on dvb cards perfectly, but it has negative side effects on my analog saa7146 based cards.

For example, the video muxes (tea6415c), audio muxes (tea6420) and the tuners may be present on very different i2c addresses, depending what the engineer has chosen. Because of the fact, that the mxb driver for example cannot specify on which addresses it expects this devices to be, it uses intesive probing.

Your change now retransmits these probe i2c messages for 3 retries, even if the first one has already shown that the device is not there (address error). This greatly increases the time the driver needs for loading, from about 1 seconds to 5 seconds.
errmm, usually i2c controllers can see a NACK after a few milliseconds, so might there be a general problem in the SAA i2c driver again?

In any case you have to retry when errors occur in the adress phase, i2c is a multi-master protocol and you have to retransmit your message in case of an arbitration error. See http://www.semiconductors.philips.com/acrobat/various/I2C_BUS_SPECIFICATION_1995.pdf for an explanation of this situation.


but I wonder if we shouldn't add a delay'n'retry on adress error for the current message only...
(imagine the stv0299 i2c gate case: 1st msg is opening the gate, then the second message has to wait a bit, but we don't want to resend the entire message...)

The problem is the crappy i2c behaviour of these chipsets. I mean, i2c is such a simple protocol and nevertheless some engineers "succeed" in screwing it up. 8-/
(well, IMHO i2c is crappy by specification,)


Anyway, I applied your patch to CVS, further optimisations can follow later.

I modified it the following way: currently, all analog saa7146 based cards use i2c transactions with i2c irqs enabled, for better performance. dvb cards don't use this, since it screws up gpio/debi irqs and results in "gpio oops"/"debi oops" messages and ts lockup.

So your new address error behaviour is only chosen for cards that don't use i2c irqs (0!= SAA7146_USE_I2C_IRQ & dev->ext->flags). So dvb cards get the new behaviour, analog cards have the old behaviour back. Ok?
hmmm, that's working but I'd like more a spec-conform approach.

btw: While reviewing this code I was not sure anymore if the retry loop should retry all messages or just the failed ones. What do you think?

Holger



--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index