The late 2016 model of the Razer Blade Stealth has a built-in USB
keyboard, but for some reason the BIOS exposes an i8042 controller with
a connected KBD port. While this fake AT Keyboard device doesn't appear
to report any events, attempting to change the state of the caps lock
LED on it from on to off causes the entire system to hang.
So, introduce a quirk table for disabling keyboard probing by default,
i8042_dmi_nokbd_table, and add this specific model of Razer laptop to
that table.
Signed-off-by: Lyude Paul <lyude(a)redhat.com>
Cc: stable(a)vger.kernel.org
---
drivers/input/serio/i8042-x86ia64io.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 136f6e7bf797..888f5f6feebf 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -884,6 +884,22 @@ static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
{ }
};
+static const struct dmi_system_id i8042_dmi_nokbd_table[] __initconst = {
+ {
+ /*
+ * Razer Blade Stealth (Late 2016 model) - Keyboard is on USB
+ * but the system exposes a fake AT keyboard that crashes the
+ * system if the caps lock LED is changed
+ */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Razer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Blade Stealth"),
+ DMI_MATCH(DMI_PRODUCT_VERSION, "2.04"),
+ },
+ },
+ { }
+};
+
#endif /* CONFIG_X86 */
#ifdef CONFIG_PNP
@@ -1040,6 +1056,9 @@ static int __init i8042_pnp_init(void)
#ifdef CONFIG_X86
if (dmi_check_system(i8042_dmi_nopnp_table))
i8042_nopnp = true;
+
+ if (dmi_check_system(i8042_dmi_nokbd_table))
+ i8042_nokbd = true;
#endif
if (i8042_nopnp) {
--
2.20.1
misc/eeprom/{at24,at25,eeprom_93xx46} drivers all register their
corresponding devices in the nvmem framework in compat mode which requires
nvmem sysfs interface to be present. The latter, however, has been split
out from nvmem under a separate Kconfig in commit ae0c2d725512 ("nvmem:
core: add NVMEM_SYSFS Kconfig"). As a result, probing certain I2C-attached
EEPROMs now fails with
at24: probe of 0-0050 failed with error -38
because of a stub implementation of nvmem_sysfs_setup_compat()
in drivers/nvmem/nvmem.h. Update the nvmem dependency for these drivers
so they could load again:
at24 0-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
Cc: Adrian Bunk <bunk(a)kernel.org>
Cc: Bartosz Golaszewski <brgl(a)bgdev.pl>
Cc: Srinivas Kandagatla <srinivas.kandagatla(a)linaro.org>
Cc: stable(a)vger.kernel.org # v5.2+
Signed-off-by: Arseny Solokha <asolokha(a)kb.kras.ru>
---
drivers/misc/eeprom/Kconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig
index f88094719552..f2abe27010ef 100644
--- a/drivers/misc/eeprom/Kconfig
+++ b/drivers/misc/eeprom/Kconfig
@@ -5,6 +5,7 @@ config EEPROM_AT24
tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
depends on I2C && SYSFS
select NVMEM
+ select NVMEM_SYSFS
select REGMAP_I2C
help
Enable this driver to get read/write support to most I2C EEPROMs
@@ -34,6 +35,7 @@ config EEPROM_AT25
tristate "SPI EEPROMs from most vendors"
depends on SPI && SYSFS
select NVMEM
+ select NVMEM_SYSFS
help
Enable this driver to get read/write support to most SPI EEPROMs,
after you configure the board init code to know about each eeprom
@@ -80,6 +82,7 @@ config EEPROM_93XX46
depends on SPI && SYSFS
select REGMAP
select NVMEM
+ select NVMEM_SYSFS
help
Driver for the microwire EEPROM chipsets 93xx46x. The driver
supports both read and write commands and also the command to
--
2.22.0
On Tue, Jul 16, 2019 at 3:27 AM Sasha Levin <sashal(a)kernel.org> wrote:
> v5.2.1: Build OK!
> v5.1.18: Failed to apply! Possible dependencies:
(...)
> How should we proceed with this patch?
Only apply it to 5.2.y once upstream.
Thanks!
Linus Walleij
This reverts commit fbbf145a0e0a0177e089c52275fbfa55763e7d1d.
It seems I was misguided in my fixup, which was working at the
time but did not work on the final v5.2.
The patch tried to avoid a quirk the gpiolib code not to treat
"spi-gpio" CS gpios "special" by enforcing them to be active
low, in the belief that since the "spi-gpio" driver was
parsing the device tree on its own, it did not care to inspect
the "spi-cs-high" attribute on the device nodes.
That's wrong. The SPI core was inspecting them inside the
of_spi_parse_dt() funtion and setting SPI_CS_HIGH on the
nodes, and the driver inspected this flag when driving the
line.
As of now, the core handles the GPIO and it will consistently
set the GPIO descriptor to 1 to enable CS, strictly requireing
the gpiolib to invert it. And the gpiolib should indeed
enforce active low on the CS line.
Device trees should of course put the right flag on the GPIO
handles, but it used to not matter. If we don't enforce active
low on "gpio-gpio" we may run into ABI backward compatibility
issues, so revert this.
Cc: linux-spi(a)vger.kernel.org
Cc: stable(a)vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij(a)linaro.org>
---
I am sorry that this at one point fixed a problem for me, it
doesn't anymore and I don't know why it ever did. :(
---
drivers/gpio/gpiolib-of.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index f974075ff00e..a8f02f551d6b 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -118,15 +118,8 @@ static void of_gpio_flags_quirks(struct device_node *np,
* Legacy handling of SPI active high chip select. If we have a
* property named "cs-gpios" we need to inspect the child node
* to determine if the flags should have inverted semantics.
- *
- * This does not apply to an SPI device named "spi-gpio", because
- * these have traditionally obtained their own GPIOs by parsing
- * the device tree directly and did not respect any "spi-cs-high"
- * property on the SPI bus children.
*/
- if (IS_ENABLED(CONFIG_SPI_MASTER) &&
- !strcmp(propname, "cs-gpios") &&
- !of_device_is_compatible(np, "spi-gpio") &&
+ if (IS_ENABLED(CONFIG_SPI_MASTER) && !strcmp(propname, "cs-gpios") &&
of_property_read_bool(np, "cs-gpios")) {
struct device_node *child;
u32 cs;
--
2.21.0
The SPI to the display on the DIR-685 is active low, we were
just saved by the SPI library enforcing active low on everything
before, so set it as active low to avoid ambiguity.
Cc: stable(a)vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij(a)linaro.org>
---
ARM SoC folks: please apply this directly to fixes.
---
arch/arm/boot/dts/gemini-dlink-dir-685.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/gemini-dlink-dir-685.dts b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
index 3613f05f8a80..bfaa2de63a10 100644
--- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts
+++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts
@@ -64,7 +64,7 @@
gpio-sck = <&gpio1 5 GPIO_ACTIVE_HIGH>;
gpio-miso = <&gpio1 8 GPIO_ACTIVE_HIGH>;
gpio-mosi = <&gpio1 7 GPIO_ACTIVE_HIGH>;
- cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
+ cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
num-chipselects = <1>;
panel: display@0 {
--
2.21.0
When testing with a device which uses the drm/udl driver, KASAN shows
that on hot-remove we have a use-after-free:
==================================================================
BUG: KASAN: use-after-free in do_raw_spin_lock+0x1c/0xdd
Read of size 4 at addr ffff88841863668c by task kworker/2:3/2085
CPU: 2 PID: 2085 Comm: kworker/2:3 Tainted: G U W 4.19.59-dirty #15
Hardware name: GOOGLE Samus, BIOS Google_Samus.6300.276.0 08/17/2016
Workqueue: events drm_mode_rmfb_work_fn
Call Trace:
dump_stack+0x62/0x8b
print_address_description+0x80/0x2d2
? do_raw_spin_lock+0x1c/0xdd
kasan_report+0x26a/0x2aa
do_raw_spin_lock+0x1c/0xdd
_raw_spin_lock_irqsave+0x19/0x1f
down_timeout+0x19/0x58
udl_get_urb+0x3d/0x13c
? udl_crtc_dpms+0x2e/0x270
udl_crtc_dpms+0x45/0x270
__drm_helper_disable_unused_functions+0xed/0x150
drm_crtc_helper_set_config+0x214/0xf25
? ___slab_alloc.constprop.75+0xdd/0x48c
? drm_modeset_lock_all+0x33/0xbb
? ___might_sleep+0x80/0x1b6
__drm_mode_set_config_internal+0x103/0x22c
drm_crtc_force_disable+0x4e/0x69
drm_framebuffer_remove+0x169/0x508
? do_raw_spin_unlock+0xd4/0xde
? mmdrop+0x16/0x29
drm_mode_rmfb_work_fn+0x8d/0x9b
process_one_work+0x309/0x4df
worker_thread+0x369/0x447
? create_worker+0x2f1/0x2f1
kthread+0x223/0x233
? kthread_worker_fn+0x29c/0x29c
ret_from_fork+0x35/0x40
Allocated by task 2085:
kasan_kmalloc+0x99/0xa8
kmem_cache_alloc_trace+0x105/0x12b
udl_driver_load+0x52/0x776
drm_dev_register+0x151/0x2d6
udl_usb_probe+0x4f/0xa6
usb_probe_interface+0x25e/0x311
really_probe+0x1f1/0x3ee
driver_probe_device+0xd6/0x112
bus_for_each_drv+0xbb/0xe2
__device_attach+0xdb/0x159
bus_probe_device+0x5a/0x100
device_add+0x4bf/0x847
usb_set_configuration+0x972/0x9df
generic_probe+0x45/0x77
really_probe+0x1f1/0x3ee
driver_probe_device+0xd6/0x112
bus_for_each_drv+0xbb/0xe2
__device_attach+0xdb/0x159
bus_probe_device+0x5a/0x100
device_add+0x4bf/0x847
usb_new_device+0x540/0x6ba
hub_event+0x1017/0x161c
process_one_work+0x309/0x4df
worker_thread+0x2de/0x447
kthread+0x223/0x233
ret_from_fork+0x35/0x40
Freed by task 2085:
__kasan_slab_free+0x102/0x126
slab_free_freelist_hook+0x4d/0x9d
kfree+0x127/0x1bd
drm_dev_unregister+0xae/0x167
drm_dev_unplug+0x2e/0x38
usb_unbind_interface+0xc5/0x2be
device_release_driver_internal+0x229/0x381
bus_remove_device+0x1a2/0x1cd
device_del+0x26b/0x42c
usb_disable_device+0x112/0x2c9
usb_disconnect+0xed/0x28c
usb_disconnect+0xde/0x28c
hub_event+0x7eb/0x161c
process_one_work+0x309/0x4df
worker_thread+0x2de/0x447
kthread+0x223/0x233
ret_from_fork+0x35/0x40
The buggy address belongs to the object at ffff888418636600
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 140 bytes inside of
2048-byte region [ffff888418636600, ffff888418636e00)
The buggy address belongs to the page:
page:ffffea0010618c00 count:1 mapcount:0 mapping:ffff88842d403040 index:0x0 compound_mapcount: 0
flags: 0x8000000000008100(slab|head)
raw: 8000000000008100 dead000000000100 dead000000000200 ffff88842d403040
raw: 0000000000000000 00000000000f000f 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888418636580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888418636600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888418636680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888418636700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888418636780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Disabling lock debugging due to kernel taint
[drm] wait for urb interrupted: ffffffc2 available: 4
This happens 100% of the time and is resolved by the following patch
upstream:
commit 6ecac85eadb9 ("drm/udl: move to embedding drm device inside udl device.")
This patch is the third in this series, and requires the first two
patches as dependencies. All three were clean cherry-picks on top of
v4.19.59.
Dave Airlie (2):
drm/udl: introduce a macro to convert dev to udl.
drm/udl: move to embedding drm device inside udl device.
Thomas Zimmermann (1):
drm/udl: Replace drm_dev_unref with drm_dev_put
drivers/gpu/drm/udl/udl_drv.c | 56 +++++++++++++++++++++++++++-------
drivers/gpu/drm/udl/udl_drv.h | 9 +++---
drivers/gpu/drm/udl/udl_fb.c | 12 ++++----
drivers/gpu/drm/udl/udl_gem.c | 2 +-
drivers/gpu/drm/udl/udl_main.c | 35 ++++++---------------
5 files changed, 66 insertions(+), 48 deletions(-)
--
2.22.0.510.g264f2c817a-goog