diff mbox

mxl111sf: revert patch: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()

Message ID 1349469857-21396-1-git-send-email-crope@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Antti Palosaari Oct. 5, 2012, 8:44 p.m. UTC
This reverts commits:
3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
[media] mxl111sf: remove an unused variable
3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
[media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()

...as bug behind these is fixed by the DVB USB v2.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Michael Ira Krufky Oct. 5, 2012, 8:49 p.m. UTC | #1
On Fri, Oct 5, 2012 at 4:44 PM, Antti Palosaari <crope@iki.fi> wrote:
> This reverts commits:
> 3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
> [media] mxl111sf: remove an unused variable
> 3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
> [media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()
>
> ...as bug behind these is fixed by the DVB USB v2.
>
> Cc: Michael Krufky <mkrufky@linuxtv.org>
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
>  drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> index efdcb15..fcfe124 100644
> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> @@ -343,6 +343,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>         struct mxl111sf_state *state = fe_to_priv(fe);
>         struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
>         int ret = 0;
> +       u8 tmp;
>
>         deb_info("%s(%d)\n", __func__, onoff);
>
> @@ -353,13 +354,15 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>                                               adap_state->ep6_clockphase,
>                                               0, 0);
>                 mxl_fail(ret);
> -#if 0
>         } else {
>                 ret = mxl111sf_disable_656_port(state);
>                 mxl_fail(ret);
> -#endif
>         }
>
> +       mxl111sf_read_reg(state, 0x12, &tmp);
> +       tmp &= ~0x04;
> +       mxl111sf_write_reg(state, 0x12, tmp);
> +
>         return ret;
>  }
>


I disabled that code on purpose - its redundant.  please do not apply
this patch.

-Mike
--
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 Oct. 5, 2012, 8:52 p.m. UTC | #2
I was wondering if that fix USB host controller reset I am seeing but it 
didn't :-(

Anyhow, that should be still fixed.

Oct  5 23:21:05 localhost kernel: [  216.670807] hub 2-0:1.0: >port 2 
disabled by hub (EMI?), re-enabling...
Oct  5 23:21:05 localhost kernel: [  216.670812] usb 2-2: >USB 
disconnect, device number 6
Oct  5 23:21:05 localhost kernel: [  216.671022] dvb-usb: recv bulk 
message failed: -108

Linux localhost.localdomain 3.5.4-2.fc17.x86_64 #1 SMP Wed Sep 26 
21:58:50 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Same happens for latest 3.6/3.7 too:
Oct  5 23:28:37 localhost kernel: [  319.837639] usb 2-2: dvb_usb_v2: 
'Hauppauge WinTV-Aero-M' successfully initialized and connected
Oct  5 23:28:41 localhost kernel: [  324.551834] hub 2-0:1.0: port 2 
disabled by hub (EMI?), re-enabling...
Oct  5 23:28:41 localhost kernel: [  324.551849] usb 2-2: USB 
disconnect, device number 9
Oct  5 23:28:41 localhost kernel: [  324.561541] usb 2-2: dvb_usb_v2: 
usb_bulk_msg() failed=-71

Linux localhost.localdomain 3.6.0+ #4 SMP Fri Oct 5 23:09:53 EEST 2012 
x86_64 x86_64 x86_64 GNU/Linux

I am quite sure it is some problem (race condition) when powering off 
and starting frontends. It could be reproduced quite easily making 
tuning attempts quickly for frontend 0 and 1. Usually zap -f 1; zap -f 
0; zap -f 1; and kaboom, it reboots USB HCI. AMD SB700 USB HCI used.

When you do that fe switching slowly it does not happen.

regards
Antti


