On 24/03/07, Pete Zaitcev <[EMAIL PROTECTED]> wrote:
> On Sat, 24 Mar 2007 17:23:55 +0100, René van Paassen <[EMAIL PROTECTED]> 
> wrote:
>
> > I will change the del_timer to del_timer_sync, to remove the race where
> > the timer´s activity is running while the timer is being removed.
> >
> > Does that sound reasonable?
>
> Yes, it's a good idea, however this is not quite what I was concerned
> about. For a timer, it's possible to run on one CPU while a URB callback
> is being delivered on another CPU. Even if Dmitry does everything
> right and provides a perfect exclusion inside input_report(), you still
> may end with input events interleaving without some kind of exclusion
> in the driver. This is why I asked if aiptek can call input_report_abs()
> with interrupts closed (which happens if you bracket them with
> spin_lock_irqsave() in your timer routine).

Ah, but with the rest of my story I was trying to convey the idea that
the timer activity does NOT run in parallel with the input thread.
After entry of aiptek_irq, the timer is deleted, *before* any
input_report_* calls. Then the data from the tablet is processed,
leading to input_report_* calls, but the timer routine is *not*
running at this time. Only after that the timer is started again.

So, unless I have got the wrong model here, input_report_* calls from
timer and aiptek_irq cannot occur in parallel anyhow, and a spin lock
is not needed.

René

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to