dvb_usb_af9015: command failed=1 _ kernel >= 4.1.x

Message ID 559B9261.4050409@gmail.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

poma July 7, 2015, 8:48 a.m. UTC
  On 06.07.2015 22:17, Jose Alberto Reguero wrote:
> I made the patch for the af9035. I have not a af9015 whith mxl5007 and dual channel. Revert it, if it cause regresions.
> 
> Jose Alberto
> 

Thanks.

From e19560ea038e54dc57be717db55f19d449df63f0 Mon Sep 17 00:00:00 2001
From: poma <pomidorabelisima@gmail.com>
Date: Tue, 7 Jul 2015 10:26:13 +0200
Subject: [PATCH] Fix for AF9015 DVB-T USB2.0 stick

This reverts commitas:

- 02f9cf96df57575acea2e6eb4041e9f3ecd32548
  "[media] [PATH,2/2] mxl5007 move loop_thru to attach"
- fe4860af002a4516dd878f7297b61e186c475b35
  "[media] [PATH,1/2] mxl5007 move reset to attach"

This is the conclusion after extensive testing,
these two commitas produce:

mxl5007t_soft_reset: 521: failed!
mxl5007t_attach: error -121 on line 907

causing AF9015 DVB-T USB2.0 stick completely unusable.


Tested-by: poma <pomidorabelisima@gmail.com>
---
 drivers/media/tuners/mxl5007t.c | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)
  

Comments

poma July 13, 2015, 9:48 a.m. UTC | #1
On 07.07.2015 10:48, poma wrote:
> On 06.07.2015 22:17, Jose Alberto Reguero wrote:
>> I made the patch for the af9035. I have not a af9015 whith mxl5007 and dual channel. Revert it, if it cause regresions.
>>
>> Jose Alberto
>>
> 
> Thanks.
> 
> From e19560ea038e54dc57be717db55f19d449df63f0 Mon Sep 17 00:00:00 2001
> From: poma <pomidorabelisima@gmail.com>
> Date: Tue, 7 Jul 2015 10:26:13 +0200
> Subject: [PATCH] Fix for AF9015 DVB-T USB2.0 stick
> 
> This reverts commitas:
> 
> - 02f9cf96df57575acea2e6eb4041e9f3ecd32548
>   "[media] [PATH,2/2] mxl5007 move loop_thru to attach"
> - fe4860af002a4516dd878f7297b61e186c475b35
>   "[media] [PATH,1/2] mxl5007 move reset to attach"
> 
> This is the conclusion after extensive testing,
> these two commitas produce:
> 
> mxl5007t_soft_reset: 521: failed!
> mxl5007t_attach: error -121 on line 907
> 
> causing AF9015 DVB-T USB2.0 stick completely unusable.
> 
> 
> Tested-by: poma <pomidorabelisima@gmail.com>
> ---
>  drivers/media/tuners/mxl5007t.c | 30 +++++-------------------------
>  1 file changed, 5 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/media/tuners/mxl5007t.c b/drivers/media/tuners/mxl5007t.c
> index f4ae04c..f8c4ba2 100644
> --- a/drivers/media/tuners/mxl5007t.c
> +++ b/drivers/media/tuners/mxl5007t.c
> @@ -374,6 +374,7 @@ static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state,
>  	mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if);
>  	mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz);
>  
> +	set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable);
>  	set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3);
>  	set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp);
>  
> @@ -530,6 +531,10 @@ static int mxl5007t_tuner_init(struct mxl5007t_state *state,
>  	struct reg_pair_t *init_regs;
>  	int ret;
>  
> +	ret = mxl5007t_soft_reset(state);
> +	if (mxl_fail(ret))
> +		goto fail;
> +
>  	/* calculate initialization reg array */
>  	init_regs = mxl5007t_calc_init_regs(state, mode);
>  
> @@ -895,32 +900,7 @@ struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
>  		/* existing tuner instance */
>  		break;
>  	}
> -
> -	if (fe->ops.i2c_gate_ctrl)
> -		fe->ops.i2c_gate_ctrl(fe, 1);
> -
> -	ret = mxl5007t_soft_reset(state);
> -
> -	if (fe->ops.i2c_gate_ctrl)
> -		fe->ops.i2c_gate_ctrl(fe, 0);
> -
> -	if (mxl_fail(ret))
> -		goto fail;
> -
> -	if (fe->ops.i2c_gate_ctrl)
> -		fe->ops.i2c_gate_ctrl(fe, 1);
> -
> -	ret = mxl5007t_write_reg(state, 0x04,
> -		state->config->loop_thru_enable);
> -
> -	if (fe->ops.i2c_gate_ctrl)
> -		fe->ops.i2c_gate_ctrl(fe, 0);
> -
> -	if (mxl_fail(ret))
> -		goto fail;
> -
>  	fe->tuner_priv = state;
> -
>  	mutex_unlock(&mxl5007t_list_mutex);
>  
>  	memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops,
> 


