NetBSD Problem Report #46376

From www@NetBSD.org  Wed Apr 25 13:03:36 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id E600A63CD2A
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Apr 2012 13:03:35 +0000 (UTC)
Message-Id: <20120425130335.0809763C4B1@www.NetBSD.org>
Date: Wed, 25 Apr 2012 13:03:35 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
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
>Closed-Date:    
>Last-Modified:  Sun Sep 25 01:47:55 +0000 2016
>Originator:     Nat Sloss
>Release:        NetBSD Current 6.99.5
>Organization:
>Environment:
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

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

It is not possible to have genfb screens and a serial console.
>How-To-Repeat:
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.
>Fix:
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.

Regards,

Nat.

>Release-Note:

>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
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-By: dholland@NetBSD.org
State-Changed-When: Sat, 26 Apr 2014 05:41:15 +0000
State-Changed-Why:
fixed in january (right?)


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: dholland@NetBSD.org, gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
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.
 http://mail-index.netbsd.org/tech-kern/2014/01/15/msg016421.html
 http://mail-index.netbsd.org/source-changes-d/2014/01/27/msg006493.html
 http://mail-index.netbsd.org/source-changes/2014/01/27/msg051262.html
 http://mail-index.netbsd.org/source-changes/2014/01/27/msg051287.html

 ---
 Izumi Tsutsui

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


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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