opnsense-src/sys/dev/pccard
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
..
pccard.c Make device_busy/unbusy work w/o Giant held 2021-11-30 15:18:01 -07:00
pccard_cis.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
pccard_cis.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
pccard_cis_quirks.c pccard: clean up empty lines in .c and .h files 2020-09-01 22:01:04 +00:00
pccard_device.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
pccarddevs
pccardreg.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
pccardvar.h Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
pccardvarp.h Regularize my copyright notice 2019-12-04 16:56:11 +00:00