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) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to