* [RFC PATCH] mn88472: reduce firmware download chunk size
@ 2015-02-19 9:13 Antti Seppälä
2015-02-19 9:43 ` Benjamin Larsson
0 siblings, 1 reply; 11+ messages in thread
From: Antti Seppälä @ 2015-02-19 9:13 UTC (permalink / raw)
To: Antti Palosaari; +Cc: linux-media, Antti Seppälä
It seems that currently the firmware download on the mn88472 is
somehow wrong for my Astrometa HD-901T2.
Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
makes the firmware download consistently succeed.
Any larger value causes the download to always fail:
[ 7.671482] mn88472 7-0018: downloading firmware from file 'dvb-demod-mn88472-02.fw'
[ 8.206960] mn88472 7-0018: firmware download failed=-32
[ 8.208610] rtl2832 7-0010: i2c reg write failed -32
[ 8.208620] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1: 83
[ 8.210459] rtl2832 7-0010: i2c reg write failed -32
[ 8.212038] rtl2832 7-0010: i2c reg write failed -32
I'm obviously not too happy about this patch as it slows down the
firmware download but I have not found a way to keep larger chunks in
place and have a working firmware download at the same time.
Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
---
drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index d88f799..3c5c6f9 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -865,7 +865,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
struct mn88472_config mn88472_config = {};
mn88472_config.fe = &adap->fe[1];
- mn88472_config.i2c_wr_max = 22,
+ mn88472_config.i2c_wr_max = 2,
strlcpy(info.type, "mn88472", I2C_NAME_SIZE);
mn88472_config.xtal = 20500000;
info.addr = 0x18;
--
2.0.5
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 9:13 [RFC PATCH] mn88472: reduce firmware download chunk size Antti Seppälä
@ 2015-02-19 9:43 ` Benjamin Larsson
2015-02-19 10:21 ` Antti Seppälä
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Larsson @ 2015-02-19 9:43 UTC (permalink / raw)
To: Antti Seppälä, Antti Palosaari; +Cc: linux-media
On 2015-02-19 10:13, Antti Seppälä wrote:
> It seems that currently the firmware download on the mn88472 is
> somehow wrong for my Astrometa HD-901T2.
>
> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
> makes the firmware download consistently succeed.
>
Hi, try adding the workaround patch I sent for this.
[PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
I now see that it hasn't been merged. But I have been running with this
patch for a few months now without any major issues.
MvH
Benjamin Larsson
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 9:43 ` Benjamin Larsson
@ 2015-02-19 10:21 ` Antti Seppälä
2015-02-19 11:53 ` Benjamin Larsson
2015-02-19 15:38 ` Antti Palosaari
0 siblings, 2 replies; 11+ messages in thread
From: Antti Seppälä @ 2015-02-19 10:21 UTC (permalink / raw)
To: Benjamin Larsson; +Cc: Antti Palosaari, linux-media
On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se> wrote:
> On 2015-02-19 10:13, Antti Seppälä wrote:
>>
>> It seems that currently the firmware download on the mn88472 is
>> somehow wrong for my Astrometa HD-901T2.
>>
>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>> makes the firmware download consistently succeed.
>>
>
>
> Hi, try adding the workaround patch I sent for this.
>
> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
>
> I now see that it hasn't been merged. But I have been running with this
> patch for a few months now without any major issues.
>
The patch really did improve firmware loading. Weird...
Even with it I still get occasional i2c errors from r820t:
[ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a len=1: da
[ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
len=4: 69 74 e6 df
[ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
len=4: 69 74 e6 df
These errors seem to appear more often if I'm reading the signal
strength values using e.g. femon.
Br,
-Antti
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 10:21 ` Antti Seppälä
@ 2015-02-19 11:53 ` Benjamin Larsson
2015-02-19 15:38 ` Antti Palosaari
1 sibling, 0 replies; 11+ messages in thread
From: Benjamin Larsson @ 2015-02-19 11:53 UTC (permalink / raw)
To: Antti Seppälä; +Cc: Antti Palosaari, linux-media
[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]
On 2015-02-19 11:21, Antti Seppälä wrote:
> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se> wrote:
>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>
>>> It seems that currently the firmware download on the mn88472 is
>>> somehow wrong for my Astrometa HD-901T2.
>>>
>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>> makes the firmware download consistently succeed.
>>>
>>
>>
>> Hi, try adding the workaround patch I sent for this.
>>
>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
>>
>> I now see that it hasn't been merged. But I have been running with this
>> patch for a few months now without any major issues.
>>
>
> The patch really did improve firmware loading. Weird...
>
> Even with it I still get occasional i2c errors from r820t:
>
> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a len=1: da
> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
> len=4: 69 74 e6 df
> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
> len=4: 69 74 e6 df
>
> These errors seem to appear more often if I'm reading the signal
> strength values using e.g. femon.
>
> Br,
> -Antti
>
This patch implements a retry logic. If a transfer fails it will convert
it to 1 byte transfers. This will not work when loading the nm88472
firmware as everything is loaded through the 0xf6 register.
I think we might need something like this to get the Astrometa working
reliably.
Based on usb logs from the windows driver one can see that they only
send 1 byte at a time so they can retry all transfers. So this issue
seems to be related to the rtl2832p bridge chip and how much i2c traffic
is generated.
MvH
Benjamin Larsson
[-- Attachment #2: 0001-rtl28xxu-implement-i2c-transfer-retry-logic.patch --]
[-- Type: text/x-patch, Size: 2152 bytes --]
>From 5962cf8fafdfe98138fd69beb4d0b5d2a7af5732 Mon Sep 17 00:00:00 2001
From: Benjamin Larsson <benjamin@southpole.se>
Date: Thu, 20 Nov 2014 00:50:02 +0100
Subject: [PATCH] rtl28xxu: implement i2c transfer retry logic
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
This is needed for Astrometa hardware. Retry counts up to 6 has been
observered before the i2c transfer succeded.
Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
---
drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 4af8a61..4d321ae 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -185,6 +185,8 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
struct dvb_usb_device *d = i2c_get_adapdata(adap);
struct rtl28xxu_priv *priv = d->priv;
struct rtl28xxu_req req;
+ u8 rb_buf[2];
+ int i, retry_cnt;
/*
* It is not known which are real I2C bus xfer limits, but testing
@@ -273,6 +275,33 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
req.size = msg[0].len-1;
req.data = &msg[0].buf[1];
ret = rtl28xxu_ctrl_msg(d, &req);
+
+ /* Astrometa hardware needs a retry for some failed transfers.
+ * Just send one byte at the time.
+ * Retry max 10 times for each transfer.
+ */
+ if (ret) {
+ req.size = 1;
+ req.data = rb_buf;
+
+ dev_dbg(&d->udev->dev, "%s: transfer of %d bytes failed\n", __func__, msg[0].len-1);
+ rb_buf[0] = msg[0].buf[0];
+
+ for (i=0 ; i<msg[0].len-1 ; i++) {
+ retry_cnt = 0;
+ req.value = ((msg[0].buf[0]+i) << 8) | (msg[0].addr << 1);
+ rb_buf[0] = msg[0].buf[i+1];
+
+ do {
+ dev_dbg(&d->udev->dev, "%s: byte: %d retry: %d\n", __func__, i, retry_cnt);
+ ret = rtl28xxu_ctrl_msg(d, &req);
+ retry_cnt++;
+ if (retry_cnt > 10)
+ goto err_mutex_unlock;
+
+ } while (ret);
+ }
+ }
} else {
/* method 3 - new I2C */
req.value = (msg[0].addr << 1);
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 10:21 ` Antti Seppälä
2015-02-19 11:53 ` Benjamin Larsson
@ 2015-02-19 15:38 ` Antti Palosaari
2015-02-19 16:01 ` Antti Seppälä
1 sibling, 1 reply; 11+ messages in thread
From: Antti Palosaari @ 2015-02-19 15:38 UTC (permalink / raw)
To: Antti Seppälä, Benjamin Larsson; +Cc: linux-media
On 02/19/2015 12:21 PM, Antti Seppälä wrote:
> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se> wrote:
>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>
>>> It seems that currently the firmware download on the mn88472 is
>>> somehow wrong for my Astrometa HD-901T2.
>>>
>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>> makes the firmware download consistently succeed.
>>>
>>
>>
>> Hi, try adding the workaround patch I sent for this.
>>
>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors
>>
>> I now see that it hasn't been merged. But I have been running with this
>> patch for a few months now without any major issues.
>>
>
> The patch really did improve firmware loading. Weird...
>
> Even with it I still get occasional i2c errors from r820t:
>
> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a len=1: da
> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
> len=4: 69 74 e6 df
> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
> len=4: 69 74 e6 df
>
> These errors seem to appear more often if I'm reading the signal
> strength values using e.g. femon.
Could you disable whole IR polling and test
modprobe dvb_usb_v2 disable_rc_polling=1
It is funny that *increasing* RC polling makes things better, though...
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 15:38 ` Antti Palosaari
@ 2015-02-19 16:01 ` Antti Seppälä
2015-02-19 16:14 ` Antti Palosaari
0 siblings, 1 reply; 11+ messages in thread
From: Antti Seppälä @ 2015-02-19 16:01 UTC (permalink / raw)
To: Antti Palosaari; +Cc: Benjamin Larsson, linux-media
On 19 February 2015 at 17:38, Antti Palosaari <crope@iki.fi> wrote:
>
>
> On 02/19/2015 12:21 PM, Antti Seppälä wrote:
>>
>> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se>
>> wrote:
>>>
>>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>>
>>>>
>>>> It seems that currently the firmware download on the mn88472 is
>>>> somehow wrong for my Astrometa HD-901T2.
>>>>
>>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>>> makes the firmware download consistently succeed.
>>>>
>>>
>>>
>>> Hi, try adding the workaround patch I sent for this.
>>>
>>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer
>>> errors
>>>
>>> I now see that it hasn't been merged. But I have been running with this
>>> patch for a few months now without any major issues.
>>>
>>
>> The patch really did improve firmware loading. Weird...
>>
>> Even with it I still get occasional i2c errors from r820t:
>>
>> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a len=1:
>> da
>> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>> len=4: 69 74 e6 df
>> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>> len=4: 69 74 e6 df
>>
>> These errors seem to appear more often if I'm reading the signal
>> strength values using e.g. femon.
>
>
> Could you disable whole IR polling and test
> modprobe dvb_usb_v2 disable_rc_polling=1
>
> It is funny that *increasing* RC polling makes things better, though...
>
Hi.
I tried loading the driver with polling disabled and it fails completely:
[ 5526.693563] mn88472 7-0018: downloading firmware from file
'dvb-demod-mn88472-02.fw'
[ 5527.032209] mn88472 7-0018: firmware download failed=-32
[ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
[ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1: 83
[ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
I have no idea why the device behaves so counter-intuitively. Is there
maybe some sorf of internal power-save mode the device enters when
there is no i2c traffic for a while or something?
-Antti
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 16:01 ` Antti Seppälä
@ 2015-02-19 16:14 ` Antti Palosaari
2015-02-19 16:25 ` Steven Toth
2015-02-19 18:42 ` Antti Seppälä
0 siblings, 2 replies; 11+ messages in thread
From: Antti Palosaari @ 2015-02-19 16:14 UTC (permalink / raw)
To: Antti Seppälä; +Cc: Benjamin Larsson, linux-media
On 02/19/2015 06:01 PM, Antti Seppälä wrote:
> On 19 February 2015 at 17:38, Antti Palosaari <crope@iki.fi> wrote:
>> On 02/19/2015 12:21 PM, Antti Seppälä wrote:
>>> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se>
>>> wrote:
>>>>
>>>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>>>
>>>>>
>>>>> It seems that currently the firmware download on the mn88472 is
>>>>> somehow wrong for my Astrometa HD-901T2.
>>>>>
>>>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>>>> makes the firmware download consistently succeed.
>>>>>
>>>>
>>>>
>>>> Hi, try adding the workaround patch I sent for this.
>>>>
>>>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer
>>>> errors
>>>>
>>>> I now see that it hasn't been merged. But I have been running with this
>>>> patch for a few months now without any major issues.
>>>>
>>>
>>> The patch really did improve firmware loading. Weird...
>>>
>>> Even with it I still get occasional i2c errors from r820t:
>>>
>>> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a len=1:
>>> da
>>> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>> len=4: 69 74 e6 df
>>> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>> len=4: 69 74 e6 df
>>>
>>> These errors seem to appear more often if I'm reading the signal
>>> strength values using e.g. femon.
>>
>>
>> Could you disable whole IR polling and test
>> modprobe dvb_usb_v2 disable_rc_polling=1
>>
>> It is funny that *increasing* RC polling makes things better, though...
>>
>
> Hi.
>
> I tried loading the driver with polling disabled and it fails completely:
>
> [ 5526.693563] mn88472 7-0018: downloading firmware from file
> 'dvb-demod-mn88472-02.fw'
> [ 5527.032209] mn88472 7-0018: firmware download failed=-32
> [ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
> [ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1: 83
> [ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
>
> I have no idea why the device behaves so counter-intuitively. Is there
> maybe some sorf of internal power-save mode the device enters when
> there is no i2c traffic for a while or something?
IR polling does not use I2C but some own commands. Could you make more
tests. Use rtl28xxu module parameter to disable IR and test. It will
disable both IR interrupts and polling. Then make some tests with
different IR polling intervals to see how it behaves.
I have 3 mn88472 and 1 mn88473 device and all those seems to work fine
for me. I don't care to buy anymore devices to find out one which does
not work. Somehow root of cause should be find - it is not proper fix to
repeat or break I2C messages to multiple smaller ones.
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 16:14 ` Antti Palosaari
@ 2015-02-19 16:25 ` Steven Toth
2015-02-19 16:44 ` Antti Palosaari
2015-02-19 18:42 ` Antti Seppälä
1 sibling, 1 reply; 11+ messages in thread
From: Steven Toth @ 2015-02-19 16:25 UTC (permalink / raw)
To: Antti Palosaari; +Cc: Antti Seppälä, Benjamin Larsson, Linux-Media
>> I tried loading the driver with polling disabled and it fails completely:
>>
>> [ 5526.693563] mn88472 7-0018: downloading firmware from file
>> 'dvb-demod-mn88472-02.fw'
>> [ 5527.032209] mn88472 7-0018: firmware download failed=-32
>> [ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
>> [ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1:
>> 83
>> [ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
>>
>> I have no idea why the device behaves so counter-intuitively. Is there
>> maybe some sorf of internal power-save mode the device enters when
>> there is no i2c traffic for a while or something?
>
>
> IR polling does not use I2C but some own commands. Could you make more
> tests. Use rtl28xxu module parameter to disable IR and test. It will disable
> both IR interrupts and polling. Then make some tests with different IR
> polling intervals to see how it behaves.
>
> I have 3 mn88472 and 1 mn88473 device and all those seems to work fine for
> me. I don't care to buy anymore devices to find out one which does not work.
> Somehow root of cause should be find - it is not proper fix to repeat or
> break I2C messages to multiple smaller ones.
Ack.
Its the job of the I2C controller to manage the I2C bus
implementation, including any fragmentation needs, not the
tuner/demod/other driver.
Find and fix the resource contention bug in the bridge and the mn88472
will work as is. I suspect something is broken with I2C locking.
--
Steven Toth - Kernel Labs
http://www.kernellabs.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 16:25 ` Steven Toth
@ 2015-02-19 16:44 ` Antti Palosaari
0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2015-02-19 16:44 UTC (permalink / raw)
To: Steven Toth; +Cc: Antti Seppälä, Benjamin Larsson, Linux-Media
On 02/19/2015 06:25 PM, Steven Toth wrote:
>>> I tried loading the driver with polling disabled and it fails completely:
>>>
>>> [ 5526.693563] mn88472 7-0018: downloading firmware from file
>>> 'dvb-demod-mn88472-02.fw'
>>> [ 5527.032209] mn88472 7-0018: firmware download failed=-32
>>> [ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
>>> [ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1:
>>> 83
>>> [ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
>>>
>>> I have no idea why the device behaves so counter-intuitively. Is there
>>> maybe some sorf of internal power-save mode the device enters when
>>> there is no i2c traffic for a while or something?
>>
>>
>> IR polling does not use I2C but some own commands. Could you make more
>> tests. Use rtl28xxu module parameter to disable IR and test. It will disable
>> both IR interrupts and polling. Then make some tests with different IR
>> polling intervals to see how it behaves.
>>
>> I have 3 mn88472 and 1 mn88473 device and all those seems to work fine for
>> me. I don't care to buy anymore devices to find out one which does not work.
>> Somehow root of cause should be find - it is not proper fix to repeat or
>> break I2C messages to multiple smaller ones.
>
> Ack.
>
> Its the job of the I2C controller to manage the I2C bus
> implementation, including any fragmentation needs, not the
> tuner/demod/other driver.
>
> Find and fix the resource contention bug in the bridge and the mn88472
> will work as is. I suspect something is broken with I2C locking.
It uses i2c control messages - single message per single operation.
You will need lock "control message" when it is done using multiple
messages, very typically two bulk message one for request and one for
reply - but that's not the case. Anyhow, it is possible firmware
rtl2832u firmware does not like some "large (larger than single
message)" operation is interrupted...
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 16:14 ` Antti Palosaari
2015-02-19 16:25 ` Steven Toth
@ 2015-02-19 18:42 ` Antti Seppälä
2015-02-19 20:32 ` Antti Palosaari
1 sibling, 1 reply; 11+ messages in thread
From: Antti Seppälä @ 2015-02-19 18:42 UTC (permalink / raw)
To: Antti Palosaari; +Cc: Benjamin Larsson, linux-media
On 19 February 2015 at 18:14, Antti Palosaari <crope@iki.fi> wrote:
> On 02/19/2015 06:01 PM, Antti Seppälä wrote:
>>
>> On 19 February 2015 at 17:38, Antti Palosaari <crope@iki.fi> wrote:
>>>
>>> On 02/19/2015 12:21 PM, Antti Seppälä wrote:
>>>>
>>>> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se>
>>>> wrote:
>>>>>
>>>>>
>>>>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> It seems that currently the firmware download on the mn88472 is
>>>>>> somehow wrong for my Astrometa HD-901T2.
>>>>>>
>>>>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>>>>> makes the firmware download consistently succeed.
>>>>>>
>>>>>
>>>>>
>>>>> Hi, try adding the workaround patch I sent for this.
>>>>>
>>>>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer
>>>>> errors
>>>>>
>>>>> I now see that it hasn't been merged. But I have been running with this
>>>>> patch for a few months now without any major issues.
>>>>>
>>>>
>>>> The patch really did improve firmware loading. Weird...
>>>>
>>>> Even with it I still get occasional i2c errors from r820t:
>>>>
>>>> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a
>>>> len=1:
>>>> da
>>>> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>>> len=4: 69 74 e6 df
>>>> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>>> len=4: 69 74 e6 df
>>>>
>>>> These errors seem to appear more often if I'm reading the signal
>>>> strength values using e.g. femon.
>>>
>>>
>>>
>>> Could you disable whole IR polling and test
>>> modprobe dvb_usb_v2 disable_rc_polling=1
>>>
>>> It is funny that *increasing* RC polling makes things better, though...
>>>
>>
>> Hi.
>>
>> I tried loading the driver with polling disabled and it fails completely:
>>
>> [ 5526.693563] mn88472 7-0018: downloading firmware from file
>> 'dvb-demod-mn88472-02.fw'
>> [ 5527.032209] mn88472 7-0018: firmware download failed=-32
>> [ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
>> [ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1:
>> 83
>> [ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
>>
>> I have no idea why the device behaves so counter-intuitively. Is there
>> maybe some sorf of internal power-save mode the device enters when
>> there is no i2c traffic for a while or something?
>
>
> IR polling does not use I2C but some own commands. Could you make more
> tests. Use rtl28xxu module parameter to disable IR and test. It will disable
> both IR interrupts and polling. Then make some tests with different IR
> polling intervals to see how it behaves.
>
Hi Antti.
I made some further tests for you. Here are the results:
dvb_usb_v2 disable_rc_polling=1: firmware download FAILED
dvb_usb_rtl28xxu disable_rc=1: firmware download FAILED
Then I restored the module parameters to default values and tested
with various rc->interval values:
interval = 800: firmware download FAILED
interval = 600: firmware download FAILED
interval = 400: firmware download FAILED
interval = 300: firmware download SUCCESS but I2C errors from tuner
could be sometimes observed
interval = 200: firmware download SUCCESS
interval = 100: firmware download SUCCESS
So somehow higher rc polling rate makes the firmware download succeed.
This could indeed be some locking/timing related bug.
Please let me know if there is something else I can test.
-Antti
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC PATCH] mn88472: reduce firmware download chunk size
2015-02-19 18:42 ` Antti Seppälä
@ 2015-02-19 20:32 ` Antti Palosaari
0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2015-02-19 20:32 UTC (permalink / raw)
To: Antti Seppälä; +Cc: Benjamin Larsson, linux-media
On 02/19/2015 08:42 PM, Antti Seppälä wrote:
> On 19 February 2015 at 18:14, Antti Palosaari <crope@iki.fi> wrote:
>> On 02/19/2015 06:01 PM, Antti Seppälä wrote:
>>>
>>> On 19 February 2015 at 17:38, Antti Palosaari <crope@iki.fi> wrote:
>>>>
>>>> On 02/19/2015 12:21 PM, Antti Seppälä wrote:
>>>>>
>>>>> On 19 February 2015 at 11:43, Benjamin Larsson <benjamin@southpole.se>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> On 2015-02-19 10:13, Antti Seppälä wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> It seems that currently the firmware download on the mn88472 is
>>>>>>> somehow wrong for my Astrometa HD-901T2.
>>>>>>>
>>>>>>> Reducing the download chunk size (mn88472_config.i2c_wr_max) to 2
>>>>>>> makes the firmware download consistently succeed.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi, try adding the workaround patch I sent for this.
>>>>>>
>>>>>> [PATCH 1/3] rtl28xxu: lower the rc poll time to mitigate i2c transfer
>>>>>> errors
>>>>>>
>>>>>> I now see that it hasn't been merged. But I have been running with this
>>>>>> patch for a few months now without any major issues.
>>>>>>
>>>>>
>>>>> The patch really did improve firmware loading. Weird...
>>>>>
>>>>> Even with it I still get occasional i2c errors from r820t:
>>>>>
>>>>> [ 15.874402] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=0a
>>>>> len=1:
>>>>> da
>>>>> [ 81.455517] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>>>> len=4: 69 74 e6 df
>>>>> [ 99.949702] r820t 8-003a: r820t_read: i2c rd failed=-32 reg=00
>>>>> len=4: 69 74 e6 df
>>>>>
>>>>> These errors seem to appear more often if I'm reading the signal
>>>>> strength values using e.g. femon.
>>>>
>>>>
>>>>
>>>> Could you disable whole IR polling and test
>>>> modprobe dvb_usb_v2 disable_rc_polling=1
>>>>
>>>> It is funny that *increasing* RC polling makes things better, though...
>>>>
>>>
>>> Hi.
>>>
>>> I tried loading the driver with polling disabled and it fails completely:
>>>
>>> [ 5526.693563] mn88472 7-0018: downloading firmware from file
>>> 'dvb-demod-mn88472-02.fw'
>>> [ 5527.032209] mn88472 7-0018: firmware download failed=-32
>>> [ 5527.033864] rtl2832 7-0010: i2c reg write failed -32
>>> [ 5527.033874] r820t 8-003a: r820t_write: i2c wr failed=-32 reg=05 len=1:
>>> 83
>>> [ 5527.036014] rtl2832 7-0010: i2c reg write failed -32
>>>
>>> I have no idea why the device behaves so counter-intuitively. Is there
>>> maybe some sorf of internal power-save mode the device enters when
>>> there is no i2c traffic for a while or something?
>>
>>
>> IR polling does not use I2C but some own commands. Could you make more
>> tests. Use rtl28xxu module parameter to disable IR and test. It will disable
>> both IR interrupts and polling. Then make some tests with different IR
>> polling intervals to see how it behaves.
>>
>
> Hi Antti.
>
> I made some further tests for you. Here are the results:
>
> dvb_usb_v2 disable_rc_polling=1: firmware download FAILED
>
> dvb_usb_rtl28xxu disable_rc=1: firmware download FAILED
>
> Then I restored the module parameters to default values and tested
> with various rc->interval values:
>
> interval = 800: firmware download FAILED
> interval = 600: firmware download FAILED
> interval = 400: firmware download FAILED
> interval = 300: firmware download SUCCESS but I2C errors from tuner
> could be sometimes observed
> interval = 200: firmware download SUCCESS
> interval = 100: firmware download SUCCESS
>
> So somehow higher rc polling rate makes the firmware download succeed.
> This could indeed be some locking/timing related bug.
>
> Please let me know if there is something else I can test.
Sure you could do. Play with I2C settings. Test few values to I2C bus
speed / clock is good start. Put oscilloscope to I2C bus and look what
there happens on error cases. There is also 2 different I2C commands,
test if there is any difference. And so. Increasing polling interval to
something between 250-300 does not sound very bad, though.
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-02-19 20:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-19 9:13 [RFC PATCH] mn88472: reduce firmware download chunk size Antti Seppälä
2015-02-19 9:43 ` Benjamin Larsson
2015-02-19 10:21 ` Antti Seppälä
2015-02-19 11:53 ` Benjamin Larsson
2015-02-19 15:38 ` Antti Palosaari
2015-02-19 16:01 ` Antti Seppälä
2015-02-19 16:14 ` Antti Palosaari
2015-02-19 16:25 ` Steven Toth
2015-02-19 16:44 ` Antti Palosaari
2015-02-19 18:42 ` Antti Seppälä
2015-02-19 20:32 ` Antti Palosaari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).