From: Jonathan Woithe <jwoithe@just42.net>
To: Darren Hart <dvhart@infradead.org>
Cc: Micha?? K??pie?? <kernel@kempniu.pl>,
Rafael Wysocki <rjw@rjwysocki.net>,
Andy Shevchenko <andy@infradead.org>,
platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes
Date: Thu, 22 Jun 2017 12:31:21 +0930 [thread overview]
Message-ID: <20170622030120.GF32131@marvin.atrad.com.au> (raw)
In-Reply-To: <20170622024413.GE25900@fury>
Hi Darren
On Wed, Jun 21, 2017 at 07:44:13PM -0700, Darren Hart wrote:
> > I think the buffer size could probably be reduced a little without impacting
> > on functionality. I suspect the value was chosen so as to be well above the
> > number of events which could be generated ahead of a button release (which
> > effectively releases all buttons held at that stage). The number of hot
> > keys is limited (I don't think any model has more than 5), so reducing the
> > buffer somewhat appears safe (perhaps to 32 if there were any advantages to
> > having the size be a power of two). There seems little point doing this in
> > the name of memory saving since the amount saved is trivially small.
>
> It's not a problem as far as I'm concerned. Plenty more lower hanging
> fruit if people want to reduce memory footprint.
Indeed. I'm happy to leave it at 40.
> > I've given some more thought to the following point (from the original patch
> > submission):
> > > In order to simplify implementation, hotkey input device behavior is
> > > slightly changed (from FIFO to LIFO). The order of release events
> > > generated by the input device should not matter from end user
> > > perspective as upon releasing any hotkey the firmware only produces a
> > > single event which means "all hotkeys were released".
> >
> > This will effectively alter the order the button events are seen by
> > userspace though, won't it? It would mean that (for example) a user who
> > presses (and holds) the "media" key before "email" will end up with "email"
> > being acted on first. This may surprise them. Then again, I suppose it
> > could be argued that such usage is unusual and therefore is likely to be
> > rare - and therefore not worth bothering about.
>
> Michal noted there is only one event to release all keys so the order wouldn't
> be noticed in userspace. Has this been confirmed with testing?
I can't test this because my Fujitsu doesn't have these hotkeys.
Regarding the order, the original code sent "press" events to userspace in
the order that the keys were pressed. When the single "release all keys"
event is received, a "release" event ws sent to userspace for each button
which was pressed, in the order they were pressed.
If userspace acted on the button release event then the order of the
synthesised "release" events could be significant to userspace, even if they
are all generated at the same time in response to the first "release" event.
By way of example, let's say there are two hotkeys, "A" and "B". Let us also
say that the user does the following:
- Press and hold hotkey "A"
- Press and hold hotkey "B"
- Release one of these hotkeys
The events seen by userspace with the original code would be "A-press",
"B-press", "A-release", "B-release". With the revised code the order of the
release events would be reversed compared to the previous behaviour. That
is, unless I've misunderstood how sparse_keymap_report_event() works.
Regards
jonathan
next prev parent reply other threads:[~2017-06-22 3:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 4:40 [PATCH 0/7] fujitsu-laptop: ACPI-related cleanups Michał Kępień
2017-06-16 4:40 ` [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes Michał Kępień
2017-06-21 18:15 ` Darren Hart
2017-06-21 23:50 ` Jonathan Woithe
2017-06-22 2:44 ` Darren Hart
2017-06-22 3:01 ` Jonathan Woithe [this message]
2017-06-22 20:46 ` Michał Kępień
2017-06-22 23:58 ` Darren Hart
2017-06-23 0:14 ` Jonathan Woithe
2017-06-23 5:54 ` Darren Hart
2017-06-22 20:08 ` Michał Kępień
2017-06-24 0:25 ` Rafael J. Wysocki
2017-06-27 0:07 ` Darren Hart
2017-06-27 12:16 ` Jonathan Woithe
2017-06-28 4:30 ` Michał Kępień
2017-06-28 16:03 ` Darren Hart
2017-06-16 4:40 ` [PATCH 2/7] platform/x86: fujitsu-laptop: remove redundant safety checks Michał Kępień
2017-06-16 4:40 ` [PATCH 3/7] platform/x86: fujitsu-laptop: use strcpy to set ACPI device names and classes Michał Kępień
2017-06-16 4:40 ` [PATCH 4/7] platform/x86: fujitsu-laptop: sanitize hotkey input device identification Michał Kępień
2017-06-16 4:40 ` [PATCH 5/7] platform/x86: fujitsu-laptop: do not update ACPI device power status Michał Kępień
2017-06-21 20:17 ` Darren Hart
2017-06-22 21:02 ` Michał Kępień
2017-06-22 23:58 ` Darren Hart
2017-06-23 0:16 ` Jonathan Woithe
2017-06-23 5:52 ` Darren Hart
2017-06-16 4:40 ` [PATCH 6/7] platform/x86: fujitsu-laptop: do not evaluate ACPI _INI methods Michał Kępień
2017-06-16 4:40 ` [PATCH 7/7] platform/x86: fujitsu-laptop: rework debugging Michał Kępień
2017-06-18 10:35 ` [PATCH 0/7] fujitsu-laptop: ACPI-related cleanups Jonathan Woithe
2017-06-22 23:57 ` Darren Hart
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=20170622030120.GF32131@marvin.atrad.com.au \
--to=jwoithe@just42.net \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=kernel@kempniu.pl \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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
all inboxes | Powered by JetHome®