From: Bjorn Helgaas <bhelgaas@google.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
USB list <linux-usb@vger.kernel.org>,
"Chen, Jamie" <jamie.chen@intel.com>,
"Tsai, Gaggery" <gaggery.tsai@intel.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: EHCI host broken -- interrupts disabled
Date: Fri, 17 Jan 2014 11:22:31 -0700 [thread overview]
Message-ID: <20140117182231.GA18421@google.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401161435350.1109-100000@iolanthe.rowland.org>
On Thu, Jan 16, 2014 at 02:40:35PM -0500, Alan Stern wrote:
> On Thu, 16 Jan 2014, Bjorn Helgaas wrote:
>
> > I think dev->irq is supposed to be valid after pci_enable_device(), so
> > it seems like it would make sense to clear PCI_COMMAND_INTX_DISABLE
> > there.
>
> Okay.
>
> > I don't know why a BIOS would leave PCI_COMMAND_INTX_DISABLE set for
> > the EHCI device. Does it support MSI, and the BIOS assumes the OS
> > should use that? I don't see any MSI support in the EHCI code. In
>
> As far as I know, there aren't any EHCI designs that use MSI. And
> there is no particular reason why a BIOS would leave INTX_DISABLE set,
> although come to think of it, there doesn't seem to be any reason why a
> BIOS should leave that bit clear either.
>
> > any case, this doesn't seem like something we need to depend on the
> > BIOS to do for us.
>
> Could you post a patch for Gaggery or Jamie to try out?
Can you try the patch below? This is against 6e2d98dc1af4, the tip of the
PCI "next" branch, but it should apply easily to any recent kernel.
Can you also collect the dmesg and "lspci -vv" output for reference, in
case we need to tweak or rework this in the future? Please remove any
non-public details from that information before posting it.
Bjorn
PCI: Enable INTx if BIOS left it disabled
From: Bjorn Helgaas <bhelgaas@google.com>
Some firmware leaves the Interrupt Disable bit set even if the device uses
INTx interrupts. Clear Interrupt Disable so we get those interrupts.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/pci.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b6d4afa8ba40..0b6a1119b818 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1181,6 +1181,8 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state);
static int do_pci_enable_device(struct pci_dev *dev, int bars)
{
int err;
+ u16 cmd;
+ u8 pin;
err = pci_set_power_state(dev, PCI_D0);
if (err < 0 && err != -EIO)
@@ -1190,6 +1192,14 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)
return err;
pci_fixup_device(pci_fixup_enable, dev);
+ pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
+ if (pin) {
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ if (cmd & PCI_COMMAND_INTX_DISABLE)
+ pci_write_config_word(dev, PCI_COMMAND,
+ cmd & ~PCI_COMMAND_INTX_DISABLE);
+ }
+
return 0;
}
next prev parent reply other threads:[~2014-01-17 18:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140114181721.GC12126@xanatos>
[not found] ` <Pine.LNX.4.44L0.1401141336020.1310-100000@iolanthe.rowland.org>
2014-01-16 17:32 ` EHCI host broken -- interrupts disabled Bjorn Helgaas
2014-01-16 19:40 ` Alan Stern
2014-01-17 18:22 ` Bjorn Helgaas [this message]
2014-01-20 12:15 ` Chen, Jamie
2014-01-20 19:39 ` Sarah Sharp
2014-01-20 20:36 ` Greg KH
2014-01-30 0:04 ` Bjorn Helgaas
2014-02-11 23:24 ` Bjorn Helgaas
[not found] ` <F01C6967BCFFB14E8DF7F5D2FD1053EB1ECC22@PGSMSX103.gar.corp.intel.com>
2014-02-14 20:47 ` Bjorn Helgaas
2014-02-14 22:27 ` Sarah Sharp
2014-02-14 22:37 ` Bjorn Helgaas
2014-01-21 19:15 ` USB EHCI broken on Celeron N2920 (Bay Trail) Sarah Sharp
2014-01-22 1:41 ` Chris Cheng
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=20140117182231.GA18421@google.com \
--to=bhelgaas@google.com \
--cc=gaggery.tsai@intel.com \
--cc=jamie.chen@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.