Commit f2ed2d69 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] proper bios handoff in ehci-hcd

Stuart Hayes here at Dell has identified this or/and mix-up in the
ehci-hcd driver.  Because of this, ehci-hcd is not properly released by
BIOSes supporting full 2.0 and port behavior can then become erratic.

(Code predates general availability of such BIOS firmware.  This version
of the patch also fixes minor linewrap issues.)

 From:          Gary Lerhaupt <Gary_Lerhaupt@Dell.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent a2cb0a8f
......@@ -290,16 +290,17 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
{
if (cap & (1 << 16)) {
int msec = 500;
struct pci_dev *pdev = to_pci_dev(ehci->hcd.self.controller);
/* request handoff to OS */
cap &= 1 << 24;
pci_write_config_dword (to_pci_dev(ehci->hcd.self.controller), where, cap);
cap |= 1 << 24;
pci_write_config_dword(pdev, where, cap);
/* and wait a while for it to happen */
do {
msleep(10);
msec -= 10;
pci_read_config_dword (to_pci_dev(ehci->hcd.self.controller), where, &cap);
pci_read_config_dword(pdev, where, &cap);
} while ((cap & (1 << 16)) && msec);
if (cap & (1 << 16)) {
ehci_err (ehci, "BIOS handoff failed (%d, %04x)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment