* [PATCH 07/24] xc5000: properly report i2c write failures
2012-08-07 2:46 [PATCH 00/24] Various HVR-950q and xc5000 fixes Devin Heitmueller
@ 2012-08-07 2:46 ` Devin Heitmueller
[not found] ` <CAPLVkLv6JNvSdSFCY7YNRkmfzHv5+JD7Y5hxvjxdFtRT2JgE2A@mail.gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Devin Heitmueller @ 2012-08-07 2:46 UTC (permalink / raw)
To: linux-media; +Cc: Devin Heitmueller
The logic as written would *never* actually return an error condition, since
the loop would run until the counter hit zero but the check was for a value
less than zero.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
---
drivers/media/common/tuners/xc5000.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index f660e33..a7fa17e 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -341,7 +341,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
}
}
}
- if (WatchDogTimer < 0)
+ if (WatchDogTimer <= 0)
result = XC_RESULT_I2C_WRITE_FAILURE;
return result;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 07/24] xc5000: properly report i2c write failures
@ 2014-02-07 8:59 Joonyoung Shim
0 siblings, 0 replies; 5+ messages in thread
From: Joonyoung Shim @ 2014-02-07 8:59 UTC (permalink / raw)
To: dheitmueller, linux-media@vger.kernel.org
Hi,
Sorry for response about the past post.
> The logic as written would *never* actually return an error condition, since
> the loop would run until the counter hit zero but the check was for a value
> less than zero.
>
> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
> ---
> drivers/media/common/tuners/xc5000.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
> index f660e33..a7fa17e 100644
> --- a/drivers/media/common/tuners/xc5000.c
> +++ b/drivers/media/common/tuners/xc5000.c
> @@ -341,7 +341,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
> }
> }
> }
> - if (WatchDogTimer < 0)
> + if (WatchDogTimer <= 0)
I can't load firmware like error of below link.
https://bugs.launchpad.net/ubuntu/+source/linux-firmware-nonfree/+bug/1263837
<https://bugs.launchpad.net/ubuntu/+source/linux-firmware-nonfree/+bug/1263837>
This error is related with this patch. This fix is right but above error
is created after this fix
because my device makes WatchDogTimer to 0 when load firmware.
Maybe it will be related with XREG_BUSY register but i can't check it.
I removed this fix, but i have faced at other error with "xc5000: PLL
not running after fwload"
So i have commented like below.
static const struct xc5000_fw_cfg xc5000a_1_6_114 = {
.name = XC5000A_FIRMWARE,
.size = 12401,
//.pll_reg = 0x806c,
};
Then, xc5000 device works well.
I don't have xc5000 datasheet so i can't debug xc5000 driver anymore.
Any help?
Thanks.
> result = XC_RESULT_I2C_WRITE_FAILURE;
>
> return result;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 07/24] xc5000: properly report i2c write failures
[not found] ` <CAPLVkLv6JNvSdSFCY7YNRkmfzHv5+JD7Y5hxvjxdFtRT2JgE2A@mail.gmail.com>
@ 2014-02-07 13:46 ` Devin Heitmueller
2014-02-10 8:25 ` Joonyoung Shim
0 siblings, 1 reply; 5+ messages in thread
From: Devin Heitmueller @ 2014-02-07 13:46 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: Linux Media Mailing List
> I can't load firmware like error of below link.
>
> https://bugs.launchpad.net/ubuntu/+source/linux-firmware-nonfree/+bug/1263837
>
> This error is related with this patch. This fix is right but above error is
> created after this fix
> because my device makes WatchDogTimer to 0 when load firmware.
> Maybe it will be related with XREG_BUSY register but i can't check it.
>
> I removed this fix, but i have faced at other error with "xc5000: PLL not
> running after fwload"
> So i have commented like below.
>
> static const struct xc5000_fw_cfg xc5000a_1_6_114 = {
> .name = XC5000A_FIRMWARE,
> .size = 12401,
> //.pll_reg = 0x806c,
> };
>
> Then, xc5000 device works well.
>
> I don't have xc5000 datasheet so i can't debug xc5000 driver anymore.
Hi Joonyoung,
Assuming this is the DViCO FusionHDTV7 device that uses the
au0828/au8522, I suspect that what's happening here is your I2C
controller is not stable. The I2C clock stretching done by the xc5000
often exposed bugs in various bridge drivers and the au0828 was no
exception. I had to work around these hardware bugs in the au0828
driver but I made them specific to the HVR-950q since that was the
only device I could test with.
In other words, the xc5000 is most likely doing exactly what it is
supposed to, and the increased robustness of the tuner driver with
those two patches exposed intermittent I2C failures in au0828 that
were previously being silently discarded (resulting in indeterminate
behavior).
I would recommending looking at the changes in au0828-cards.c for the
HVR-950q and add the code necessary to make them also apply for the
DVICO device, and that should resolve your problems (in particular the
i2c_clk_divider field should be set).
Devin
--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 07/24] xc5000: properly report i2c write failures
2014-02-07 13:46 ` Devin Heitmueller
@ 2014-02-10 8:25 ` Joonyoung Shim
2014-02-10 13:29 ` Devin Heitmueller
0 siblings, 1 reply; 5+ messages in thread
From: Joonyoung Shim @ 2014-02-10 8:25 UTC (permalink / raw)
To: Devin Heitmueller; +Cc: Linux Media Mailing List
Hi Devin,
2014-02-07 22:46 GMT+09:00 Devin Heitmueller <dheitmueller@kernellabs.com>:
>
> > I can't load firmware like error of below link.
> >
> > https://bugs.launchpad.net/ubuntu/+source/linux-firmware-nonfree/+bug/1263837
> >
> > This error is related with this patch. This fix is right but above error is
> > created after this fix
> > because my device makes WatchDogTimer to 0 when load firmware.
> > Maybe it will be related with XREG_BUSY register but i can't check it.
> >
> > I removed this fix, but i have faced at other error with "xc5000: PLL not
> > running after fwload"
> > So i have commented like below.
> >
> > static const struct xc5000_fw_cfg xc5000a_1_6_114 = {
> > .name = XC5000A_FIRMWARE,
> > .size = 12401,
> > //.pll_reg = 0x806c,
> > };
> >
> > Then, xc5000 device works well.
> >
> > I don't have xc5000 datasheet so i can't debug xc5000 driver anymore.
>
> Hi Joonyoung,
>
> Assuming this is the DViCO FusionHDTV7 device that uses the
> au0828/au8522, I suspect that what's happening here is your I2C
> controller is not stable. The I2C clock stretching done by the xc5000
> often exposed bugs in various bridge drivers and the au0828 was no
> exception. I had to work around these hardware bugs in the au0828
> driver but I made them specific to the HVR-950q since that was the
> only device I could test with.
>
> In other words, the xc5000 is most likely doing exactly what it is
> supposed to, and the increased robustness of the tuner driver with
> those two patches exposed intermittent I2C failures in au0828 that
> were previously being silently discarded (resulting in indeterminate
> behavior).
>
> I would recommending looking at the changes in au0828-cards.c for the
> HVR-950q and add the code necessary to make them also apply for the
> DVICO device, and that should resolve your problems (in particular the
> i2c_clk_divider field should be set).
>
As you said, i modified like below patch and it is working well.
Thanks for your advice.
diff --git a/drivers/media/usb/au0828/au0828-cards.c
b/drivers/media/usb/au0828/au0828-cards.c
index 0cb7c28..9936875 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -108,7 +108,7 @@ struct au0828_board au0828_boards[] = {
.name = "DViCO FusionHDTV USB",
.tuner_type = UNSET,
.tuner_addr = ADDR_UNSET,
- .i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
+ .i2c_clk_divider = AU0828_I2C_CLK_20KHZ,
},
[AU0828_BOARD_HAUPPAUGE_WOODBURY] = {
.name = "Hauppauge Woodbury",
- Joonyoung Shim
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 07/24] xc5000: properly report i2c write failures
2014-02-10 8:25 ` Joonyoung Shim
@ 2014-02-10 13:29 ` Devin Heitmueller
0 siblings, 0 replies; 5+ messages in thread
From: Devin Heitmueller @ 2014-02-10 13:29 UTC (permalink / raw)
To: Joonyoung Shim; +Cc: Linux Media Mailing List
On Mon, Feb 10, 2014 at 3:25 AM, Joonyoung Shim <dofmind@gmail.com> wrote:
> As you said, i modified like below patch and it is working well.
>
> Thanks for your advice.
>
> diff --git a/drivers/media/usb/au0828/au0828-cards.c
> b/drivers/media/usb/au0828/au0828-cards.c
> index 0cb7c28..9936875 100644
> --- a/drivers/media/usb/au0828/au0828-cards.c
> +++ b/drivers/media/usb/au0828/au0828-cards.c
> @@ -108,7 +108,7 @@ struct au0828_board au0828_boards[] = {
> .name = "DViCO FusionHDTV USB",
> .tuner_type = UNSET,
> .tuner_addr = ADDR_UNSET,
> - .i2c_clk_divider = AU0828_I2C_CLK_250KHZ,
> + .i2c_clk_divider = AU0828_I2C_CLK_20KHZ,
> },
> [AU0828_BOARD_HAUPPAUGE_WOODBURY] = {
> .name = "Hauppauge Woodbury",
Great. Feel free to submit a patch to the mailing list with your SOB,
and we'll merge that change upstream.
Devin
--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-10 13:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-07 8:59 [PATCH 07/24] xc5000: properly report i2c write failures Joonyoung Shim
-- strict thread matches above, loose matches on Subject: below --
2012-08-07 2:46 [PATCH 00/24] Various HVR-950q and xc5000 fixes Devin Heitmueller
2012-08-07 2:46 ` [PATCH 07/24] xc5000: properly report i2c write failures Devin Heitmueller
[not found] ` <CAPLVkLv6JNvSdSFCY7YNRkmfzHv5+JD7Y5hxvjxdFtRT2JgE2A@mail.gmail.com>
2014-02-07 13:46 ` Devin Heitmueller
2014-02-10 8:25 ` Joonyoung Shim
2014-02-10 13:29 ` Devin Heitmueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox