NetBSD Problem Report #46376

From  Wed Apr 25 13:03:36 2012
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id E600A63CD2A
	for <>; Wed, 25 Apr 2012 13:03:35 +0000 (UTC)
Message-Id: <>
Date: Wed, 25 Apr 2012 13:03:35 +0000 (UTC)
Subject: genfb_pci takes over serial console when it attaches.
X-Send-Pr-Version: www-1.0

>Number:         46376
>Category:       kern
>Synopsis:       genfb_pci takes over serial console when it attaches.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 13:05:00 +0000 2012
>Last-Modified:  Sun Sep 25 01:47:55 +0000 2016
>Originator:     Nat Sloss
>Release:        NetBSD Current 6.99.5
NetBSD beast 6.99.5 NetBSD 6.99.5 (LOCKDEBUG) #2: Mon Apr 25 20:55:20 EST 2012  build@beast:/usr/src/sys/arch/i386/compile/obj/LOCKDEBUG i386

genfb_pci takes over serial console (specified at boot) when it attaches.

It is not possible to have genfb screens and a serial console.
Boot and select boot prompt.
Enter "vesa 800x600"
Enter "consdev com0"

On the serial console:
Enter "boot"

You will notice console output on the serial port until genfb attaches.  Then the console output is redirected to the frame buffer device.  No further output appears on the serial console.

An easy way to test is to emulate it in qemu.
I noticed that the console was set if property "is_console" was true.

It's an inference but I think it is true if not explicitly set before the genfb attaches.

I found in the sbus version that it checks whether the frame buffer is the console and sets the "is_console" property.

So here's a patch:

--- genfb_pci.c.orig    2012-03-19 17:02:50.000000000 +1100
+++ genfb_pci.c 2012-04-25 21:23:24.000000000 +1000
@@ -98,9 +98,11 @@
        struct pci_genfb_softc *sc = device_private(self);
        struct pci_attach_args *pa = aux;
+       prop_dictionary_t dict;
        struct genfb_ops ops;
        pcireg_t rom;
        int idx, bar, type;
+       int isconsole;

        pci_aprint_devinfo(pa, NULL);

@@ -185,6 +187,10 @@
        ops.genfb_mmap = pci_genfb_mmap;
        ops.genfb_borrow = pci_genfb_borrow;

+       isconsole = genfb_is_console();
+       dict = device_properties(self);
+       prop_dictionary_set_bool(dict, "is_console", isconsole);
        if (genfb_attach(&sc->sc_gen, &ops) == 0) {

                /* now try to attach a DRM */

I would like to ask that NetBSD 6 be pulled up.

Also I'm not sure as I don't have the hardware if this problem effects machfb and similar.

I hope this helps.




From: "Jonathan A. Kollasch" <>
Subject: PR/46376 CVS commit: src/sys/dev/pci
Date: Thu, 16 Jan 2014 18:41:10 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Thu Jan 16 18:41:10 UTC 2014

 Modified Files:
 	src/sys/dev/pci: genfb_pci.c

 Log Message:
 Fix PR kern/46376 with Nat Sloss's patch (with slight modification).
 Serial console now works on x86 with genfb enabled.

 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/genfb_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-When: Sat, 26 Apr 2014 05:41:15 +0000
fixed in january (right?)

From: Izumi Tsutsui <>
Subject: Re: kern/46376 (genfb_pci takes over serial console when it attaches.)
Date: Sat, 26 Apr 2014 15:03:27 +0900

 > fixed in january (right?)

 No.  There is "Revisit later" log.

 Izumi Tsutsui

State-Changed-From-To: closed->open
State-Changed-When: Sat, 26 Apr 2014 07:22:03 +0000
It would have been nice if any of that traffic had been noted here...


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.