On Sun, Feb 13, 2011 at 9:21 PM, Peter Hutterer <peter.hutte...@who-t.net>wrote:

> > > > -             /* for all other errors, hope that the hotplugging code
> > > will
> > > > -              * remove the device */
> > > > -             if (errno != EAGAIN && errno != EINTR)
> > > > -                     xf86Msg(X_ERROR, "%s: Error reading wacom
> device :
> > > %s\n", pInfo->name, strerror(errno));
> > > > +             if (errno != EAGAIN && errno != EINTR)
> > > > +                     /* The hotplugging code will remove the device
> */
> > > > +                     DBG(1, priv, "Error reading wacom device :
> > > %s(%d)\n",
> > > > +                             strerror(errno), errno);
> > > > +             else
> > > > +                     /* We'll read it again */
> > > > +                     DBG(10, priv, "Reading wacom device
> interrupted:
> > > %s(%d)\n",
> > > > +                             strerror(errno), errno);
> > >
> > > this would absolutely swamp the log, wouldn't it? iirc we run until we
> get
> > > EAGAIN each time we run the event loop so we'd get log messages on
> nearly
> > > every event here.
> > >
> >
> > We do not get to EAGAIN or EINTR during normal read. I don't know why.
>
> On USB devices, that doesn't suprise me (we check if there is data
> available
> and then read). since the kernel guarantees struct input_event size data
> when data is available, we don't hit EAGAIN. Have you tried this on a
> serial
> device though?
>

No, we do not support regular serial devices any more. Serial ISDV4 is
Tablet PC. The tablet is built-in (always connected to) the system.

> Do you mean:
> >
> > -----------
> > static int warn_once = 0;
> >
> > if (!warn_once)
> >   xf86Msg(X_ERROR, ...);
> > else
> >   DBG(...);
> >
> > warn_once = 1;
> > -------------
>
> whoops, yes, of course. though the warn_once = 1 should be in the else
> block.
>

And a local "static int" can not do the trick. With a local variable, we
assumed there is only one tablet connected to the system. That is not always
true. We need a "common->wcmWarnOnce". So, we need to reset the wcmWarnOnce
when the device is removed.

Any comments about the "race condition - crash" patch before this one?

Ping
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to