Bug 18994

Summary: PCMCIA sio will happily attach to a used irq line
Product: Base System Reporter: Peter Much <peter>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-RELEASE   
Hardware: Any   
OS: Any   

Description Peter Much 2000-06-03 19:37:42 UTC
>Number:         18994
>Category:       kern
>Synopsis:       PCMCIA sio will happily attach to a used irq line
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 03 15:00:02 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Peter Much
>Release:        FreeBSD 4.0-RELEASE i386
>Organization:
n/a
>Environment:

	Any PCMCIA card containing a standard sio interface, e.g.
        modem cards.

>Description:

	If the irq line that is defined in /etc/pccard.conf
        for that card is already in use by some other device,
        the sio driver will nevertheless attach the card to
        that irq line - or so it seems at last.

>How-To-Repeat:

	define irq 8 (that's rtc) in /etc/pccard.conf for 
        some modem card, restart pccardd and plug the card
        in. 
        This will be accepted, and the card will work (somehow
        at least...)

>Fix:

	In sys/isa/sio.c, right at the end of sioattach(), 
        the irq line is given to bus_alloc_resource(). If 
	this succeeds, BUS_SETUP_INTR() is called. If it does
        not succeed, nothing is done and sioattach returns
        successfully. This should be changed.


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Comment 1 Peter Much 2000-06-03 23:00:02 UTC
	If the irq line that is defined in /etc/pccard.conf
        for that card is already in use by some other device,
        the sio driver will nevertheless attach the card to
        that irq line - or so it seems at last.

Fix: 

In sys/isa/sio.c, right at the end of sioattach(), 
        the irq line is given to bus_alloc_resource(). If 
	this succeeds, BUS_SETUP_INTR() is called. If it does
        not succeed, nothing is done and sioattach returns
        successfully. This should be changed.
How-To-Repeat: 
	define irq 8 (that's rtc) in /etc/pccard.conf for 
        some modem card, restart pccardd and plug the card
        in. 
        This will be accepted, and the card will work (somehow
        at least...)
Comment 2 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-06-05 12:14:39 UTC
Responsible Changed
From-To: freebsd-bugs->imp

This is Warner's league.  And he's the resident pccard meister/maintainer.
Comment 3 Warner Losh freebsd_committer freebsd_triage 2000-11-06 19:56:14 UTC
State Changed
From-To: open->closed

mihira-san has fixed this, at least for attached devices.  NEWCARD doesn't have 
this problem.