From owner-acpi-jp@jp.FreeBSD.org Sat Sep 14 23:50:45 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g8EEojX41511;
	Sat, 14 Sep 2002 23:50:45 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (root@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g8EEoi341503
	for <acpi-jp@jp.FreeBSD.org>; Sat, 14 Sep 2002 23:50:44 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwa@tasogare.imasy.or.jp [202.227.24.5])
	by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id g8EEoeY75045;
	Sat, 14 Sep 2002 23:50:41 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Message-Id: <20020914.235034.59647978.iwasaki@jp.FreeBSD.org>
To: acpi-jp@jp.FreeBSD.org, jhb@freebsd.org
From: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
In-Reply-To: <XFMail.20020913112338.jhb@FreeBSD.org>
References: <20020913.124643.104028373.iwasaki@jp.FreeBSD.org>
	<XFMail.20020913112338.jhb@FreeBSD.org>
X-Mailer: Mew version 2.1 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Sat, 14 Sep 2002 23:50:34 +0900
X-Sequence: acpi-jp 1824
Subject: [acpi-jp 1824] pci_resume method (Re: acpi issue on my Fiva
 205)
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: iwasaki@jp.FreeBSD.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+020902

> > http://people.freebsd.org/~iwasaki/acpi/pci_resume-20020912.diff
> > Note that John's patch included.  Comments welcome!
> ># I can remove pci_cfgwrite() from acpi_pci_link_set_irq() again :-)
> 
> Cool.  One thing you could do is instead of using the records, just
> go and re-route interrupts for all children that have a valid
> intline.  You can get the intpin and bus and stuff from the ivars.
> You can get the bridge device by doing a device_get_parent() on the
> bus device.  Then you don't have to maintain your own separate list.

Ah, yes.  It's easier.  Somethig like this?

Index: dev/pci/pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v
retrieving revision 1.200
diff -u -r1.200 pci.c
--- dev/pci/pci.c	4 Sep 2002 03:53:21 -0000	1.200
+++ dev/pci/pci.c	14 Sep 2002 14:30:03 -0000
@@ -1408,3 +1410,36 @@
 
 	return (0);
 }
+
+int
+pci_resume(device_t dev)
+{
+	int			numdevs;
+	int			i;
+	device_t		*children;
+	device_t		child;
+	struct pci_devinfo	*dinfo;
+	pcicfgregs		*cfg;
+
+	device_get_children(dev, &children, &numdevs);
+
+	for (i = 0; i < numdevs; i++) {
+		child = children[i];
+
+		dinfo = device_get_ivars(child);
+		cfg = &dinfo->cfg;
+		if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
+			cfg->intline = PCIB_ROUTE_INTERRUPT(device_get_parent(dev),
+						child, cfg->intpin);
+			if (PCI_INTERRUPT_VALID(cfg->intline)) {
+				pci_write_config(child, PCIR_INTLINE,
+				    cfg->intline, 1);
+			}
+		}
+	}
+
+	free(children, M_TEMP);
+
+	return (bus_generic_resume(dev));
+}
+

And confirmed that both versions redo interrupt routing at resume time.
I updated whole my patches at:
http://people.freebsd.org/~iwasaki/acpi/pci_resume-20020914.diff

Could you merge them into your interrupt routing changes and
commit them together?

Thanks
