NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/46376: genfb_pci takes over serial console when it attaches.



>Number:         46376
>Category:       kern
>Synopsis:       genfb_pci takes over serial console when it attaches.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 25 13:05:00 +0000 2012
>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.



Home | Main Index | Thread Index | Old Index