From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753787AbcEYItu (ORCPT ); Wed, 25 May 2016 04:49:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:38371 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752454AbcEYItr (ORCPT ); Wed, 25 May 2016 04:49:47 -0400 Message-ID: <1464165972.2132.5.camel@suse.com> Subject: Re: [PATCH v4] input: tablet: add Pegasus Notetaker tablet driver From: Oliver Neukum To: Martin Kepplinger Cc: dmitry.torokhov@gmail.com, kernel-testers@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Wed, 25 May 2016 10:46:12 +0200 In-Reply-To: <1464162274-18424-1-git-send-email-martink@posteo.de> References: <1464162274-18424-1-git-send-email-martink@posteo.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-05-25 at 09:44 +0200, Martin Kepplinger wrote: > This adds a driver for the Pegasus Notetaker Pen. When connected, > this uses the Pen as an input tablet. > > This device was sold in various different brandings, for example > "Pegasus Mobile Notetaker M210", > "Genie e-note The Notetaker", > "Staedtler Digital ballpoint pen 990 01", > "IRISnotes Express" or > "NEWLink Digital Note Taker". > > Here's an example, so that you know what we are talking about: > http://www.staedtler.com/en/products/ink-writing-instruments/ballpoint-pens/digital-pen-990-01-digital-ballpoint-pen > > http://pegatech.blogspot.com/ seems to be a remaining official resource. > > This device can also transfer saved (offline recorded handwritten) data and > there are userspace programs that do this, see https://launchpad.net/m210 > (Well, alternatively there are really fast scanners out there :) > > It's *really* fun to use as an input tablet though! So let's support this > for everybody. > > There's no way to disable the device. When the pen is out of range, we just > don't get any URBs and don't do anything. > Like all other mouses or input tablets, we don't use runtime PM. > > Signed-off-by: Martin Kepplinger > --- > > Thanks for having a look. Any more suggestions on this? > > revision history > ================ > v4 use normal work queue instead of a kernel thread (thanks to Oliver Neukum) > v3 fix reporting low pen battery and add USB list to CC > v2 minor cleanup (remove unnecessary variables) > v1 initial release > Hi, almost there. Regards Oliver > +static void pegasus_close(struct input_dev *dev) > +{ > + struct pegasus *pegasus = input_get_drvdata(dev); > + > + cancel_work_sync(&pegasus->init); > + > + usb_kill_urb(pegasus->irq); > +} This is a race condition. The URB can trigger the work. Therefore the URB needs to die first.