Subject: port-hp300/16686: HP 433t panics when exiting Xhpux on A1416A framebuffer
To: None <gnats-bugs@gnats.netbsd.org>
From: Bernd Sieker <bernd@sidewinder.home.loc>
List: netbsd-bugs
Date: 05/06/2002 12:31:11
>Number:         16686
>Category:       port-hp300
>Synopsis:       HP 433t panics when exiting Xhpux on A1416A framebuffer
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-hp300-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 06 03:32:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Bernd Sieker
>Release:        NetBSD 1.5.3
>Organization:

>Environment:
System: NetBSD sidewinder 1.5.3 NetBSD 1.5.3 (SIDEWINDER) #0: Tue Apr 23 17:50:55 CEST 2002 bernd@sidewinder:/usr/src/sys/arch/hp300/compile/SIDEWINDER hp300
Architecture: m68k
Machine: hp300

HP9000 433t (upgraded 425t), 48MB, diskless, netbooting from NetBSD-1.5.3/i386 server.

kernel includes HPUX emulation, and the Xhpux Xserver was installed following the guide
on http://www.blobulent.com/hp300/X11/

>Description:
When running 
>How-To-Repeat:
Install the Xhpux binaries as outlined in http://www.blobulent.com/hp300/X11/,
start and exit the Xhpux Xserver on a Topcat A1416A framebuffer (maybe others).
Sometimes it causes a kernel panic on exit.
>Fix:
Not known.

Workaround:
As suggested in http://mail-index.netbsd.org/port-hp300/1999/11/09/0000.html
I made a quick-and-dirty patch to grf.c to work around this problem.
This is _not_ a real fix to the problem, but might help some people work around
it for the time being. I'm not an experienced kernel hacker so someone else
will have to do The Right Thing here.

Gregory McGarry <g.mcgarry@ieee.org> asked me to file a PR and make the
workaround available, and as I could not find a PR specific to this problem,
here it is.

Apply the patch, rebuild the kernel and hope for the best. Good Luck.

--- sys/arch/hp300/dev/grf.c.orig       Mon May  6 11:59:55 2002
+++ sys/arch/hp300/dev/grf.c    Mon May  6 12:07:04 2002
@@ -661,7 +661,9 @@
        if (grfdebug & GDB_MMAP)
                printf("grfunmap(%d): dev %x addr %p\n", p->p_pid, dev, addr);
 #endif
-       if (addr == 0)
+       if (addr != (void *) 0x1000000) /* XXX: this is a workaround for using Topcat
+                                          XXX: 8 bit adapters (A1416A) with Xhpux,
+                                          XXX: may not work in any other configuration! */
                return(EINVAL);         /* XXX: how do we deal with this? */
        (void) (*gp->g_sw->gd_mode)(gp, GM_UNMAP, 0);
        size = round_page(gp->g_display.gd_regsize + gp->g_display.gd_fbsize);

>Release-Note:
>Audit-Trail:
>Unformatted: