linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Amitkumar Karwar <akarwar@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rajat Jain <rajatja@google.com>,
	Brian Norris <briannorris@chromium.org>
Subject: [PATCH 3/4] mwifiex: uninit wakeup info when removing device
Date: Fri, 10 Mar 2017 17:39:23 -0800	[thread overview]
Message-ID: <20170311013924.73348-4-briannorris@chromium.org> (raw)
In-Reply-To: <20170311013924.73348-1-briannorris@chromium.org>

We manually init wakeup info, but we don't detach it on device removal.
This means that if we (for example) rmmod + modprobe the driver, the
device framework might return -EEXIST the second time, and we'll
complain in the logs:

[  839.311881] mwifiex_pcie 0000:01:00.0: fail to init wakeup for mwifiex

AFAICT, there's no other negative effect.

But we can fix this by disabling wakeup on remove, similar to what a few
other drivers do (e.g., the power supply framework).

This code (and bug) has existed on SDIO for a while, but it got moved
around and enabled for PCIe with commit 853402a00823 ("mwifiex: Enable
WoWLAN for both sdio and pcie").

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 43d040e02e4d..b62e03d11c2e 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1718,6 +1718,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter)
 	wiphy_unregister(adapter->wiphy);
 	wiphy_free(adapter->wiphy);
 
+	if (adapter->irq_wakeup >= 0)
+		device_init_wakeup(adapter->dev, false);
+
 	/* Unregister device */
 	mwifiex_dbg(adapter, INFO,
 		    "info: unregister device\n");
-- 
2.12.0.246.ga2ecc84866-goog

  parent reply	other threads:[~2017-03-11  1:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-11  1:39 [PATCH 0/4] mwifiex: several bugfixes Brian Norris
2017-03-11  1:39 ` [PATCH 1/4] mwifiex: pcie: don't leak DMA buffers when removing Brian Norris
2017-03-16  8:14   ` [1/4] " Kalle Valo
2017-03-11  1:39 ` [PATCH 2/4] mwifiex: set adapter->dev before starting to use mwifiex_dbg() Brian Norris
2017-03-11  1:39 ` Brian Norris [this message]
2017-03-11  1:39 ` [PATCH 4/4] mwifiex: pcie: de-duplicate buffer allocation code Brian Norris
2017-03-20 17:08   ` [4/4] " Kalle Valo
     [not found]   ` <20170320170835.5ED1C609C6@smtp.codeaurora.org>
2017-03-20 20:05     ` Brian Norris
2017-03-21 12:14       ` Kalle Valo
2017-03-21 15:59         ` Brian Norris
2017-04-28 16:50         ` Brian Norris
2017-05-04 13:11           ` Kalle Valo
2017-05-18 13:33   ` Kalle Valo
     [not found]   ` <20170518133348.6C5C660F63@smtp.codeaurora.org>
2017-05-18 16:30     ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170311013924.73348-4-briannorris@chromium.org \
    --to=briannorris@chromium.org \
    --cc=akarwar@marvell.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nishants@marvell.com \
    --cc=rajatja@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).