From: Jarod Wilson <jarod@redhat.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/9] [media] mceusb: give hardware time to reply to cmds
Date: Mon, 18 Jul 2011 13:47:08 -0400 [thread overview]
Message-ID: <4E24719C.8040809@redhat.com> (raw)
In-Reply-To: <4E1F7C11.1050608@redhat.com>
Mauro Carvalho Chehab wrote:
> Em 14-07-2011 19:09, Jarod Wilson escreveu:
>> Sometimes the init routine is blasting commands out to the hardware
>> faster than it can reply. Throw a brief delay in there to give the
>> hardware a chance to reply before we send the next command.
>>
>> Signed-off-by: Jarod Wilson<jarod@redhat.com>
>> ---
>> drivers/media/rc/mceusb.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
>> index 111bead..13a853b 100644
>> --- a/drivers/media/rc/mceusb.c
>> +++ b/drivers/media/rc/mceusb.c
>> @@ -37,6 +37,7 @@
>> #include<linux/slab.h>
>> #include<linux/usb.h>
>> #include<linux/usb/input.h>
>> +#include<linux/delay.h>
>> #include<media/rc-core.h>
>>
>> #define DRIVER_VERSION "1.91"
>> @@ -735,6 +736,7 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data,
>> static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size)
>> {
>> mce_request_packet(ir, data, size, MCEUSB_TX);
>> + mdelay(10);
>
> Can't it be a msleep() instead? Delays spend more power, and keeps the CPU busy while
> running.
I think I was thinking we'd end up sleeping in an interrupt handler when
we shouldn't be, but upon closer code inspection and actual testing,
that's not the case, so yeah, those can be msleeps. While testing all
code paths, I also discovered that patch 6 in the series breaks lirc tx
support (the lirc dev is registered before the tx function pointers are
filled in), so I'll resend at least patches 2 and 6...
--
Jarod Wilson
jarod@redhat.com
next prev parent reply other threads:[~2011-07-18 17:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 22:09 [PATCH 0/9] mceusb updates per MS docs Jarod Wilson
2011-07-14 22:09 ` [PATCH 1/9] [media] mceusb: command/response updates from " Jarod Wilson
2011-07-14 22:09 ` [PATCH 2/9] [media] mceusb: give hardware time to reply to cmds Jarod Wilson
2011-07-14 23:30 ` Mauro Carvalho Chehab
2011-07-18 17:47 ` Jarod Wilson [this message]
2011-07-18 18:11 ` Jarod Wilson
2011-07-14 22:09 ` [PATCH 3/9] [media] mceusb: set wakeup bits for IR-based resume Jarod Wilson
2011-07-14 22:09 ` [PATCH 4/9] [media] mceusb: issue device resume cmd when needed Jarod Wilson
2011-07-14 22:09 ` [PATCH 5/9] [media] mceusb: query device for firmware emulator version Jarod Wilson
2011-07-14 22:09 ` [PATCH 6/9] [media] mceusb: get misc port data from hardware Jarod Wilson
2011-07-14 22:09 ` [PATCH 7/9] [media] mceusb: flash LED (emu v2+ only) to signal end of init Jarod Wilson
2011-07-14 22:09 ` [PATCH 8/9] [media] mceusb: report actual tx frequencies Jarod Wilson
2011-07-14 22:09 ` [PATCH 9/9] [media] mceusb: update version, copyright, author Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 0/9] mceusb updates per MS docs Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 1/9] [media] mceusb: command/response updates from " Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 2/9] [media] mceusb: give hardware time to reply to cmds Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 3/9] [media] mceusb: set wakeup bits for IR-based resume Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 4/9] [media] mceusb: issue device resume cmd when needed Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 5/9] [media] mceusb: query device for firmware emulator version Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 6/9] [media] mceusb: get misc port data from hardware Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 7/9] [media] mceusb: flash LED (emu v2+ only) to signal end of init Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 8/9] [media] mceusb: report actual tx frequencies Jarod Wilson
2011-07-18 19:54 ` [PATCH v2 9/9] [media] mceusb: update version, copyright, author Jarod Wilson
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=4E24719C.8040809@redhat.com \
--to=jarod@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.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