Skip to content

Commit

Permalink
ehci-hcd: Disable memory-write-invalidate when the driver is removed
Browse files Browse the repository at this point in the history
The driver calls pci_set_mwi to enable memory-write-invalidate when it
is initialized, but does not call pci_clear_mwi when it is removed. Many
other drivers calls pci_clear_mwi when pci_set_mwi is called, such as
r8169, 8139cp and e1000.

This patch adds a function "ehci_pci_remove" to remove the pci driver.
This function calls pci_clear_mwi and usb_hcd_pci_remove, which can
fix the problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jia-Ju Bai authored and Greg Kroah-Hartman committed Jan 25, 2016
1 parent d8ff463 commit e3e2e36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/host/ehci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ static int ehci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return usb_hcd_pci_probe(pdev, id);
}

static void ehci_pci_remove(struct pci_dev *pdev)
{
pci_clear_mwi(pdev);
usb_hcd_pci_remove(pdev);
}

/* PCI driver selection metadata; PCI hotplugging uses this */
static const struct pci_device_id pci_ids [] = { {
/* handle any USB 2.0 EHCI controller */
Expand All @@ -396,7 +402,7 @@ static struct pci_driver ehci_pci_driver = {
.id_table = pci_ids,

.probe = ehci_pci_probe,
.remove = usb_hcd_pci_remove,
.remove = ehci_pci_remove,
.shutdown = usb_hcd_pci_shutdown,

#ifdef CONFIG_PM
Expand Down

0 comments on commit e3e2e36

Please sign in to comment.