Guys, any chance to push this any time soon?


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
poma July 31, 2015, 3:03 p.m. UTC | #2
On 13.07.2015 11:48, poma wrote:
> On 07.07.2015 10:48, poma wrote:
>> On 06.07.2015 22:17, Jose Alberto Reguero wrote:
>>> I made the patch for the af9035. I have not a af9015 whith mxl5007 and dual channel. Revert it, if it cause regresions.
>>>
>>> Jose Alberto
>>>
>>
>> Thanks.
>>
>> From e19560ea038e54dc57be717db55f19d449df63f0 Mon Sep 17 00:00:00 2001
>> From: poma <pomidorabelisima@gmail.com>
>> Date: Tue, 7 Jul 2015 10:26:13 +0200
>> Subject: [PATCH] Fix for AF9015 DVB-T USB2.0 stick
>>
>> This reverts commitas:
>>
>> - 02f9cf96df57575acea2e6eb4041e9f3ecd32548
>>   "[media] [PATH,2/2] mxl5007 move loop_thru to attach"
>> - fe4860af002a4516dd878f7297b61e186c475b35
>>   "[media] [PATH,1/2] mxl5007 move reset to attach"
>>
>> This is the conclusion after extensive testing,
>> these two commitas produce:
>>
>> mxl5007t_soft_reset: 521: failed!
>> mxl5007t_attach: error -121 on line 907
>>
>> causing AF9015 DVB-T USB2.0 stick completely unusable.
>>
>>
>> Tested-by: poma <pomidorabelisima@gmail.com>
>> ---
>>  drivers/media/tuners/mxl5007t.c | 30 +++++-------------------------
>>  1 file changed, 5 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/media/tuners/mxl5007t.c b/drivers/media/tuners/mxl5007t.c
>> index f4ae04c..f8c4ba2 100644
>> --- a/drivers/media/tuners/mxl5007t.c
>> +++ b/drivers/media/tuners/mxl5007t.c
>> @@ -374,6 +374,7 @@ static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state,
>>  	mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if);
>>  	mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz);
>>  
>> +	set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable);
>>  	set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3);
>>  	set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp);
>>  
>> @@ -530,6 +531,10 @@ static int mxl5007t_tuner_init(struct mxl5007t_state *state,
>>  	struct reg_pair_t *init_regs;
>>  	int ret;
>>  
>> +	ret = mxl5007t_soft_reset(state);
>> +	if (mxl_fail(ret))
>> +		goto fail;
>> +
>>  	/* calculate initialization reg array */
>>  	init_regs = mxl5007t_calc_init_regs(state, mode);
>>  
>> @@ -895,32 +900,7 @@ struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
>>  		/* existing tuner instance */
>>  		break;
>>  	}
>> -
>> -	if (fe->ops.i2c_gate_ctrl)
>> -		fe->ops.i2c_gate_ctrl(fe, 1);
>> -
>> -	ret = mxl5007t_soft_reset(state);
>> -
>> -	if (fe->ops.i2c_gate_ctrl)
>> -		fe->ops.i2c_gate_ctrl(fe, 0);
>> -
>> -	if (mxl_fail(ret))
>> -		goto fail;
>> -
>> -	if (fe->ops.i2c_gate_ctrl)
>> -		fe->ops.i2c_gate_ctrl(fe, 1);
>> -
>> -	ret = mxl5007t_write_reg(state, 0x04,
>> -		state->config->loop_thru_enable);
>> -
>> -	if (fe->ops.i2c_gate_ctrl)
>> -		fe->ops.i2c_gate_ctrl(fe, 0);
>> -
>> -	if (mxl_fail(ret))
>> -		goto fail;
>> -
>>  	fe->tuner_priv = state;
>> -
>>  	mutex_unlock(&mxl5007t_list_mutex);
>>  
>>  	memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops,
>>
> 
> 
> Guys, any chance to push this any time soon?
> 
> 

Will someone finally push this?

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
poma Aug. 10, 2015, 9:46 p.m. UTC | #3
On 31.07.2015 17:55, Olli Salonen wrote:
> Hi Poma,
> 
> Might I suggest reading points 9, 10 and 11 from the following document:
> https://www.kernel.org/doc/Documentation/SubmittingPatches
> 
> Especially point 11 needs to be taken care of in order for your patch to be
> merged.
> 
> Cheers,
> -olli
> 

This is why top posting is so bad:

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
  

Furthermore, to fix this issue - AF9015 DVB-T USB2.0 stick brokenness - is the responsibility of developers.
I am here only proven tester.

I hope we understand each other, and this problem will be resolved in good faith.


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Antti Palosaari Aug. 10, 2015, 10:40 p.m. UTC | #4
On 08/11/2015 12:46 AM, poma wrote:
> Furthermore, to fix this issue - AF9015 DVB-T USB2.0 stick brokenness - is the responsibility of developers.
> I am here only proven tester.
>
> I hope we understand each other, and this problem will be resolved in good faith.

Your patches are implemented wrong.

