From patchwork Mon Jan 4 07:55:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 7946251 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E812F9F1C0 for ; Mon, 4 Jan 2016 07:56:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 322382035D for ; Mon, 4 Jan 2016 07:56:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AA412035B for ; Mon, 4 Jan 2016 07:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752185AbcADH4O (ORCPT ); Mon, 4 Jan 2016 02:56:14 -0500 Received: from m12-13.163.com ([220.181.12.13]:43980 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941AbcADH4N (ORCPT ); Mon, 4 Jan 2016 02:56:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=v2P7nbGvyRtqIzK99L GJaUV+VLOuEkQ5Cb1ksq6DMII=; b=JDKSqorQqFn+alSh8Yjpc39SAYEUxOo259 aMnRDaS3HVXy2XAf+SDSBq8RAL/+qCW1dmlZL9x1UWFqODT5nOTtpNpUKehboHYo OHETHZ+/sNq7kXQprsrySQyKCa/9RHBNBYAGPm4ZD/qLqdmf3zVCks7anmGGnCFr kMh4sAHqA= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp9 (Coremail) with SMTP id DcCowAAXy5x2JYpWDL3mBw--.9259S2; Mon, 04 Jan 2016 15:55:39 +0800 (CST) From: Jia-Ju Bai To: sgruszka@redhat.com, helmut.schaa@googlemail.com, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] rt2x00pci: Disable memory-write-invalidate when the driver exits Date: Mon, 4 Jan 2016 15:55:38 +0800 Message-Id: <1451894138-3482-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DcCowAAXy5x2JYpWDL3mBw--.9259S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw1xAF4xuFyftr48tFWUurg_yoWkWFg_ua 109r4kXryDX3Z3tF43ZFW5AryYkr90qrWkGrs2q34SkrWav3srXr4UZr15W34jgr4UZF15 Jr4DJF1Fyw1qvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbOVyDUUUUU== X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/xtbBRQzlelO-zbICEAABsW Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/rt2x00/rt2x00pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index d93db4b..eb6dbcd 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/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); }