<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/input/keyboard, branch v5.13</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge branch 'next' into for-linus</title>
<updated>2021-05-04T18:46:00+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-05-04T18:46:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d0034a7a4ac7fae708146ac0059b9c47a1543f0d'/>
<id>d0034a7a4ac7fae708146ac0059b9c47a1543f0d</id>
<content type='text'>
Prepare input updates for 5.13 merge window.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prepare input updates for 5.13 merge window.
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: gpio-keys - fix crash when disabliing GPIO-less buttons</title>
<updated>2021-04-08T06:20:52+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-04-08T06:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2531fdbf8bfc22b0a2554bb3e3772dd8105d74ad'/>
<id>2531fdbf8bfc22b0a2554bb3e3772dd8105d74ad</id>
<content type='text'>
My brain-damaged adjustments to Paul's patch caused crashes in
gpio_keys_disable_button() when driver is used in GPIO-less (i.e.
purely interrupt-driven) setups, because I mixed together debounce and
release timers when they are in fact separate:

Unable to handle kernel NULL pointer dereference at virtual address 0000000c
...
PC is at hrtimer_active+0xc/0x98
LR is at hrtimer_try_to_cancel+0x24/0x140
...
[&lt;c01c43b8&gt;] (hrtimer_active) from [&lt;c01c50f4&gt;] (hrtimer_try_to_cancel+0x24/0x140)
[&lt;c01c50f4&gt;] (hrtimer_try_to_cancel) from [&lt;c01c5224&gt;] (hrtimer_cancel+0x14/0x4c)
[&lt;c01c5224&gt;] (hrtimer_cancel) from [&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys])
[&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper [gpio_keys]) from [&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys])
[&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys [gpio_keys]) from [&lt;c038ec7c&gt;] (kernfs_fop_write_iter+0x10c/0x1cc)
[&lt;c038ec7c&gt;] (kernfs_fop_write_iter) from [&lt;c02df858&gt;] (vfs_write+0x2ac/0x404)
[&lt;c02df858&gt;] (vfs_write) from [&lt;c02dfaf4&gt;] (ksys_write+0x64/0xdc)
[&lt;c02dfaf4&gt;] (ksys_write) from [&lt;c0100080&gt;] (ret_fast_syscall+0x0/0x58)

Let's fix it up.

Fixes: c9efb0ba281e ("Input: gpio-keys - use hrtimer for software debounce, if possible")
Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/YG1DFFgojSVfdpaz@google.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
My brain-damaged adjustments to Paul's patch caused crashes in
gpio_keys_disable_button() when driver is used in GPIO-less (i.e.
purely interrupt-driven) setups, because I mixed together debounce and
release timers when they are in fact separate:

Unable to handle kernel NULL pointer dereference at virtual address 0000000c
...
PC is at hrtimer_active+0xc/0x98
LR is at hrtimer_try_to_cancel+0x24/0x140
...
[&lt;c01c43b8&gt;] (hrtimer_active) from [&lt;c01c50f4&gt;] (hrtimer_try_to_cancel+0x24/0x140)
[&lt;c01c50f4&gt;] (hrtimer_try_to_cancel) from [&lt;c01c5224&gt;] (hrtimer_cancel+0x14/0x4c)
[&lt;c01c5224&gt;] (hrtimer_cancel) from [&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys])
[&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper [gpio_keys]) from [&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys])
[&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys [gpio_keys]) from [&lt;c038ec7c&gt;] (kernfs_fop_write_iter+0x10c/0x1cc)
[&lt;c038ec7c&gt;] (kernfs_fop_write_iter) from [&lt;c02df858&gt;] (vfs_write+0x2ac/0x404)
[&lt;c02df858&gt;] (vfs_write) from [&lt;c02dfaf4&gt;] (ksys_write+0x64/0xdc)
[&lt;c02dfaf4&gt;] (ksys_write) from [&lt;c0100080&gt;] (ret_fast_syscall+0x0/0x58)

Let's fix it up.

Fixes: c9efb0ba281e ("Input: gpio-keys - use hrtimer for software debounce, if possible")
Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/YG1DFFgojSVfdpaz@google.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: imx_keypad - convert to a DT-only driver</title>
<updated>2021-03-28T04:40:21+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@gmail.com</email>
</author>
<published>2021-03-28T04:38:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=73e7f1732e800a88cafab31d75548c6fcfdd8c47'/>
<id>73e7f1732e800a88cafab31d75548c6fcfdd8c47</id>
<content type='text'>
i.MX has been converted to a DT-only platform, so make the
adjustments to the driver to convert it to a DT-only driver.

Signed-off-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Link: https://lore.kernel.org/r/20210327194307.541248-1-festevam@gmail.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i.MX has been converted to a DT-only platform, so make the
adjustments to the driver to convert it to a DT-only driver.

