From: Antti Palosaari <crope@iki.fi>
To: "Rémi Cardona" <remi.cardona@smartjog.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/2] [media] ds3000: properly report firmware loading issues
Date: Thu, 30 Aug 2012 16:39:36 +0300 [thread overview]
Message-ID: <503F6D18.2060804@iki.fi> (raw)
In-Reply-To: <1346319391-19015-3-git-send-email-remi.cardona@smartjog.com>
On 08/30/2012 12:36 PM, Rémi Cardona wrote:
> ds3000_readreg() returns negative values in case of i2c failures. The
> old code would simply return 0 when failing to read the 0xb2 register,
> misleading ds3000_initfe() into believing that the firmware had been
> correctly loaded.
>
> Signed-off-by: Rémi Cardona <remi.cardona@smartjog.com>
> ---
> drivers/media/dvb/frontends/ds3000.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
> index 066870a..4c774c4 100644
> --- a/drivers/media/dvb/frontends/ds3000.c
> +++ b/drivers/media/dvb/frontends/ds3000.c
> @@ -391,8 +391,14 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
>
> dprintk("%s()\n", __func__);
>
> - if (ds3000_readreg(state, 0xb2) <= 0)
> + ret = ds3000_readreg(state, 0xb2);
> + if (ret == 0) {
> + printk(KERN_INFO "%s: Firmware already uploaded, skipping\n",
> + __func__);
> return ret;
> + } else if (ret < 0) {
> + return ret;
> + }
>
> /* Load firmware */
> /* request the firmware, this will block until someone uploads it */
>
As I understand firmware downloading failure is coming from the fact
that register read fails => fails to detect if firmware is already
running or not.
Original behavior to expect firmware is loaded and running when register
read fails is very stupid and your fix seems much better.
So first priority should be try fix that issue with register read. Is it
coming from the USB stack (eg. error 110 timeout) or some other error
coming from the fact chip answers wrong?
Do you see other register I/O failing too?
Does adding few usec sleep help?
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2012-08-30 13:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 9:36 [PATCH RFC 0/2] ds3000 firmware loading improvements Rémi Cardona
2012-08-30 9:36 ` [PATCH 1/2] [media] ds3000: Remove useless 'locking' Rémi Cardona
2012-09-03 14:13 ` Rémi Cardona
2012-08-30 9:36 ` [PATCH 2/2] [media] ds3000: properly report firmware loading issues Rémi Cardona
2012-08-30 13:39 ` Antti Palosaari [this message]
2012-08-30 15:21 ` Rémi Cardona
2012-08-30 16:00 ` Antti Palosaari
2012-09-03 13:27 ` Rémi Cardona
2012-08-31 8:29 ` Re: [PATCH 2/2] [media] ds3000: properly report firmware loadingissues nibble.max
2012-09-03 14:11 ` Rémi Cardona
2012-09-04 2:19 ` nibble.max
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=503F6D18.2060804@iki.fi \
--to=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
--cc=remi.cardona@smartjog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).