When I added mxl5007t support to that driver it was DigitalNow TinyTwin 
v2 I had. The rest mxl5007t dual devices using reference design IDs went 
to same due to reason driver detects used tuner. My device is still 
working fine, which means your device has different wiring. As 2nd tuner 
attach fails it means there is communication loss to tuner. Which means 
tuner is most likely hold in a reset attach time or there is some I2C 
gating which prevents communication.

Patches you sent will introduce another issue. For dual tuner 
configuration there could be antenna wired from tuner chip to another. 
After that patch you will lose antenna signal from 2nd tuner on cases 
where tuner antenna wire is loop through master tuner to slave.

So fix it correctly. Find out reason there is communication loss to 2nd 
tuner on attach time. I cannot do much as I simply don't have such 
hardware. And I really do not care to take any responsibility when that 
kind of issues happens - it is not my job to bough every single device 
from the market in able to test and fix every hardware combination.


Antti
  
poma Aug. 12, 2015, 11:52 p.m. UTC | #5
On 11.08.2015 00:40, Antti Palosaari wrote:
> On 08/11/2015 12:46 AM, poma wrote:
>> Furthermore, to fix this issue - AF9015 DVB-T USB2.0 stick brokenness - is the responsibility of developers.
>> I am here only proven tester.
>>
>> I hope we understand each other, and this problem will be resolved in good faith.
> 
> Your patches are implemented wrong.


Talk about deflecting.

The patch that you called "my" is nothing but two reverted commitas:

- 02f9cf96df57575acea2e6eb4041e9f3ecd32548
  "[media] [PATH,2/2] mxl5007 move loop_thru to attach"
- fe4860af002a4516dd878f7297b61e186c475b35
  "[media] [PATH,1/2] mxl5007 move reset to attach"

Besides the author, Jose Alberto Reguero does not oppose to revert them, due to the trouble they cause.

> 
> When I added mxl5007t support to that driver it was DigitalNow TinyTwin 
> v2 I had. The rest mxl5007t dual devices using reference design IDs went 
> to same due to reason driver detects used tuner. My device is still 
> working fine, which means your device has different wiring. As 2nd tuner 
> attach fails it means there is communication loss to tuner. Which means 
> tuner is most likely hold in a reset attach time or there is some I2C 
> gating which prevents communication.
> 
> Patches you sent will introduce another issue. For dual tuner 
> configuration there could be antenna wired from tuner chip to another. 
> After that patch you will lose antenna signal from 2nd tuner on cases 
> where tuner antenna wire is loop through master tuner to slave.
> 
> So fix it correctly. Find out reason there is communication loss to 2nd 
> tuner on attach time. I cannot do much as I simply don't have such 
> hardware. And I really do not care to take any responsibility when that 
> kind of issues happens - it is not my job to bough every single device 
> from the market in able to test and fix every hardware combination.
> 
> 
> Antti
> 

You very well know that I am not a developer, 
Therefore I believe this above what you write is addressed to yourself,
after all *you* are a developer, a capable one, right.

Are you?


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/tuners/mxl5007t.c b/drivers/media/tuners/mxl5007t.c
index f4ae04c..f8c4ba2 100644
--- a/drivers/media/tuners/mxl5007t.c
+++ b/drivers/media/tuners/mxl5007t.c
@@ -374,6 +374,7 @@  static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state,
 	mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if);
 	mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz);
 
+	set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable);
 	set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3);
 	set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp);
 
@@ -530,6 +531,10 @@  static int mxl5007t_tuner_init(struct mxl5007t_state *state,
 	struct reg_pair_t *init_regs;
 	int ret;
 
+	ret = mxl5007t_soft_reset(state);
+	if (mxl_fail(ret))
+		goto fail;
+
 	/* calculate initialization reg array */
 	init_regs = mxl5007t_calc_init_regs(state, mode);
 
@@ -895,32 +900,7 @@  struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
 		/* existing tuner instance */
 		break;
 	}
-
-	if (fe->ops.i2c_gate_ctrl)
-		fe->ops.i2c_gate_ctrl(fe, 1);
-
-	ret = mxl5007t_soft_reset(state);
-
-	if (fe->ops.i2c_gate_ctrl)
-		fe->ops.i2c_gate_ctrl(fe, 0);
-
-	if (mxl_fail(ret))
-		goto fail;
-
-	if (fe->ops.i2c_gate_ctrl)
-		fe->ops.i2c_gate_ctrl(fe, 1);
-
-	ret = mxl5007t_write_reg(state, 0x04,
-		state->config->loop_thru_enable);
-
-	if (fe->ops.i2c_gate_ctrl)
-		fe->ops.i2c_gate_ctrl(fe, 0);
-
-	if (mxl_fail(ret))
-		goto fail;
-
 	fe->tuner_priv = state;
-
 	mutex_unlock(&mxl5007t_list_mutex);
 
 	memcpy(&fe->ops.tuner_ops, &mxl5007t_tuner_ops,