Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213565
b: refs/heads/master
c: 3df7169
h: refs/heads/master
i:
  213563: 283b315
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 2334562 commit c42a2a4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 637ed74ff9e86d8c2979e430309a1fd28c921de9
refs/heads/master: 3df7169e73fc1d71a39cffeacc969f6840cdf52b
4 changes: 3 additions & 1 deletion trunk/drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,10 @@ void usb_hcd_pci_shutdown(struct pci_dev *dev)
return;

if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) &&
hcd->driver->shutdown)
hcd->driver->shutdown) {
hcd->driver->shutdown(hcd);
pci_disable_device(dev);
}
}
EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);

Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,14 @@ ohci_shutdown (struct usb_hcd *hcd)

ohci = hcd_to_ohci (hcd);
ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
ohci_usb_reset (ohci);
ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);

/* If the SHUTDOWN quirk is set, don't put the controller in RESET */
ohci->hc_control &= (ohci->flags & OHCI_QUIRK_SHUTDOWN ?
OHCI_CTRL_RWC | OHCI_CTRL_HCFS :
OHCI_CTRL_RWC);
ohci_writel(ohci, ohci->hc_control, &ohci->regs->control);

/* flush the writes */
(void) ohci_readl (ohci, &ohci->regs->control);
}
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/usb/host/ohci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
return 0;
}

/* nVidia controllers continue to drive Reset signalling on the bus
* even after system shutdown, wasting power. This flag tells the
* shutdown routine to leave the controller OPERATIONAL instead of RESET.
*/
static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci(hcd);

ohci->flags |= OHCI_QUIRK_SHUTDOWN;
ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");

return 0;
}

/*
* The hardware normally enables the A-link power management feature, which
* lets the system lower the power consumption in idle states.
Expand Down Expand Up @@ -332,6 +346,10 @@ static const struct pci_device_id ohci_pci_quirks[] = {
PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
.driver_data = (unsigned long)ohci_quirk_amd700,
},
{
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
.driver_data = (unsigned long) ohci_quirk_nvidia_shutdown,
},

/* FIXME for some of the early AMD 760 southbridges, OHCI
* won't work at all. blacklist them.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/host/ohci.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ struct ohci_hcd {
#define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */
#define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/
#define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */
#define OHCI_QUIRK_SHUTDOWN 0x800 /* nVidia power bug */
// there are also chip quirks/bugs in init logic

struct work_struct nec_work; /* Worker for NEC quirk */
Expand Down
18 changes: 11 additions & 7 deletions trunk/drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
{
void __iomem *base;
u32 control;

if (!mmio_resource_enabled(pdev, 0))
return;
Expand All @@ -177,10 +178,14 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
if (base == NULL)
return;

control = readl(base + OHCI_CONTROL);

/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
#ifndef __hppa__
{
u32 control = readl(base + OHCI_CONTROL);
#ifdef __hppa__
#define OHCI_CTRL_MASK (OHCI_CTRL_RWC | OHCI_CTRL_IR)
#else
#define OHCI_CTRL_MASK OHCI_CTRL_RWC

if (control & OHCI_CTRL_IR) {
int wait_time = 500; /* arbitrary; 5 seconds */
writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
Expand All @@ -194,13 +199,12 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
dev_warn(&pdev->dev, "OHCI: BIOS handoff failed"
" (BIOS bug?) %08x\n",
readl(base + OHCI_CONTROL));

/* reset controller, preserving RWC */
writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
}
}
#endif

/* reset controller, preserving RWC (and possibly IR) */
writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);

/*
* disable interrupts
*/
Expand Down

0 comments on commit c42a2a4

Please sign in to comment.