Re: [PATCH] [media] rc: do not sleep when the driver blocks on IR completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 25, 2012 at 12:05:18AM +0200, David Härdeman wrote:
> On Thu, Aug 23, 2012 at 10:18:35PM +0100, Sean Young wrote:
> >Some drivers wait for the IR device to complete sending before
> >returning, so sleeping should not be done.
> 
> I'm not quite sure what the purpose is. Even if a driver waits for TX to
> finish, the lirc imposed sleep isn't harmful in any way.

Due to rounding errors, clock skew and different start times, the sleep 
might be waiting for a different amount of time than the hardware took 
to send it. The sleep is a bit of a kludge, let alone if the driver
can wait for the hardware to tell you when it's done.

Also, your change calculates the amount of us to sleep after transmission, 
so if the transmission buffer was modified by the driver, the calculated 
sleep might not make sense. Both winbond-cir and iguanair do this.

> As far as I can tell, the iguanair driver waits for the usb packet to be
> submitted, not for IR TX to finish.

The iguanair driver waits for the ack from the device (which is an urb
you receive from the device), which is sent once the IR has been 
transmitted. The firmware source code is available.

> As for winbond-cir, it would be simple enough to change it so that it
> doesn't wait for TX to finish (which seems to be a better solution).
>
> Having the TX methods as asynchronous as possible is probably a better
> way to go...as I expect a future TX API to be asynchronous.

I agree that a future TX API should be asynchronous and I like your
ideas around that; however that won't be ready for v3.7.


Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux