From owner-freebsd-bugs Sat Jun 29 18: 0:25 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA16737B407 for ; Sat, 29 Jun 2002 18:00:07 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B10043E13 for ; Sat, 29 Jun 2002 18:00:07 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5U107JU015921 for ; Sat, 29 Jun 2002 18:00:07 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5U107kn015920; Sat, 29 Jun 2002 18:00:07 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8E9037B400 for ; Sat, 29 Jun 2002 17:54:02 -0700 (PDT) Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5150243E1D for ; Sat, 29 Jun 2002 17:54:02 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g5U0ruOT017428 for ; Sat, 29 Jun 2002 17:53:56 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.4/8.12.4/Submit) id g5U0ruvu017427; Sat, 29 Jun 2002 17:53:56 -0700 (PDT) Message-Id: <200206300053.g5U0ruvu017427@www.freebsd.org> Date: Sat, 29 Jun 2002 17:53:56 -0700 (PDT) From: Leon Dang To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/40023: pccard initialization & reset errors (fix) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40023 >Category: kern >Synopsis: pccard initialization & reset errors (fix) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 29 18:00:06 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Leon Dang >Release: 4.6 >Organization: >Environment: All versions of FreeBSd 4.x and possibly 5.x >Description: I think I've discovered a few errors in the pccard initialization code. Please fix when possible. They affect 4.x and CURRENT. I've attached the fix below. >How-To-Repeat: >Fix: In sys/pccard/pcic_pci.c:pcic_pci_ti_init(), then lines syscntl &= ~TI113X_SYSCNTL_SMIENB; pci_write_config(dev, TI113X_PCI_SYSTEM_CONTROL, syscntl, 1); should be corrected to syscntl &= ~TI113X_SYSCNTL_SMIENB; pci_write_config(dev, TI113X_PCI_SYSTEM_CONTROL, syscntl, 4); ie, SYSTEM_CONTROL is 4 bytes wide. ***** In sys/pccard/pcic_pci.c:pcic_pci_ti_init(), some cards require system control to be further initialised with the following bits: syscntl |= 0x08000000u ie, use PCI clock **** In sys/pccard/pcic.c:pcic_reset(), there is a logic error: case 3: /* Wait if card needs more time */ .... if (!sp-> getb(sp, PCIC_STATUS) & PCIC_READY) { should be if (!(sp-> getb(sp, PCIC_STATUS) & PCIC_READY)) { I think with this case, if the PCCARD isn't ready yet, then there should be a strict limit on the number of times it retries to reset the card. I've been in a situation where it loops forever. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message