Date: Sun, 12 Jul 1998 22:32:14 -0700 (PDT) From: mburgett@awen.com To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: i386/7266: PSM detection problem with console switch Message-ID: <199807130532.WAA00553@firedraig.awen.com>
next in thread | raw e-mail | index | archive | help
>Number: 7266 >Category: i386 >Synopsis: PSM detection failure with Linksys console switch >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 12 22:40:00 PDT 1998 >Last-Modified: >Originator: Mike Burgett >Organization: None >Release: FreeBSD 3.0-980709-SNAP i386 >Environment: Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 3.0-980709-SNAP #3: Sun Jul 12 22:05:38 PDT 1998 root@firedraig.awen.com:/usr/src/sys/compile/FIREDRAIG CPU: Pentium Pro (686-class CPU) Origin = "GenuineIntel" Id = 0x617 Stepping=7 Features=0xfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV> real memory = 268435456 (262144K bytes) avail memory = 258809856 (252744K bytes) FreeBSD/SMP: Multiprocessor motherboard cpu0 (BSP): apic id: 1, version: 0x00040011, at 0xfee00000 cpu1 (AP): apic id: 0, version: 0x00040011, at 0xfee00000 io0 (APIC): apic id: 2, version: 0x00170011, at 0xfec00000 >Description: With the Linksys SVIEW04 Console switch inline, PSM is not detected. Turning on PSM debugging in the kernel revealed some functions returning PSM_RESEND, and with failure code being sent if result != PSM_ACK. Adding a loop to disble_aux_dev allows PSM to correctly detect, though some resends on status checks are still returned as errors. >How-To-Repeat: Boot system with Linksys console switch attached, and system screen selected or not. With debugging on, a failure should be observed at this section of the function psmprobe() (I think, this code fragment occurs in psm_reinitialize() as well.) if (!enable_aux_dev(sc->kbdc) || !disable_aux_dev(sc->kbdc)) { /* MOUSE ERROR */ restore_controller(sc->kbdc, command_byte); if (verbose) printf("psm%d: failed to enable the aux device.\n", unit); endprobe(0); } The call to enable_aux_dev returns a good result, but the disable_aux_dev returns a PSM_RESEND, which is interpreted as a failure, instead of being retried. With the work-around below, the following can be observed: psm0: current command byte:0047 psm: ENABLE_DEV return code:00fa psm: DISABLE_DEV return code:00fe psm: DISABLE_DEV return code:00fa psm: SEND_AUX_DEV_STATUS return code:00fa indicating that the first disable_aux_dev is still returing the PSM_RESEND, but is succeeding on the second attempt. I suspect there are other places where retry needs to be detected and implemented (I've seen PSM_RESEND returned in the send_aux_command() call in get_mouse_status().) >Fix: I did the following as a work around: original: static int disable_aux_dev(KBDC kbdc) { int res; res = send_aux_command(kbdc, PSMC_DISABLE_DEV); if (verbose >= 2) log(LOG_DEBUG, "psm: DISABLE_DEV return code:%04x\n", res); return (res == PSM_ACK); } hack: static int disable_aux_dev(KBDC kbdc) { int res = PSM_RESEND; int maxretry = 10; /* don't want to retry forever */ while ((res == PSM_RESEND) && (maxretry--)) { res = send_aux_command(kbdc, PSMC_DISABLE_DEV); if (verbose >= 2) log(LOG_DEBUG, "psm: DISABLE_DEV return code:%04x\n", res); } return (res == PSM_ACK); } >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807130532.WAA00553>