All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Michael Krufky <mkrufky@linuxtv.org>,
	linux-media <linux-media@vger.kernel.org>
Subject: Re: tda18271 driver power consumption
Date: Fri, 28 Sep 2012 19:19:16 +0300	[thread overview]
Message-ID: <5065CE04.6040306@iki.fi> (raw)
In-Reply-To: <20120928084337.1db94b8c@redhat.com>

On 09/28/2012 02:43 PM, Mauro Carvalho Chehab wrote:
> Em Thu, 27 Sep 2012 17:58:24 -0400
> Michael Krufky <mkrufky@linuxtv.org> escreveu:
>
>> On Thu, Sep 27, 2012 at 5:38 PM, Antti Palosaari <crope@iki.fi> wrote:
>>> On 09/28/2012 12:20 AM, Michael Krufky wrote:
>
>>> Mike, There is other problem too. PCTV 520e, which is Em28xx + DRX-K +
>>> TDA18271, fails to attach tuner now. Tuner is wired behind DRX-K I2C bus.
>>> TDA18271 driver does very much I/O during attach and I2C error is raised
>>> during attach now. Earlier it worked as DRX-K firmware was downloaded before
>>> tuner was attached, but now both DRX-K fw download and tuner attach happens
>>> same time leading that error.
>>
>> Why is the DRX-K firmware downloading at the same time as tuner
>> attach?  Shouldn't the demod attach be finished before the tuner
>> attach begins?
>
> Michael,
>
> What happens is that udev changes forced drivers to load firmware asynchronously,
> as, otherwise, udev won't load any firmware at all. Also, there's no warranty that
> the firmware will be loaded on 2 seconds or so (Anti's hack were to add a 2 seconds
> wait after drxk atttach, to wait for firmware load).

IMHO whole current DRX-K FW is broken by design.
1) if fw is not really needed it should not be loaded on attach() 
instead first use case at .init()
2) if fw is needed then it must be loaded and wait chip is up and 
running and after that return from attach()

When you done it asynchronously like that, there is big you hit more 
problems depending on hardware configuration etc.

I explained that earlier too. But lets take more "real world" example.

There is USB DVB-S device. USB-bridge needs first firmware in order to 
offer I2C adapter. We need USB-bridge I2C-adapter to probe demodulator 
which sits on bridge I2C-bus. After demodulator is found we need to 
download firmware fir demodulator in order to find out tuner. Tuner sits 
behind demod I2C-bus. OK, download fw and start demod => get access for 
demod I2C-bus. Then probe used tuner. Download FW for tuner in order to 
get access for tuner GPIOs which are in that case controlled by tuner 
firmware. Finally there is LNB voltage controller which is controlled by 
tuner GPIO. We ask tuner firmware to disable LNB voltage supply.

Quite worst possible scenario, but highly possible. And it cannot be 
performed until firmware are loaded for each chip one by one.

The only place this kind "asynchronous" hack is allowed is bridge driver 
- leaving the rest as those are. And my real opinion is that this kind 
of functionality does not belong to drivers at all but somewhere more 
lower levels like USB/PCI core routines.

> What I suspect is that tda18271 init is being interruped in the middle, by the
> drxk firmware load. If this is the case, the solution is clean and quick: just
> use the new i2c_lock_adapter() way to lock the I2C bus to tda18271 during the
> critical part of the code where the register init happens.
>
>

regards
Antti
-- 
http://palosaari.fi/

  parent reply	other threads:[~2012-09-28 16:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-22 19:59 tda18271 driver power consumption Antti Palosaari
2012-07-24 21:55 ` Michael Krufky
2012-07-24 22:12   ` Antti Palosaari
2012-07-24 22:17     ` Michael Krufky
2012-07-25  0:15       ` Michael Krufky
2012-07-25  0:43         ` Antti Palosaari
2012-07-26  3:18           ` Michael Krufky
2012-07-26 12:48             ` Michael Krufky
2012-08-06 13:30               ` Antti Palosaari
     [not found]               ` <20120927161940.0f673e2e@redhat.com>
2012-09-27 19:59                 ` Antti Palosaari
2012-09-27 21:20                   ` Michael Krufky
2012-09-27 21:38                     ` Antti Palosaari
2012-09-27 21:58                       ` Michael Krufky
2012-09-27 22:26                         ` Antti Palosaari
2012-09-27 22:43                           ` Michael Krufky
2012-09-27 22:46                             ` Antti Palosaari
2012-09-27 22:55                               ` Michael Krufky
2012-09-27 23:05                                 ` Antti Palosaari
     [not found]                         ` <20120928084337.1db94b8c@redhat.com>
2012-09-28 15:04                           ` [PATCH] tda18271-common: hold the I2C adapter during write transfers Mauro Carvalho Chehab
2012-09-28 18:31                             ` Antti Palosaari
2012-09-28 18:56                               ` Michael Krufky
2012-09-29 19:20                                 ` Michael Krufky
2012-10-07 12:42                                   ` Mauro Carvalho Chehab
2012-10-07 13:18                                     ` Michael Krufky
2012-10-01 10:42                               ` Mauro Carvalho Chehab
2012-10-01 11:31                                 ` Antti Palosaari
2012-10-01 12:36                                   ` Mauro Carvalho Chehab
2012-09-28 16:19                           ` Antti Palosaari [this message]
2012-08-06 18:19       ` tda18271 driver power consumption Antti Palosaari
2012-08-06 18:35         ` Devin Heitmueller
2012-08-06 18:57           ` Michael Krufky
2012-08-06 19:13             ` Antti Palosaari
2012-08-06 20:19               ` Manu Abraham
2012-09-20 17:47               ` Michael Krufky
2012-09-20 17:49                 ` Michael Krufky
2012-09-22 17:21                   ` Antti Palosaari

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=5065CE04.6040306@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mkrufky@linuxtv.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 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.