Signed-off-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Link: https://lore.kernel.org/r/20210327194307.541248-1-festevam@gmail.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: move to use request_irq by IRQF_NO_AUTOEN flag</title>
<updated>2021-03-25T22:27:56+00:00</updated>
<author>
<name>Barry Song</name>
<email>song.bao.hua@hisilicon.com</email>
</author>
<published>2021-03-25T21:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bcd9730a04a1f18d873adb3907f2b4830b88ee9a'/>
<id>bcd9730a04a1f18d873adb3907f2b4830b88ee9a</id>
<content type='text'>
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable because of requesting.

On the other hand, request_irq() after setting IRQ_NOAUTOEN as
below
irq_set_status_flags(irq, IRQ_NOAUTOEN);
request_irq(dev, irq...);
can also be replaced by request_irq() with IRQF_NO_AUTOEN flag.

Signed-off-by: Barry Song &lt;song.bao.hua@hisilicon.com&gt;
Link: https://lore.kernel.org/r/20210302224916.13980-3-song.bao.hua@hisilicon.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable because of requesting.

On the other hand, request_irq() after setting IRQ_NOAUTOEN as
below
irq_set_status_flags(irq, IRQ_NOAUTOEN);
request_irq(dev, irq...);
can also be replaced by request_irq() with IRQF_NO_AUTOEN flag.

Signed-off-by: Barry Song &lt;song.bao.hua@hisilicon.com&gt;
Link: https://lore.kernel.org/r/20210302224916.13980-3-song.bao.hua@hisilicon.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'v5.12-rc4' into next</title>
<updated>2021-03-25T18:46:10+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-03-25T18:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5acac83bf2e42f51ab9fd315d657798754bf0bb8'/>
<id>5acac83bf2e42f51ab9fd315d657798754bf0bb8</id>
<content type='text'>
Sync up with the mainline to bring in newest APIs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sync up with the mainline to bring in newest APIs.
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: gpio-keys - use hrtimer for software debounce, if possible</title>
<updated>2021-03-25T18:14:08+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:09:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c9efb0ba281e88e2faec6ad919be509b6ab8ead6'/>
<id>c9efb0ba281e88e2faec6ad919be509b6ab8ead6</id>
<content type='text'>
We want to be able to report the input event as soon as the debounce
delay elapsed. However, the current code does not really ensure that,
as it uses the jiffies-based schedule_delayed_work() API. With a small
enough HZ value (HZ &lt;= 100), this results in some input events being
lost, when a key is quickly pressed then released (on a human's time
scale).

Switching to hrtimers fixes this issue, and will work even on extremely
low HZ values (tested at HZ=24). This is however only possible if
reading the GPIO is possible without sleeping. If this condition is not
met, the previous approach of using a jiffies-based timer is taken.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-3-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to be able to report the input event as soon as the debounce
delay elapsed. However, the current code does not really ensure that,
as it uses the jiffies-based schedule_delayed_work() API. With a small
enough HZ value (HZ &lt;= 100), this results in some input events being
lost, when a key is quickly pressed then released (on a human's time
scale).

Switching to hrtimers fixes this issue, and will work even on extremely
low HZ values (tested at HZ=24). This is however only possible if
reading the GPIO is possible without sleeping. If this condition is not
met, the previous approach of using a jiffies-based timer is taken.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-3-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: gpio-keys - use hrtimer for release timer</title>
<updated>2021-03-25T18:14:08+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:06:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=019002f20cb5b9f78d39360aff244265d035e08a'/>
<id>019002f20cb5b9f78d39360aff244265d035e08a</id>
<content type='text'>
Dealing with input, timing is important; if the button should be
released in one millisecond, then it should be done in one millisecond
and not a hundred milliseconds.

Therefore, the standard timer API is not really suitable for this task.

Convert the gpio-keys driver to use a hrtimer instead of the standard
timer to address this issue.

Note that by using a hard IRQ for the hrtimer callback, we can get rid
of the spin_lock_irqsave() and spin_unlock_irqrestore().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-2-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dealing with input, timing is important; if the button should be
released in one millisecond, then it should be done in one millisecond
and not a hundred milliseconds.

Therefore, the standard timer API is not really suitable for this task.

Convert the gpio-keys driver to use a hrtimer instead of the standard
timer to address this issue.

Note that by using a hard IRQ for the hrtimer callback, we can get rid
of the spin_lock_irqsave() and spin_unlock_irqrestore().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-2-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: gpio-keys - remove extra call to input_sync</title>
<updated>2021-03-25T18:14:08+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=36a8fc6fa230eb936385884391cac80420cd0e6f'/>
<id>36a8fc6fa230eb936385884391cac80420cd0e6f</id>
<content type='text'>
The input_sync() function is already called after the loop in
gpio_keys_report_state(), so it does not need to be called after each
iteration within gpio_keys_gpio_report_event().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-1-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The input_sync() function is already called after the loop in
gpio_keys_report_state(), so it does not need to be called after each
iteration within gpio_keys_gpio_report_event().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-1-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: nspire-keypad - enable interrupts only when opened</title>
<updated>2021-03-23T17:55:10+00:00</updated>
<author>
<name>Fabian Vogt</name>
<email>fabian@ritter-vogt.de</email>
</author>
<published>2021-03-23T17:45:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=69d5ff3e9e51e23d5d81bf48480aa5671be67a71'/>
<id>69d5ff3e9e51e23d5d81bf48480aa5671be67a71</id>
<content type='text'>
The driver registers an interrupt handler in _probe, but didn't configure
them until later when the _open function is called. In between, the keypad
can fire an IRQ due to touchpad activity, which the handler ignores. This
causes the kernel to disable the interrupt, blocking the keypad from
working.