On 10/05/2012 11:44 PM, Antti Palosaari wrote:
> This reverts commits:
> 3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
> [media] mxl111sf: remove an unused variable
> 3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
> [media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()
>
> ...as bug behind these is fixed by the DVB USB v2.
>
> Cc: Michael Krufky <mkrufky@linuxtv.org>
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
>   drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> index efdcb15..fcfe124 100644
> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> @@ -343,6 +343,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>   	struct mxl111sf_state *state = fe_to_priv(fe);
>   	struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
>   	int ret = 0;
> +	u8 tmp;
>
>   	deb_info("%s(%d)\n", __func__, onoff);
>
> @@ -353,13 +354,15 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>   					      adap_state->ep6_clockphase,
>   					      0, 0);
>   		mxl_fail(ret);
> -#if 0
>   	} else {
>   		ret = mxl111sf_disable_656_port(state);
>   		mxl_fail(ret);
> -#endif
>   	}
>
> +	mxl111sf_read_reg(state, 0x12, &tmp);
> +	tmp &= ~0x04;
> +	mxl111sf_write_reg(state, 0x12, tmp);
> +
>   	return ret;
>   }
>
>
Antti Palosaari Oct. 5, 2012, 8:54 p.m. UTC | #3
On 10/05/2012 11:49 PM, Michael Krufky wrote:
> On Fri, Oct 5, 2012 at 4:44 PM, Antti Palosaari <crope@iki.fi> wrote:
>> This reverts commits:
>> 3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
>> [media] mxl111sf: remove an unused variable
>> 3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
>> [media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()
>>
>> ...as bug behind these is fixed by the DVB USB v2.
>>
>> Cc: Michael Krufky <mkrufky@linuxtv.org>
>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>> ---
>>   drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>> index efdcb15..fcfe124 100644
>> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>> @@ -343,6 +343,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>>          struct mxl111sf_state *state = fe_to_priv(fe);
>>          struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
>>          int ret = 0;
>> +       u8 tmp;
>>
>>          deb_info("%s(%d)\n", __func__, onoff);
>>
>> @@ -353,13 +354,15 @@ static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
>>                                                adap_state->ep6_clockphase,
>>                                                0, 0);
>>                  mxl_fail(ret);
>> -#if 0
>>          } else {
>>                  ret = mxl111sf_disable_656_port(state);
>>                  mxl_fail(ret);
>> -#endif
>>          }
>>
>> +       mxl111sf_read_reg(state, 0x12, &tmp);
>> +       tmp &= ~0x04;
>> +       mxl111sf_write_reg(state, 0x12, tmp);
>> +
>>          return ret;
>>   }
>>
>
>
> I disabled that code on purpose - its redundant.  please do not apply
> this patch.

According to comments you have added patch changelog you disabled it doe 
to that bug:

