From owner-svn-src-all@FreeBSD.ORG Tue Jun 3 13:40:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D25634A; Tue, 3 Jun 2014 13:40:02 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id CD4392B74; Tue, 3 Jun 2014 13:40:01 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 99A27C4930; Tue, 3 Jun 2014 16:39:54 +0300 (EEST) Date: Tue, 3 Jun 2014 16:41:06 +0300 From: Aleksandr Rybalko To: Hans Petter Selasky Subject: Re: svn commit: r265927 - head/sys/dev/vt Message-Id: <20140603164106.42d1ded73c01d1eb80cdb255@freebsd.org> In-Reply-To: <537DF75B.9040607@selasky.org> References: <201405121929.s4CJTcBx010967@svn.freebsd.org> <537D0AAB.3090303@selasky.org> <537DF75B.9040607@selasky.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 13:40:02 -0000 On Thu, 22 May 2014 15:10:51 +0200 Hans Petter Selasky wrote: > On 05/21/14 22:20, Hans Petter Selasky wrote: > > On 05/12/14 21:29, Aleksandr Rybalko wrote: > >> Author: ray > >> Date: Mon May 12 19:29:38 2014 > >> New Revision: 265927 > >> URL: http://svnweb.freebsd.org/changeset/base/265927 > >> > >> Log: > >> Update terminal sizes in any case when new vt(4) driver arrive. > >> (Plus remove one unused newline) > >> > >> Sponsored by: The FreeBSD Foundation > >> > >> Modified: > >> head/sys/dev/vt/vt_core.c > >> > > > > This patch causes panic when booting the RPI-B: > > > > VT: initialize with new VT driver "fb". > > panic: mtx_lock() of spin mutex (null) @ > > /usr/img/freebsd/sys/dev/vt/vt_core.c:2037 > > KDB: enter: panic > > [ thread pid 0 tid 100000 ] > > Stopped at $d: ldrb r15, [r15, r15, ror r15]! > > > > __mtx_lock_flags() at > > vt_resize() at vt_upgrade() at > > mi_startup() at mi_startup+0x11c > > > > > > --HPS > > > > This patch fixes it. Not sure if it is correct. Idea is right, but I did it another way a bit :) Fixed in r267007. > > --HPS > > > diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c > > index 39b9265..d85d5e8 100644 > > --- a/sys/dev/vt/vt_core.c > > +++ b/sys/dev/vt/vt_core.c > > @@ -145,6 +145,7 @@ static int vt_late_window_switch(struct vt_window *); > > static int vt_proc_alive(struct vt_window *); > > static void vt_resize(struct vt_device *); > > static void vt_update_static(void *); > > +static void vt_upgrade_static(void *); > > > > SET_DECLARE(vt_drv_set, struct vt_driver); > > > > @@ -203,23 +204,28 @@ DATA_SET(cons_set, vt_consterm_consdev); > > * Right after kmem is done to allow early drivers to use locking and allocate > > * memory. > > */ > > -SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, > > - &vt_consdev); > > +SYSINIT(vt_init_1, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, NULL); > > /* Delay until all devices attached, to not waste time. */ > > -SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, > > - &vt_consdev); > > +SYSINIT(vt_init_2, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade_static, NULL); > > > > /* Initialize locks/mem depended members. */ > > static void > > vt_update_static(void *dummy) > > { > > + if (main_vd == NULL) > > + return; > > + printf("VT: running with driver \"%s\".\n", > > + main_vd->vd_driver->vd_name); > > + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > > + cv_init(&main_vd->vd_winswitch, "vtwswt"); > > +} > > > > - if (main_vd != NULL) { > > - printf("VT: running with driver \"%s\".\n", > > - main_vd->vd_driver->vd_name); > > - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > > - cv_init(&main_vd->vd_winswitch, "vtwswt"); > > - } > > +static void > > +vt_upgrade_static(void *dummy) > > +{ > > + if (main_vd == NULL) > > + return; > > + vt_upgrade(main_vd); > > } > > > > static void > > > > > -- Aleksandr Rybalko