Fix this by disabling interrupts before registering the handler.
Additionally, disable them in _close, so that they're only enabled while
open.

Fixes: fc4f31461892 ("Input: add TI-Nspire keypad support")
Signed-off-by: Fabian Vogt &lt;fabian@ritter-vogt.de&gt;
Link: https://lore.kernel.org/r/3383725.iizBOSrK1V@linux-e202.suse.de
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The driver registers an interrupt handler in _probe, but didn't configure
them until later when the _open function is called. In between, the keypad
can fire an IRQ due to touchpad activity, which the handler ignores. This
causes the kernel to disable the interrupt, blocking the keypad from
working.

Fix this by disabling interrupts before registering the handler.
Additionally, disable them in _close, so that they're only enabled while
open.

Fixes: fc4f31461892 ("Input: add TI-Nspire keypad support")
Signed-off-by: Fabian Vogt &lt;fabian@ritter-vogt.de&gt;
Link: https://lore.kernel.org/r/3383725.iizBOSrK1V@linux-e202.suse.de
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input</title>
<updated>2021-02-23T22:56:23+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-02-23T22:56:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e0fbd25bb37e7bb1f5ad9c9f7e5fc89152aec87e'/>
<id>e0fbd25bb37e7bb1f5ad9c9f7e5fc89152aec87e</id>
<content type='text'>
Pull input updates from Dmitry Torokhov:
 "Mostly existing driver fixes plus a new driver for game controllers
  directly connected to Nintendo 64, and an enhancement for keyboards
  driven by Chrome OS EC to communicate layout of the top row to
  userspace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (47 commits)
  Input: st1232 - fix NORMAL vs. IDLE state handling
  Input: aiptek - convert sysfs sprintf/snprintf family to sysfs_emit
  Input: alps - fix spelling of "positive"
  ARM: dts: cros-ec-keyboard: Use keymap macros
  dt-bindings: input: Fix the keymap for LOCK key
  dt-bindings: input: Create macros for cros-ec keymap
  Input: cros-ec-keyb - expose function row physical map to userspace
  dt-bindings: input: cros-ec-keyb: Add a new property describing top row
  Input: applespi - fix occasional crc errors under load.
  Input: applespi - don't wait for responses to commands indefinitely.
  Input: st1232 - add IDLE state as ready condition
  Input: zinitix - fix return type of zinitix_init_touch()
  Input: i8042 - add ASUS Zenbook Flip to noselftest list
  Input: add missing dependencies on CONFIG_HAS_IOMEM
  Input: joydev - prevent potential read overflow in ioctl
  Input: elo - fix an error code in elo_connect()
  Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S
  Input: sur40 - fix an error code in sur40_probe()
  Input: elants_i2c - detect enum overflow
  Input: zinitix - remove unneeded semicolon
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull input updates from Dmitry Torokhov:
 "Mostly existing driver fixes plus a new driver for game controllers
  directly connected to Nintendo 64, and an enhancement for keyboards
  driven by Chrome OS EC to communicate layout of the top row to
  userspace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (47 commits)
  Input: st1232 - fix NORMAL vs. IDLE state handling
  Input: aiptek - convert sysfs sprintf/snprintf family to sysfs_emit
  Input: alps - fix spelling of "positive"
  ARM: dts: cros-ec-keyboard: Use keymap macros
  dt-bindings: input: Fix the keymap for LOCK key
  dt-bindings: input: Create macros for cros-ec keymap
  Input: cros-ec-keyb - expose function row physical map to userspace
  dt-bindings: input: cros-ec-keyb: Add a new property describing top row
  Input: applespi - fix occasional crc errors under load.
  Input: applespi - don't wait for responses to commands indefinitely.
  Input: st1232 - add IDLE state as ready condition
  Input: zinitix - fix return type of zinitix_init_touch()
  Input: i8042 - add ASUS Zenbook Flip to noselftest list
  Input: add missing dependencies on CONFIG_HAS_IOMEM
  Input: joydev - prevent potential read overflow in ioctl
  Input: elo - fix an error code in elo_connect()
  Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S
  Input: sur40 - fix an error code in sur40_probe()
  Input: elants_i2c - detect enum overflow
  Input: zinitix - remove unneeded semicolon
  ...
</pre>
</div>
</content>
</entry>
</feed>
