mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Trilok Soni <soni.trilok@gmail.com>
Cc: Daniel Ribeiro <drwyrm@gmail.com>,
	linux-input@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	openezx-devel <openezx-devel@lists.openezx.org>,
	Harald Welte <laforge@gnumonks.org>,
	Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH] PCAP touchscreen driver (for 2.6.32)
Date: Sun, 28 Jun 2009 23:19:55 -0700	[thread overview]
Message-ID: <20090629061955.GE12821@dtor-d630.eng.vmware.com> (raw)
In-Reply-To: <5d5443650906280015x4bddefa5v9dd36f888c5f2e92@mail.gmail.com>

On Sun, Jun 28, 2009 at 12:45:17PM +0530, Trilok Soni wrote:
> Hi Daniel,
> 
> 2009/6/27 Daniel Ribeiro <drwyrm@gmail.com>:
> > +
> > +       err = request_irq(pcap_to_irq(pcap_ts->pcap, PCAP_IRQ_TS),
> > +                       pcap_ts_event_touch, 0, "Touch Screen", pcap_ts);
> > +       if (err)
> > +               goto fail;
> > +
> > +       err = input_register_device(pcap_ts->input);
> > +       if (err)
> > +               goto fail_touch;
> 
> Please move request_irq after input_register_device, as IRQ can get
> fired before input device gets available, right?
> 

Actually it is OK to have IRQs fired before the device is registered.
Input core guarantees that input device allocated with
input_allocate_device() will survive if events are sent through it. The
events will not be delivered anywhere, for obvious reason, but
everything else should be fine. In fact, if device has an event()
handler then it has to be fully operational (that includes IRQ reserved
and ready, unless the driver implements open/close methods) before
calling input_register_device - the handlers that will attach to the
device have every right to start sending events back to the device right
away and expect them to be handled properly.

-- 
Dmitry

  parent reply	other threads:[~2009-06-29  6:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-27 17:02 Daniel Ribeiro
2009-06-28  7:15 ` Trilok Soni
2009-06-28 17:49   ` Daniel Ribeiro
2009-06-29  6:19   ` Dmitry Torokhov [this message]
2009-06-28 14:35 ` Antonio Ospite
2009-06-28 17:45   ` Daniel Ribeiro
2009-06-29  6:29 ` Dmitry Torokhov

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=20090629061955.GE12821@dtor-d630.eng.vmware.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=drwyrm@gmail.com \
    --cc=laforge@gnumonks.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openezx-devel@lists.openezx.org \
    --cc=sameo@linux.intel.com \
    --cc=soni.trilok@gmail.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

Powered by JetHome