From: Jia-Ju Bai Date: Mon, 4 Jan 2016 07:55:38 +0000 (+0800) Subject: rt2x00pci: Disable memory-write-invalidate when the driver exits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7683fe016c010a20b5f2d88b7d8dad198506f5f7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rt2x00pci: Disable memory-write-invalidate when the driver exits 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 pci_clear_mwi in error handling and removal procedure, which can fix the problem. Signed-off-by: Jia-Ju Bai Acked-by: Helmut Schaa Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c b/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c index d93db4b0371b..eb6dbcd4fddf 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00pci.c @@ -149,6 +149,7 @@ exit_free_device: ieee80211_free_hw(hw); exit_release_regions: + pci_clear_mwi(pci_dev); pci_release_regions(pci_dev); exit_disable_device: @@ -173,6 +174,7 @@ void rt2x00pci_remove(struct pci_dev *pci_dev) /* * Free the PCI device data. */ + pci_clear_mwi(pci_dev); pci_disable_device(pci_dev); pci_release_regions(pci_dev); }