From owner-freebsd-bugs Sun Jul 12 22:40:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA13853 for freebsd-bugs-outgoing; Sun, 12 Jul 1998 22:40:39 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA13839 for ; Sun, 12 Jul 1998 22:40:27 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id WAA26261; Sun, 12 Jul 1998 22:40:01 -0700 (PDT) Received: from firedraig.awen.com (firedraig.awen.com [207.33.155.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA13188 for ; Sun, 12 Jul 1998 22:31:18 -0700 (PDT) (envelope-from mburgett@firedraig.awen.com) Received: (from mburgett@localhost) by firedraig.awen.com (8.9.1/8.8.8) id WAA00553; Sun, 12 Jul 1998 22:32:14 -0700 (PDT) (envelope-from mburgett) Message-Id: <199807130532.WAA00553@firedraig.awen.com> Date: Sun, 12 Jul 1998 22:32:14 -0700 (PDT) From: mburgett@awen.com Reply-To: mburgett@awen.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: i386/7266: PSM detection problem with console switch Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 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