public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Grzegorz Kulewski <kangur@polcom.net>,
	Andrew Morton <akpm@osdl.org>,
	ACPI List <acpi-devel@lists.sourceforge.net>,
	lkml <linux-kernel@vger.kernel.org>,
	shaohua.li@intel.com, Len Brown <len.brown@intel.com>
Subject: Re: [ACPI] Re: Fw: Anybody? 2.6.11 (stable and -rc) ACPI breaks USB
Date: Wed, 16 Mar 2005 09:10:36 -0700	[thread overview]
Message-ID: <1110989436.8378.19.camel@eeyore> (raw)
In-Reply-To: <Pine.LNX.4.61.0503151543420.23036@montezuma.fsmlabs.com>

On Tue, 2005-03-15 at 16:02 -0700, Zwane Mwaikambo wrote:
> On Tue, 15 Mar 2005, Bjorn Helgaas wrote:
> > That seems awfully suspicious to me.  So the following is
> > probably safe as far as it goes, but not sufficient for all
> > cases.
> 
> VIA bridges allow for IRQ routing updates by programming 
> PCI_INTERRUPT_LINE, so it is supposed to work even if we do it for all the 
> devices, so it appears to be a board/bios specific problem.

This just feels like a sledgehammer approach, i.e., we're
programming PCI_INTERRUPT_LINE in more cases that we actually
need to.  I especially don't like that any Via device with
devfn==0 triggers the quirk.  That doesn't seem like the
right test if we're really looking for a Via bridge.

> > -static void __devinit quirk_via_bridge(struct pci_dev *pdev)
> > +static void __devinit quirk_via_irqpic(struct pci_dev *dev)
> >  {
> > -	if(pdev->devfn == 0) {
> > -		printk(KERN_INFO "PCI: Via IRQ fixup\n");
> > -		via_interrupt_line_quirk = 1;
> > +	u8 irq, new_irq = dev->irq & 0xf;
> > +
> > +	pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
> > +	if (new_irq != irq) {
> > +		printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
> > +			pci_name(dev), irq, new_irq);
> > +		udelay(15);
> > +		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
> >  	}
> >  }
> > -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_ANY_ID,                     quirk_via_bridge );
> > +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irqpic);
> > +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irqpic);
> > +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_6, quirk_via_irqpic);
> > +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_5,   quirk_via_irqpic);
> > +DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_7,   quirk_via_irqpic);
> 
> This looks like it'll only affect the PCI device associated with the 
> listed south bridges, which might break systems which relied on the per 
> device setting. Your 'debug' patch actually made sense to me, that is, 
> moving the PCI_INTERRUPT_LINE fixup at gsi register.

Yes, that's what I meant by the above probably not being sufficient.

The main thing the debug patch did was to move the write to after
the IOAPIC programming.  (And I think it added back the mysterious
udelay().)  My point is that the write could just as easily be done
in a pci_enable fixup, because that also happens after the IOAPIC
update.

The quirk would have to be something like this:

	static void __devinit quirk_via_irq(struct pci_dev *dev)
	{
		if  (!via_interrupt_line_quirk)
			return;

		/* update PCI_INTERRUPT_LINE */
		...
	}
	DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, quirk_via_irq);

with a PCI_FIXUP_HEADER quirk that sets via_interrupt_line_quirk when
we find a Via bridge.

But I'm uneasy even about this -- what if there are multiple bridges,
with only one of them being a Via?  Why would we want to apply this
quirk to the devices under the non-Via bridges?  Wouldn't it be better
to search up the hierarchy of each device, looking for a Via bridge,
and apply the quirk only if we find one?


  reply	other threads:[~2005-03-16 16:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050304234622.63e8a335.akpm@osdl.org>
2005-03-10 23:08 ` Fw: Anybody? 2.6.11 (stable and -rc) ACPI breaks USB Grzegorz Kulewski
2005-03-11 16:48   ` [ACPI] " Bjorn Helgaas
2005-03-11 19:36     ` Grzegorz Kulewski
2005-03-11 20:56       ` Bjorn Helgaas
2005-03-11 21:47         ` Grzegorz Kulewski
2005-03-11 22:29           ` Bjorn Helgaas
2005-03-12  0:13             ` Grzegorz Kulewski
2005-03-13 15:14             ` Grzegorz Kulewski
2005-03-15 19:35               ` Bjorn Helgaas
2005-03-15 23:02                 ` Zwane Mwaikambo
2005-03-16 16:10                   ` Bjorn Helgaas [this message]
2005-03-17  1:33                     ` Li Shaohua
2005-03-17 18:08                       ` Bjorn Helgaas
2005-03-18  1:09                         ` Li Shaohua
2005-03-18 18:07                           ` Bjorn Helgaas
2005-03-21 16:33                             ` Bjorn Helgaas
2005-03-21 23:33                               ` Grzegorz Kulewski
2005-03-22 20:57                                 ` Bjorn Helgaas
2005-03-23  0:54                                   ` Li Shaohua
2005-03-23  3:57                                     ` Bjorn Helgaas
2005-03-23 18:40                                       ` Len Brown
2005-03-24 18:24                                         ` Bjorn Helgaas
2005-03-25 19:07                                           ` Len Brown
2005-03-14  9:30 Li, Shaohua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1110989436.8378.19.camel@eeyore \
    --to=bjorn.helgaas@hp.com \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=akpm@osdl.org \
    --cc=kangur@polcom.net \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox