Date: Sat, 29 Jun 2002 17:53:56 -0700 (PDT) From: Leon Dang <zero2k@ausi.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/40023: pccard initialization & reset errors (fix) Message-ID: <200206300053.g5U0ruvu017427@www.freebsd.org>
index | next in thread | raw e-mail
>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
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206300053.g5U0ruvu017427>
