All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Malcolm Priestley <tvboxspy@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/7] af9015 Slow down download firmware
Date: Sat, 12 Nov 2011 20:48:20 +0200	[thread overview]
Message-ID: <4EBEBF74.2030008@iki.fi> (raw)
In-Reply-To: <4ebeb688.aa6db40a.5f99.ffffb173@mx.google.com>

On 11/12/2011 08:10 PM, Malcolm Priestley wrote:
> On Sat, 2011-11-12 at 18:14 +0200, Antti Palosaari wrote:
>> On 11/12/2011 05:54 PM, Malcolm Priestley wrote:
>>> It is noticed that sometimes the device fails to download parts of the firmware.
>>>
>>> Since there is no ack from firmware write a 250u second delay has been added.
>>>
>>> Signed-off-by: Malcolm Priestley<tvboxspy@gmail.com>
>>> ---
>>>    drivers/media/dvb/dvb-usb/af9015.c |    1 +
>>>    1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
>>> index c6c275b..dc6e4ec 100644
>>> --- a/drivers/media/dvb/dvb-usb/af9015.c
>>> +++ b/drivers/media/dvb/dvb-usb/af9015.c
>>> @@ -698,6 +698,7 @@ static int af9015_download_firmware(struct usb_device *udev,
>>>    			err("firmware download failed:%d", ret);
>>>    			goto error;
>>>    		}
>>> +		udelay(250);
>>>    	}
>>>
>>>    	/* firmware loaded, request boot */
>>
>> That sleep is not critical as all, so defining it as udelay() is wrong
>> in my understanding. Refer Kernel documentation about delays.
>
> So we just go faster and faster, without acknowledgements and  due
> respect for the hardware?
>
> Typical download time is about 100ms, download on some systems was less
> than 50ms and failing.
>
> A 250uS wait brought the time back up to arround 100ms.

I said you should not use udelay() since that sleep is not critical. 
udelay() have bad effect in system level. You didn't looked 
documentation as I asked, here it is: 
Documentation/timers/timers-howto.txt . I think usleep_range() is 
correct function.

Antti


-- 
http://palosaari.fi/

      reply	other threads:[~2011-11-12 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-12 15:54 [PATCH 1/7] af9015 Slow down download firmware Malcolm Priestley
2011-11-12 16:14 ` Antti Palosaari
2011-11-12 18:10   ` Malcolm Priestley
2011-11-12 18:48     ` Antti Palosaari [this message]

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=4EBEBF74.2030008@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=tvboxspy@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.