freebsd-dev/sys/dev/gpio
Warner Losh 1c7d15b030 Make device_busy/unbusy work w/o Giant held
The vast majority of the busy/unbusy users in the tree don't acquire
Giant before calling device_busy/unbusy. However, if multiple threads
are opening a file, say, that causes the device to busy/unbusy, then we
can race to the root marking things busy. Move to using a reference
count to keep track of how many times a device_t has been made busy. Use
that count to make the same decisions that we'd make with the old device
state.

Note: gpiopps.c uses D_TRACKCLOSE. Others do as well. However, there's a
known race with closes that will be corrected for all the drivers that
do this in a future commit.

Sponsored by:		Netflix
Reviewed by:		hselasky, jhb
Differential Revision:	https://reviews.freebsd.org/D26284
2021-11-30 15:18:01 -07:00
..
dwgpio
bytgpio.c
chvgpio_reg.h
chvgpio.c
gpio_if.m Fix some common typos in comments 2021-08-08 10:16:06 +02:00
gpiobacklight.c
gpiobus_if.m Fix some common typos in comments 2021-08-08 10:16:06 +02:00
gpiobus.c newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
gpiobusvar.h
gpioc.c gpioc_detach: fix freeing of wrong pointers 2021-03-23 12:45:18 +02:00
gpioiic.c Revert "Define PNP info after defining driver modules" 2021-01-23 10:59:41 -05:00
gpiokeys_codes.c gpiokeys: Use the new device-tree vendor include 2021-01-15 20:07:24 +01:00
gpiokeys.c
gpiokeys.h
gpioled_fdt.c gpioled: allow the driver to be disabled via fdt 2021-11-06 19:21:05 +02:00
gpioled.c
gpiomdio.c
gpiopower.c
gpiopps.c Make device_busy/unbusy work w/o Giant held 2021-11-30 15:18:01 -07:00
gpioregulator.c
gpiospi.c
gpioths.c Revert "Define PNP info after defining driver modules" 2021-01-23 10:59:41 -05:00
ofw_gpiobus.c newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
pl061_acpi.c Move the pl061 acpi attachment earlier 2020-09-10 14:58:46 +00:00
pl061_fdt.c
pl061.c Allow for interrupts on pl061 children 2020-09-14 08:59:16 +00:00
pl061.h
qoriq_gpio.c Introduce qoriq_gpio_pic driver 2021-11-06 09:08:45 +01:00
qoriq_gpio.h qoriq_gpio: Add support for driver inheritance 2021-11-06 09:08:45 +01:00