Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2019 20:44:16 +0000 (UTC)
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354295 - head/sys/dev/ichiic
Message-ID:  <201911032044.xA3KiGTb058832@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wulf
Date: Sun Nov  3 20:44:16 2019
New Revision: 354295
URL: https://svnweb.freebsd.org/changeset/base/354295

Log:
  [ig4] Do not wait for interrupts in set_controller() routine
  
  Specs shows no dedicated interrupt firing on disable of the controller.
  
  Remove io lock acquisitions around set_controller() calls as they are
  not needed anymore.

Modified:
  head/sys/dev/ichiic/ig4_iic.c

Modified: head/sys/dev/ichiic/ig4_iic.c
==============================================================================
--- head/sys/dev/ichiic/ig4_iic.c	Sun Nov  3 20:43:02 2019	(r354294)
+++ head/sys/dev/ichiic/ig4_iic.c	Sun Nov  3 20:44:16 2019	(r354295)
@@ -135,10 +135,7 @@ set_controller(ig4iic_softc_t *sc, uint32_t ctl)
 			error = 0;
 			break;
 		}
-		if (cold)
-			DELAY(1000);
-		else
-			mtx_sleep(sc, &sc->io_lock, 0, "i2cslv", 1);
+		pause("i2cslv", 1);
 	}
 	return (error);
 }
@@ -600,20 +597,16 @@ ig4iic_attach(ig4iic_softc_t *sc)
 	}
 #endif
 
-	mtx_lock(&sc->io_lock);
 	if (set_controller(sc, 0)) {
 		device_printf(sc->dev, "controller error during attach-1\n");
-		mtx_unlock(&sc->io_lock);
 		error = ENXIO;
 		goto done;
 	}
 	if (set_controller(sc, IG4_I2C_ENABLE)) {
 		device_printf(sc->dev, "controller error during attach-2\n");
-		mtx_unlock(&sc->io_lock);
 		error = ENXIO;
 		goto done;
 	}
-	mtx_unlock(&sc->io_lock);
 	error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE,
 			       NULL, ig4iic_intr, sc, &sc->intr_handle);
 	if (error) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911032044.xA3KiGTb058832>