Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/ti Initialize the i2c controller before using it.



details:   https://anonhg.NetBSD.org/src/rev/fda7553a5e99
branches:  trunk
changeset: 937340:fda7553a5e99
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Aug 16 03:48:59 2020 +0000

description:
Initialize the i2c controller before using it.

Fixes mutex uninitialized panic in LOCKDEBUG.

diffstat:

 sys/arch/arm/ti/ti_iic.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r cf40c7b8e0b4 -r fda7553a5e99 sys/arch/arm/ti/ti_iic.c
--- a/sys/arch/arm/ti/ti_iic.c  Sun Aug 16 02:38:06 2020 +0000
+++ b/sys/arch/arm/ti/ti_iic.c  Sun Aug 16 03:48:59 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.6 2020/06/03 16:00:00 jmcneill Exp $ */
+/* $NetBSD: ti_iic.c,v 1.7 2020/08/16 03:48:59 riastradh Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.6 2020/06/03 16:00:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.7 2020/08/16 03:48:59 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,6 +265,7 @@
        mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
        mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NET);
        cv_init(&sc->sc_cv, "tiiic");
+       iic_tag_init(&sc->sc_ic);
        sc->sc_ic.ic_cookie = sc;
        sc->sc_ic.ic_acquire_bus = ti_iic_acquire_bus;
        sc->sc_ic.ic_release_bus = ti_iic_release_bus;



Home | Main Index | Thread Index | Old Index