From nobody@FreeBSD.org  Sat Jun 29 17:54:02 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E8E9037B400
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <zero2k@ausi.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pccard initialization & reset errors (fix)
X-Send-Pr-Version: www-1.0

>Number:         40023
>Category:       kern
>Synopsis:       pccard initialization & reset errors (fix)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 29 18:00:06 PDT 2002
>Closed-Date:    Sun Sep 29 12:55:26 MDT 2002
>Last-Modified:  Sun Sep 29 12:55:26 MDT 2002
>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:
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sat Aug 24 05:55:12 PDT 2002 
Responsible-Changed-Why:  
Over to pccard maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40023 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Sun Sep 29 12:42:43 MDT 2002 
State-Changed-Why:  
Most of these are fixed, except the PCI_CLOCK issue.  If it really is 
a problem, a new PR will be opened. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=40023 
>Unformatted:
