From owner-freebsd-bugs Mon Aug 7 6:10:10 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C559737B78C for ; Mon, 7 Aug 2000 06:10:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id GAA71167; Mon, 7 Aug 2000 06:10:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from bigblue.cdg.chalmers.se (bigblue.cdg.chalmers.se [129.16.12.19]) by hub.freebsd.org (Postfix) with ESMTP id 390C237B570 for ; Mon, 7 Aug 2000 06:07:21 -0700 (PDT) (envelope-from pa@bigblue.cdg.chalmers.se) Received: (from pa@localhost) by bigblue.cdg.chalmers.se (8.9.3/8.9.3) id PAA00340; Mon, 7 Aug 2000 15:07:12 +0200 (CEST) (envelope-from pa) Message-Id: <200008071307.PAA00340@bigblue.cdg.chalmers.se> Date: Mon, 7 Aug 2000 15:07:12 +0200 (CEST) From: pa@cdg.chalmers.se Reply-To: pa@cdg.chalmers.se To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/20454: pccardd looses track of available I/O space Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20454 >Category: bin >Synopsis: pccardd looses track of available I/O space >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 07 06:10:05 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Per Andersson >Release: FreeBSD 4.1-STABLE i386 >Organization: >Environment: 4.1-STABLE from about 2000-08-01 IBM Tp570E + 3Com 3C574 cardc.c: "$FreeBSD: src/usr.sbin/pccard/pccardd/cardd.c,v 1.46.2.4 2000/07/18 04:59:39 imp Exp $"; >Description: If pccardd fails to allocate I/O space when you insert a card it will release the cards I/O space in the wrong place when you remove it. >How-To-Repeat: Make an pccard.conf with to little I/O space: ------------------------------------------------ # PCCARD configuration file # # Removing all IRQ conflicts from this file can't be done because of some # IRQ-selfish PC-cards. So if you want to use some of these cards in # your machine, you will be forced to modify their IRQ parameters from # the following list. # # IRQ == 0 means "allocate free IRQ from IRQ pool" # IRQ == 16 means "do not use IRQ (e.g. PIO mode)" # # # Generally available IO ports io 0x300-0x310 # Generally available IRQs (Built-in sound-card owners remove 5) irq 3 5 # Available memory slots memory 0xd4000 96k # debuglevel 9 # 3Com Megahertz 574B card "3Com" "Megahertz 574B" config 0x1 "ep0" ? 0x1 insert /etc/pccard_ether $device remove /sbin/ifconfig $device delete ------------------------------------------------ Insert card: Aug 7 14:27:59 bigblue pccardd[47]: Card "3Com"("Megahertz 574B") [B] [001] matched "3Com" ("Megahertz 574B") [(null)] [(null)] Aug 7 14:27:59 bigblue pccardd[47]: Resource allocation failure for 3Com Remove card: Aug 7 14:28:08 bigblue /kernel: pccard: card removed, slot 1 Aug 7 14:28:08 bigblue pccardd[47]: ep0: 3Com (Megahertz 574B) removed. Aug 7 14:28:08 bigblue pccardd[47]: Releasing I/O addr 0x0, size 32 (I have added the above log message) Insert card again: Aug 7 14:28:21 bigblue /kernel: pccard: card inserted, slot 1 Machine either crashes or hangs. >Fix: Works for me, but might not be the best solution: *** cardd.c.orig Thu Aug 3 17:15:21 2000 --- cardd.c Mon Aug 7 14:59:14 2000 *************** *** 204,213 **** sp->cis = 0; sp->config = 0; /* release io */ ! bit_nset(io_avail, sp->io.addr, sp->io.addr + sp->io.size - 1); /* release irq */ ! if (sp->irq) pool_irq[sp->irq] = 1; } /* CIS string comparison */ --- 204,218 ---- sp->cis = 0; sp->config = 0; /* release io */ ! if(sp->io.addr) { ! logmsg("Releasing I/O addr 0x%x, size %d\n", sp->io.addr, sp->io.size); ! bit_nset(io_avail, sp->io.addr, sp->io.addr + sp->io.size - 1); ! } /* release irq */ ! if (sp->irq) { ! logmsg("Releasing IRQ %d\n", sp->irq); pool_irq[sp->irq] = 1; + } } /* CIS string comparison */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message