From: Mika Westerberg <mika.westerberg@intel.com>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Archana Patni <archana.patni@linux.intel.com>,
Jiri Kosina <jkosina@suse.cz>,
linux-input <linux-input@vger.kernel.org>,
"Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
Archana Patni <archana.patni@intel.com>,
Subramony Sesha <subramony.sesha@intel.com>
Subject: Re: [PATCH] HID: i2c-hid: Support batch read of input events from fifo
Date: Fri, 9 May 2014 10:23:30 +0300 [thread overview]
Message-ID: <20140509072330.GN3722@lahna.fi.intel.com> (raw)
In-Reply-To: <CAN+gG=GsnnkF0T_HQe-g2WX0V2GdTKKGytSU4rZF_RAwKtWCKA@mail.gmail.com>
On Thu, May 08, 2014 at 05:34:49PM -0400, Benjamin Tissoires wrote:
> On Thu, May 8, 2014 at 2:10 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> >
> >
> > On May 8, 2014 3:28:23 PM GMT+01:00, Benjamin Tissoires <benjamin.tissoires@gmail.com> wrote:
> >>On Thu, May 8, 2014 at 9:32 AM, Archana Patni
> >><archana.patni@linux.intel.com> wrote:
> >>> Some i2c_hid devices like a sensor hub have built-in fifos which
> >>> can accumulate input events in their buffers and trigger an interrupt
> >>> at end of a user defined event like fifo full or a timeout. The
> >>current
> >>> implementation reads one event at a time in the IRQ handler leading
> >>to
> >>> several hundred interrupts being necessary to flush the fifo.
> >>>
> >>> This patch changes the threaded IRQ handler to keep input events
> >>until
> >>> there are no input events left to read. In the normal case, this will
> >>> invoke one additional call to fetch an input event to check for no
> >>pending
> >>> events and terminate the loop.
> >>
> >>I must say, I don't like this patch.
> >>It seems to me that it will solve your problem but will break other
> >>devices. Nothing in the spec says what happens if the host tries to
> >>read while the interrupt line is *not* asserted. I can easily imagine
> >>several scenarios where the device would hang until the next available
> >>data, or will just fail.
> >>
> >>So the proper way according to the spec is to check the status of the
> >>interrupt line. This line is the responsibility of the device to be
> >>asserted and we should rely on it to know if we can read again.
> >>
> >>However, a quick check on the interrupt API did not provide me the
> >>function I would like, so I guess this is something to be work on.
> > In general it is not possible to check the interrupt state. Some interrupt devices
> > simply don't provide any means of reading it. Generally a hybrid of a gpio and an
> > interrupt is needed to do this. They don't technically need to be on the same pin
> > though they often are...
>
> OK, that's what I was afraid of. :(
>
> Mika, you mentioned in the early tests that you had some devices not
> using GPIOs but ACPI IRQ. Are the latest ones still following this?
Yes.
Typically it is always GPIO line but you can route it directly to ioapic
with some magic done by BIOS.
> Would it be costly to export the gpio alongside the irq for the
> devices not using a generic interrupt but a GPIO?
We have systems where you can select from BIOS menu whether GPIO or IRQ
resource is passed. However, looks like vendors are passing IRQ only
(just checked Asus T100 and there is no GPIO option at all).
> If the gpio can be exported, then we can rely on it to get the other
> events.
Ideally, you would only have GPIO entry in the table and you could use
it as both a GPIO and an IRQ.
next prev parent reply other threads:[~2014-05-09 7:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 13:32 [PATCH] HID: i2c-hid: Support batch read of input events from fifo Archana Patni
2014-05-08 14:28 ` Benjamin Tissoires
2014-05-08 18:10 ` Jonathan Cameron
2014-05-08 21:34 ` Benjamin Tissoires
2014-05-09 7:23 ` Mika Westerberg [this message]
2014-05-10 18:48 ` Srinivas Pandruvada
2014-05-12 16:03 ` Benjamin Tissoires
[not found] ` <5370FDA9.90309@linux.intel.com>
2014-05-14 11:04 ` archana.patni
2014-05-14 13:43 ` Benjamin Tissoires
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=20140509072330.GN3722@lahna.fi.intel.com \
--to=mika.westerberg@intel.com \
--cc=archana.patni@intel.com \
--cc=archana.patni@linux.intel.com \
--cc=benjamin.tissoires@gmail.com \
--cc=jic23@kernel.org \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=srinivas.pandruvada@intel.com \
--cc=subramony.sesha@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.