From owner-acpi-jp@jp.FreeBSD.org Wed Sep 11 04:06:11 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g8AJ6BD33025;
	Wed, 11 Sep 2002 04:06:11 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g8AJ69333005
	for <acpi-jp@jp.FreeBSD.org>; Wed, 11 Sep 2002 04:06:10 +0900 (JST)
	(envelope-from jhb@FreeBSD.org)
Received: (qmail 9365 invoked from network); 10 Sep 2002 19:06:08 -0000
Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender <jhb@FreeBSD.org>)
          by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP
          for <acpi-jp@jp.FreeBSD.org>; 10 Sep 2002 19:06:08 -0000
Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1])
	by server.baldwin.cx (8.12.5/8.12.5) with ESMTP id g8AJ66Bv032444;
	Tue, 10 Sep 2002 15:06:07 -0400 (EDT)
	(envelope-from jhb@FreeBSD.org)
Message-ID: <XFMail.20020910150607.jhb@FreeBSD.org>
X-Mailer: XFMail 1.5.2 on FreeBSD
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <20020911.035217.41626778.iwasaki@jp.FreeBSD.org>
From: John Baldwin <jhb@freebsd.org>
To: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
Cc: imp@bsdimp.com, acpi-jp@jp.FreeBSD.org
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Tue, 10 Sep 2002 15:06:07 -0400
X-Sequence: acpi-jp 1808
Subject: [acpi-jp 1808] Re: acpi issue on my Fiva 205
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: jhb@FreeBSD.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+020902


On 10-Sep-2002 Mitsuru IWASAKI wrote:
>> : I don't feel it's right at all too :-)
>> : Because I couldn't find any functions to write cfg->inline back to PCI.
>> : # maybe pci_write_ivar() or new pci_write_device()?
>> 
>> There's a way...  If nothing else pci_write_config after setting the
>> value in the cfg structure...
> 
> I've recalled pci_cfgregwrite() for this purpose and modified
> acpi_pci_link_set_irq() a bit.  After AcpiSetCurrentResources(),
> write irq to PCI config space.

We shouldn't need this.  When we read the intline, we read it via ivars
using pci_get_irq().  When we route an interrupt for the card bus controller,
we do this:

                        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);
                                resource_list_add(rl, SYS_RES_IRQ, 0,
                                    cfg->intline, cfg->intline, 1);
                        }

So, when the interrupt is routed via ACPI it will get setup properly.  The
LNK fixup code shouldn't have to go messing with any PCI device's intline.

I still need to wrap my head around how the thing to decide which IRQ's
are valid works.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
