Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102059207
D47221.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
816 B
Referenced Files
None
Subscribers
None
D47221.diff
View Options
diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
--- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c
+++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
@@ -207,13 +207,6 @@
sc = device_get_softc(dev);
vf_i2c_dbg(sc, "i2c detach\n");
- mtx_lock(&sc->mutex);
-
- if (sc->freq == 0) {
- vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n");
- WRITE1(sc, I2C_IBFD, 0x00);
- }
-
error = bus_generic_detach(dev);
if (error != 0) {
device_printf(dev, "cannot detach child devices.\n");
@@ -226,6 +219,13 @@
return (error);
}
+ mtx_lock(&sc->mutex);
+
+ if (sc->freq == 0) {
+ vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n");
+ WRITE1(sc, I2C_IBFD, 0x00);
+ }
+
bus_release_resources(dev, i2c_spec, sc->res);
mtx_unlock(&sc->mutex);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 2:52 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14303708
Default Alt Text
D47221.diff (816 B)
Attached To
Mode
D47221: vf_i2c: Don't hold a mutex across bus_generic_detach
Attached
Detach File
Event Timeline
Log In to Comment