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

Hans Petter Selasky hps at selasky.org
Thu May 22 13:10:09 UTC 2014


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.

--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





-------------- next part --------------
A non-text attachment was scrubbed...
Name: vt.diff
Type: text/x-diff
Size: 1649 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20140522/bf88aacb/attachment.diff>


More information about the svn-src-head mailing list