[media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()

Remove unnecessary register access in mxl111sf_ep6_streaming_ctrl()

This code breaks driver operation in kernel 3.3 and later, although
it works properly in 3.2  Disable register access to 0x12 for now.



are you saying there is some other reason than mentioned here? I am 
quite 100% sure I fixed that bug in dvb-usb.

regards
Antti
Michael Ira Krufky Oct. 5, 2012, 8:58 p.m. UTC | #4
On Fri, Oct 5, 2012 at 4:54 PM, Antti Palosaari <crope@iki.fi> wrote:
> On 10/05/2012 11:49 PM, Michael Krufky wrote:
>>
>> On Fri, Oct 5, 2012 at 4:44 PM, Antti Palosaari <crope@iki.fi> wrote:
>>>
>>> This reverts commits:
>>> 3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
>>> [media] mxl111sf: remove an unused variable
>>> 3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
>>> [media] mxl111sf: fix error on stream stop in
>>> mxl111sf_ep6_streaming_ctrl()
>>>
>>> ...as bug behind these is fixed by the DVB USB v2.
>>>
>>> Cc: Michael Krufky <mkrufky@linuxtv.org>
>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>> ---
>>>   drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
>>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>> b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>> index efdcb15..fcfe124 100644
>>> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>> @@ -343,6 +343,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct
>>> dvb_frontend *fe, int onoff)
>>>          struct mxl111sf_state *state = fe_to_priv(fe);
>>>          struct mxl111sf_adap_state *adap_state =
>>> &state->adap_state[fe->id];
>>>          int ret = 0;
>>> +       u8 tmp;
>>>
>>>          deb_info("%s(%d)\n", __func__, onoff);
>>>
>>> @@ -353,13 +354,15 @@ static int mxl111sf_ep6_streaming_ctrl(struct
>>> dvb_frontend *fe, int onoff)
>>>
>>> adap_state->ep6_clockphase,
>>>                                                0, 0);
>>>                  mxl_fail(ret);
>>> -#if 0
>>>          } else {
>>>                  ret = mxl111sf_disable_656_port(state);
>>>                  mxl_fail(ret);
>>> -#endif
>>>          }
>>>
>>> +       mxl111sf_read_reg(state, 0x12, &tmp);
>>> +       tmp &= ~0x04;
>>> +       mxl111sf_write_reg(state, 0x12, tmp);
>>> +
>>>          return ret;
>>>   }
>>>
>>
>>
>> I disabled that code on purpose - its redundant.  please do not apply
>> this patch.
>
>
> According to comments you have added patch changelog you disabled it doe to
> that bug:
>
>
> [media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()
>
> Remove unnecessary register access in mxl111sf_ep6_streaming_ctrl()
>
> This code breaks driver operation in kernel 3.3 and later, although
> it works properly in 3.2  Disable register access to 0x12 for now.
>
>
>
> are you saying there is some other reason than mentioned here? I am quite
> 100% sure I fixed that bug in dvb-usb.
>
> regards
> Antti
> --
> http://palosaari.fi/

Yup... there is indeed another reason.  However, if you want to push a
new patch that just removes the #if 0's, that would be fine.  Please
test first, of course.

Just a warning, MH support is broken now and I haven't yet had a
chance to track that down yet...  Luckily, merge window rules dont
apply to regressions.  (it worked in 3.5 w/ dvb-usb before the forced
change to 'dvb-usb-v2')

I plan to (hopefully) do a full qual this weekend and hopefully push
patches as needed.

-Mike
--
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 Oct. 5, 2012, 9:16 p.m. UTC | #5
On 10/05/2012 11:58 PM, Michael Krufky wrote:
> On Fri, Oct 5, 2012 at 4:54 PM, Antti Palosaari <crope@iki.fi> wrote:
>> On 10/05/2012 11:49 PM, Michael Krufky wrote:
>>>
>>> On Fri, Oct 5, 2012 at 4:44 PM, Antti Palosaari <crope@iki.fi> wrote:
>>>>
>>>> This reverts commits:
>>>> 3fd7e4341e04f80e2605f56bbd8cb1e8b027901a
>>>> [media] mxl111sf: remove an unused variable
>>>> 3be5bb71fbf18f83cb88b54a62a78e03e5a4f30a
>>>> [media] mxl111sf: fix error on stream stop in
>>>> mxl111sf_ep6_streaming_ctrl()
>>>>
>>>> ...as bug behind these is fixed by the DVB USB v2.
>>>>
>>>> Cc: Michael Krufky <mkrufky@linuxtv.org>
>>>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>>>> ---
>>>>    drivers/media/usb/dvb-usb-v2/mxl111sf.c | 7 +++++--
>>>>    1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>>> b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>>> index efdcb15..fcfe124 100644
>>>> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>>> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
>>>> @@ -343,6 +343,7 @@ static int mxl111sf_ep6_streaming_ctrl(struct
>>>> dvb_frontend *fe, int onoff)
>>>>           struct mxl111sf_state *state = fe_to_priv(fe);
>>>>           struct mxl111sf_adap_state *adap_state =
>>>> &state->adap_state[fe->id];
>>>>           int ret = 0;
>>>> +       u8 tmp;
>>>>
>>>>           deb_info("%s(%d)\n", __func__, onoff);
>>>>
>>>> @@ -353,13 +354,15 @@ static int mxl111sf_ep6_streaming_ctrl(struct
>>>> dvb_frontend *fe, int onoff)
>>>>
>>>> adap_state->ep6_clockphase,
>>>>                                                 0, 0);
>>>>                   mxl_fail(ret);
>>>> -#if 0
>>>>           } else {
>>>>                   ret = mxl111sf_disable_656_port(state);
>>>>                   mxl_fail(ret);
>>>> -#endif
>>>>           }
>>>>
>>>> +       mxl111sf_read_reg(state, 0x12, &tmp);
>>>> +       tmp &= ~0x04;
>>>> +       mxl111sf_write_reg(state, 0x12, tmp);
>>>> +
>>>>           return ret;
>>>>    }
>>>>
>>>
>>>
>>> I disabled that code on purpose - its redundant.  please do not apply
>>> this patch.
>>
>>
>> According to comments you have added patch changelog you disabled it doe to
>> that bug:
>>
>>
>> [media] mxl111sf: fix error on stream stop in mxl111sf_ep6_streaming_ctrl()
>>
>> Remove unnecessary register access in mxl111sf_ep6_streaming_ctrl()
>>
>> This code breaks driver operation in kernel 3.3 and later, although
>> it works properly in 3.2  Disable register access to 0x12 for now.
>>
>>
>>
>> are you saying there is some other reason than mentioned here? I am quite
>> 100% sure I fixed that bug in dvb-usb.
>>
>> regards
>> Antti
>> --
>> http://palosaari.fi/
>
> Yup... there is indeed another reason.  However, if you want to push a
> new patch that just removes the #if 0's, that would be fine.  Please
> test first, of course.
>
> Just a warning, MH support is broken now and I haven't yet had a
> chance to track that down yet...  Luckily, merge window rules dont
> apply to regressions.  (it worked in 3.5 w/ dvb-usb before the forced
> change to 'dvb-usb-v2')
>
> I plan to (hopefully) do a full qual this weekend and hopefully push
> patches as needed.

I cannot test it properly with DVB-T as EP6 is not used for DVB-T. Only 
some stupid "dry rans". Did you saw yourself "dvb-usb: error while 
stopping stream." ? If yes, then you could likely test it. But in any 
case, you know what that reg bit is and if it is necessary or not. 
Likely not important.

regards
Antti
diff mbox

Patch

diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
index efdcb15..fcfe124 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
@@ -343,6 +343,7 @@  static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
 	struct mxl111sf_state *state = fe_to_priv(fe);
 	struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id];
 	int ret = 0;
+	u8 tmp;
 
 	deb_info("%s(%d)\n", __func__, onoff);
 
@@ -353,13 +354,15 @@  static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff)
 					      adap_state->ep6_clockphase,
 					      0, 0);
 		mxl_fail(ret);
-#if 0
 	} else {
 		ret = mxl111sf_disable_656_port(state);
 		mxl_fail(ret);
-#endif
 	}
 
+	mxl111sf_read_reg(state, 0x12, &tmp);
+	tmp &= ~0x04;
+	mxl111sf_write_reg(state, 0x12, tmp);
+
 	return ret;
 }