* [PATCH] Fixes stb0899 not locking
@ 2011-04-23 19:32 Issa Gorissen
0 siblings, 0 replies; 4+ messages in thread
From: Issa Gorissen @ 2011-04-23 19:32 UTC (permalink / raw)
To: Lutz Sammer; +Cc: linux-media
> Fixes stb0899 not locking.
> See http://www.spinics.net/lists/linux-media/msg30486.html ...
>
> When stb0899_check_data is entered, it could happen, that the data is
> already locked and the data search looped. stb0899_check_data fails to
> lock on a good frequency. stb0899_search_data uses an extrem big search
> step and fails to lock.
>
> The new code checks for lock before starting a new search.
> The first read ignores the loop bit, for the case that the loop bit is
> set during the search setup. I also added the msleep to reduce the
> traffic on the i2c bus.
>
> Johns
>
> Signed-off-by: Lutz Sammer <johns98 <at> gmx.net>
> diff --git a/drivers/media/dvb/frontends/stb0899_algo.c
> b/drivers/media/dvb/frontends/stb0899_algo.c
> index 2da55ec..55f0c4e 100644
> --- a/drivers/media/dvb/frontends/stb0899_algo.c
> +++ b/drivers/media/dvb/frontends/stb0899_algo.c
> @@ -338,36 +338,42 @@ static enum stb0899_status
> stb0899_check_data(struct stb0899_state *state)
> int lock = 0, index = 0, dataTime = 500, loop;
> u8 reg;
>
> - internal->status = NODATA;
> + reg = stb0899_read_reg(state, STB0899_VSTATUS);
> + lock = STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg);
> + if ( !lock ) {
>
> - /* RESET FEC */
> - reg = stb0899_read_reg(state, STB0899_TSTRES);
> - STB0899_SETFIELD_VAL(FRESACS, reg, 1);
> - stb0899_write_reg(state, STB0899_TSTRES, reg);
> - msleep(1);
> - reg = stb0899_read_reg(state, STB0899_TSTRES);
> - STB0899_SETFIELD_VAL(FRESACS, reg, 0);
> - stb0899_write_reg(state, STB0899_TSTRES, reg);
> + internal->status = NODATA;
>
> - if (params->srate <= 2000000)
> - dataTime = 2000;
> - else if (params->srate <= 5000000)
> - dataTime = 1500;
> - else if (params->srate <= 15000000)
> - dataTime = 1000;
> - else
> - dataTime = 500;
> -
> - stb0899_write_reg(state, STB0899_DSTATUS2, 0x00); /* force
> search loop */
> - while (1) {
> - /* WARNING! VIT LOCKED has to be tested before
> VIT_END_LOOOP */
> - reg = stb0899_read_reg(state, STB0899_VSTATUS);
> - lock = STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg);
> - loop = STB0899_GETFIELD(VSTATUS_END_LOOPVIT, reg);
> + /* RESET FEC */
> + reg = stb0899_read_reg(state, STB0899_TSTRES);
> + STB0899_SETFIELD_VAL(FRESACS, reg, 1);
> + stb0899_write_reg(state, STB0899_TSTRES, reg);
> + msleep(1);
> + reg = stb0899_read_reg(state, STB0899_TSTRES);
> + STB0899_SETFIELD_VAL(FRESACS, reg, 0);
> + stb0899_write_reg(state, STB0899_TSTRES, reg);
>
> - if (lock || loop || (index > dataTime))
> - break;
> - index++;
> + msleep(1);
> + }
> }
>
> if (lock) { /* DATA LOCK indicator */
Hi Johns,
I've tried your path but I had to remove the last } that you added after
the msleep(1);
The patch had not make any better the tuning of transponders on HB13E
for me.
Thanks anyway.
--
Issa
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixes stb0899 not locking
2011-04-04 12:02 Lutz Sammer
2011-04-18 5:48 ` Steffen Barszus
@ 2011-04-21 21:02 ` Steffen Barszus
1 sibling, 0 replies; 4+ messages in thread
From: Steffen Barszus @ 2011-04-21 21:02 UTC (permalink / raw)
To: Lutz Sammer; +Cc: linux-media, liplianin, abraham.manu
On Mon, 04 Apr 2011 14:02:31 +0200
Lutz Sammer <johns98@gmx.net> wrote:
> Fixes stb0899 not locking.
> See http://www.spinics.net/lists/linux-media/msg30486.html ...
>
> When stb0899_check_data is entered, it could happen, that the data is
> already locked and the data search looped. stb0899_check_data fails
> to lock on a good frequency. stb0899_search_data uses an extrem big
> search step and fails to lock.
>
> The new code checks for lock before starting a new search.
> The first read ignores the loop bit, for the case that the loop bit is
> set during the search setup. I also added the msleep to reduce the
> traffic on the i2c bus.
Any updates on this one, or does this really need to be discussed. Its
proven now, that here is a bug, there was enough discussion before.
Can this PLEASE get applied.
What proofs are needed, anything wrong with it , at least ANY comment
on it ?
I'm starting to hate that its hidden trough v4l development causing that
DVB development is dead. This sucks ...
Is there any DVB developer on this list ? Someone who can check and
comment or approve this patch ?
Thanks !
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixes stb0899 not locking
2011-04-04 12:02 Lutz Sammer
@ 2011-04-18 5:48 ` Steffen Barszus
2011-04-21 21:02 ` Steffen Barszus
1 sibling, 0 replies; 4+ messages in thread
From: Steffen Barszus @ 2011-04-18 5:48 UTC (permalink / raw)
To: Lutz Sammer; +Cc: linux-media, liplianin, abraham.manu
On Mon, 04 Apr 2011 14:02:31 +0200
Lutz Sammer <johns98@gmx.net> wrote:
> Fixes stb0899 not locking.
> See http://www.spinics.net/lists/linux-media/msg30486.html ...
>
> When stb0899_check_data is entered, it could happen, that the data is
> already locked and the data search looped. stb0899_check_data fails
> to lock on a good frequency. stb0899_search_data uses an extrem big
> search step and fails to lock.
>
> The new code checks for lock before starting a new search.
> The first read ignores the loop bit, for the case that the loop bit is
> set during the search setup. I also added the msleep to reduce the
> traffic on the i2c bus.
>
Thanks Lutz for getting down to the problem :) !
Manu, Mauro,
Any comments ? Let's have that finally sorted.
I think its proven now that its a bug. We have a fix.
---
A few test result on 2.6.39-rc3 from vdr-portal(thx to jrie, hope its
ok for him). This is tuning a pre defined channel list until we have a
lock and then tune the next.
Astra_only.txt + Original
TOT: lok_errs =172, runs=1136 of sequ=1135, multi=56032, multi_max=931
real 101m40.777s
user 0m0.083s
sys 0m19.039s
Astra_only.txt + stb0899_not_locking_fix.diff
TOT: lok_errs =0, runs=1136 of sequ=1135, multi=289, multi_max=99
real 17m15.636s
user 0m0.007s
sys 0m9.445s
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Fixes stb0899 not locking
@ 2011-04-04 12:02 Lutz Sammer
2011-04-18 5:48 ` Steffen Barszus
2011-04-21 21:02 ` Steffen Barszus
0 siblings, 2 replies; 4+ messages in thread
From: Lutz Sammer @ 2011-04-04 12:02 UTC (permalink / raw)
To: linux-media; +Cc: liplianin, abraham.manu
Fixes stb0899 not locking.
See http://www.spinics.net/lists/linux-media/msg30486.html ...
When stb0899_check_data is entered, it could happen, that the data is
already locked and the data search looped. stb0899_check_data fails to
lock on a good frequency. stb0899_search_data uses an extrem big search
step and fails to lock.
The new code checks for lock before starting a new search.
The first read ignores the loop bit, for the case that the loop bit is
set during the search setup. I also added the msleep to reduce the
traffic on the i2c bus.
Johns
Signed-off-by: Lutz Sammer <johns98@gmx.net>
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c
b/drivers/media/dvb/frontends/stb0899_algo.c
index 2da55ec..55f0c4e 100644
--- a/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
@@ -338,36 +338,42 @@ static enum stb0899_status
stb0899_check_data(struct stb0899_state *state)
int lock = 0, index = 0, dataTime = 500, loop;
u8 reg;
- internal->status = NODATA;
+ reg = stb0899_read_reg(state, STB0899_VSTATUS);
+ lock = STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg);
+ if ( !lock ) {
- /* RESET FEC */
- reg = stb0899_read_reg(state, STB0899_TSTRES);
- STB0899_SETFIELD_VAL(FRESACS, reg, 1);
- stb0899_write_reg(state, STB0899_TSTRES, reg);
- msleep(1);
- reg = stb0899_read_reg(state, STB0899_TSTRES);
- STB0899_SETFIELD_VAL(FRESACS, reg, 0);
- stb0899_write_reg(state, STB0899_TSTRES, reg);
+ internal->status = NODATA;
- if (params->srate <= 2000000)
- dataTime = 2000;
- else if (params->srate <= 5000000)
- dataTime = 1500;
- else if (params->srate <= 15000000)
- dataTime = 1000;
- else
- dataTime = 500;
-
- stb0899_write_reg(state, STB0899_DSTATUS2, 0x00); /* force
search loop */
- while (1) {
- /* WARNING! VIT LOCKED has to be tested before
VIT_END_LOOOP */
- reg = stb0899_read_reg(state, STB0899_VSTATUS);
- lock = STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg);
- loop = STB0899_GETFIELD(VSTATUS_END_LOOPVIT, reg);
+ /* RESET FEC */
+ reg = stb0899_read_reg(state, STB0899_TSTRES);
+ STB0899_SETFIELD_VAL(FRESACS, reg, 1);
+ stb0899_write_reg(state, STB0899_TSTRES, reg);
+ msleep(1);
+ reg = stb0899_read_reg(state, STB0899_TSTRES);
+ STB0899_SETFIELD_VAL(FRESACS, reg, 0);
+ stb0899_write_reg(state, STB0899_TSTRES, reg);
- if (lock || loop || (index > dataTime))
- break;
- index++;
+ msleep(1);
+ }
}
if (lock) { /* DATA LOCK indicator */
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-23 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-23 19:32 [PATCH] Fixes stb0899 not locking Issa Gorissen
-- strict thread matches above, loose matches on Subject: below --
2011-04-04 12:02 Lutz Sammer
2011-04-18 5:48 ` Steffen Barszus
2011-04-21 21:02 ` Steffen Barszus
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.