svn commit: r265927 - head/sys/dev/vt

Aleksandr Rybalko ray at freebsd.org
Tue Jun 3 13:40:02 UTC 2014


On Thu, 22 May 2014 15:10:51 +0200
Hans Petter Selasky <hps at selasky.org> 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 <ray at freebsd.org>


More information about the svn-src-all mailing list