From nobody@FreeBSD.org  Mon Jul 15 21:01:11 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 3BA9A37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Jul 2002 21:01:11 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D160943E42
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Jul 2002 21:01:10 -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 g6G41AOT015424
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 15 Jul 2002 21:01:10 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g6G41A7R015423;
	Mon, 15 Jul 2002 21:01:10 -0700 (PDT)
Message-Id: <200207160401.g6G41A7R015423@www.freebsd.org>
Date: Mon, 15 Jul 2002 21:01:10 -0700 (PDT)
From: Joshua Lee <yid@softhome.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: PCI devices don't share IRQs.
X-Send-Pr-Version: www-1.0

>Number:         40636
>Category:       kern
>Synopsis:       PCI devices don't share IRQs.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 15 21:10:01 PDT 2002
>Closed-Date:    Mon Aug 12 12:49:30 PDT 2002
>Last-Modified:  Wed Aug 14 16:20:01 PDT 2002
>Originator:     Joshua Lee
>Release:        4.6-STABLE
>Organization:
Plan B Software Labs
>Environment:
FreeBSD 4.6-STABLE FreeBSD 4.6-STABLE #1: Mon Jul 15 22:05:16 EDT 2002 yid@: /usr/obj/usr/src/sys/PLANB  i386
>Description:
My PCI modem, a 3COM/USR Peformance Pro, gets IRQ 9 and the equivalent of COM5 (sio4) when configured during bootup. My built-in USB expansion docking station (uhci1) later in the boot-up process request IRQ 9 and is denied it.
>How-To-Repeat:
An internel PCI modem gets an IRQ, other hardware requesting that IRQ are denied.
>Fix:
/usr/src/sys/isa/sio.c

Change sioattach()

From

com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1,
RF_ACTIVE);

to

com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1,
RF_SHAREABLE | RF_ACTIVE);

My thanks to Matthew Emmerton (matt@gsicomp.on.ca) for the solution.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jon 
State-Changed-When: Mon Aug 12 12:48:00 PDT 2002 
State-Changed-Why:  
duplicate pr, see kern/20523 
this pr is also an incomplete solution, as intr_fast shouldn't be shared. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40636 

From: "Matthew Emmerton" <matt@gsicomp.on.ca>
To: <freebsd-gnats-submit@FreeBSD.org>, <jon@FreeBSD.org>,
	<bde@FreeBSD.org>
Cc:  
Subject: Re: kern/40636: PCI devices don't share IRQs.
Date: Wed, 14 Aug 2002 01:19:35 -0400

 How is this a duplicate of kern/20523?  That PR deals with multi-port PCI
 serial devices, where this just deals with single-port PCI serial devices --
 unless it's just a generalization.
 
 The originator of kern/40636 has not seen any performance problems with my
 patch, so unless sharing intr_fast (whatever the heck that is -- I can't
 find any mention of that in the sio.c file) is some very bad thing to do, I
 don't see a problem with my patch.
 
 Can someone please clarify?
 
 --
 Matt Emmerton
 

From: Bruce Evans <bde@zeta.org.au>
To: Matthew Emmerton <matt@gsicomp.on.ca>
Cc: freebsd-gnats-submit@FreeBSD.org, <jon@FreeBSD.org>,
	<bde@FreeBSD.org>
Subject: Re: kern/40636: PCI devices don't share IRQs.
Date: Thu, 15 Aug 2002 09:20:23 +1000 (EST)

 On Wed, 14 Aug 2002, Matthew Emmerton wrote:
 
 > How is this a duplicate of kern/20523?  That PR deals with multi-port PCI
 > serial devices, where this just deals with single-port PCI serial devices --
 > unless it's just a generalization.
 >
 > The originator of kern/40636 has not seen any performance problems with my
 > patch, so unless sharing intr_fast (whatever the heck that is -- I can't
 > find any mention of that in the sio.c file) is some very bad thing to do, I
 > don't see a problem with my patch.
 >
 > Can someone please clarify?
 
 See my earlier reply.  (intr_fast is a misspelling of INTR_FAST in -current
 and INTR_TYPE_FAST in older versions.  Not using it tends to give you silo
 overflows.  I think the patch is better than nothing but it only helps
 if the sio device happens to be attached after another device that shares
 the irq.  The INTR_*_FAST BUS_SETUP_INTR() call must be removed to get
 deterministic behaviour and doing that clearly breaks fast interrupts always.)
 
 Bruce
 
>Unformatted:
