summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoryamaguchi <yamaguchi@NetBSD.org>2018-04-25 08:29:45 +0000
committeryamaguchi <yamaguchi@NetBSD.org>2018-04-25 08:29:45 +0000
commit0df16fdf84f50ceed164c5d6aa9edae06c47cd94 (patch)
treed626a94d673b5795051b8d84d201301403d50d38 /sys/dev
parent513e650f3159a84d8d3c0109666b7ee3c37964b7 (diff)
Use spin mutex to fix a panic
The GPIO part of wbsio(4) has a lock to keep the register access order. In addition to the lock, gpio(4) has a look to prevent multiple control through gpio_pin_ctl(). Those locks hold at once when gpio_pin_ctl() is called, and the lock of gpio(4) hold before that of wbsio(4). Therefore, the wbsio(4) has to use spin lock if gpio(4) uses spin lock.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/isa/wbsio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/isa/wbsio.c b/sys/dev/isa/wbsio.c
index 9b34ccbc158..7524e471c9c 100644
--- a/sys/dev/isa/wbsio.c
+++ b/sys/dev/isa/wbsio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wbsio.c,v 1.23 2018/03/07 09:25:56 msaitoh Exp $ */
+/* $NetBSD: wbsio.c,v 1.24 2018/04/25 08:29:45 yamaguchi Exp $ */
/* $OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org>
@@ -547,7 +547,7 @@ wbsio_gpio_rt_init(struct wbsio_softc *sc)
aprint_normal_dev(sc->sc_dev, "GPIO: port 0x%x-0x%x\n",
iobase, iobase + WBSIO_GPIO_IOSIZE);
- mutex_init(&sc->sc_gpio_lock, MUTEX_DEFAULT, IPL_NONE);
+ mutex_init(&sc->sc_gpio_lock, MUTEX_DEFAULT, IPL_VM);
return 0;
}