svn commit: r306618 - head/sys/arm/broadcom/bcm2835

Oleksandr Tymoshenko gonzo at FreeBSD.org
Mon Oct 3 01:07:07 UTC 2016


Author: gonzo
Date: Mon Oct  3 01:07:06 2016
New Revision: 306618
URL: https://svnweb.freebsd.org/changeset/base/306618

Log:
  Fix attach/detach methods
  
  - Initialize lock before starting worker process
  - Do not hold lock when destroying evdev. By that time ther should be no
      other active code pathes that can access softc

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c	Mon Oct  3 00:55:18 2016	(r306617)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_ft5406.c	Mon Oct  3 01:07:06 2016	(r306618)
@@ -288,13 +288,13 @@ ft5406ts_attach(device_t dev)
 	sc->sc_init_hook.ich_func = ft5406ts_init;
 	sc->sc_init_hook.ich_arg = sc;
 
+	FT5406_LOCK_INIT(sc);
+
 	if (config_intrhook_establish(&sc->sc_init_hook) != 0) {
 		device_printf(dev, "config_intrhook_establish failed\n");
 		return (ENOMEM);
 	}
 
-	FT5406_LOCK_INIT(sc);
-
 	return (0);
 }
 
@@ -308,10 +308,11 @@ ft5406ts_detach(device_t dev)
 	FT5406_LOCK(sc);
 	if (sc->sc_worker)
 		sc->sc_detaching = 1;
+	wakeup(sc);
+	FT5406_UNLOCK(sc);
 
 	if (sc->sc_evdev)
 		evdev_free(sc->sc_evdev);
-	FT5406_UNLOCK(sc);
 
 	FT5406_LOCK_DESTROY(sc);
 


More information about the svn-src-all mailing list