From patchwork Sat Mar 11 01:39:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9618307 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F211E60578 for ; Sat, 11 Mar 2017 01:40:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4C4B2879C for ; Sat, 11 Mar 2017 01:40:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9975287B2; Sat, 11 Mar 2017 01:40:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78A6C287AF for ; Sat, 11 Mar 2017 01:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933908AbdCKBjz (ORCPT ); Fri, 10 Mar 2017 20:39:55 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34587 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933057AbdCKBjd (ORCPT ); Fri, 10 Mar 2017 20:39:33 -0500 Received: by mail-pf0-f170.google.com with SMTP id v190so48012772pfb.1 for ; Fri, 10 Mar 2017 17:39:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rjm/ejQAWMD0JiZghf9DS4wxRraqMlzrp59EQPhhseM=; b=aIFr5hCMFs0SqQUWGWywJMj/Blw+Z4KObK8PsHVp/m5NF+Qt2qIf0XNhhrcs1cv2fS X3BVQAAD33WfjDESMG2PlJsdwtK/GUXKX2+L2BBTIMZqBZVB3YehUNOsU/iysr9cbLPr boHT514iq7ggHUcVT//CPGIrS4kU0r0oZYQTQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rjm/ejQAWMD0JiZghf9DS4wxRraqMlzrp59EQPhhseM=; b=LwGShXqSqKR0dDtRWrSUFEVCsvKt+LFNs4Pwj1Spu7h3YO8gCoel4/6YjfFsg4AP7Z Lw5t+evuDwSPVP21BBoyTKsC0xwtIngHF9eG8JQ/lBUfuWbk9nN9KFn16EK7nx2RCEHi FSGGVJ1mIj3Tj2GUcW7iyUHDAyuUYT8+8IMh+Pn7nB6FERt5g6zWvWkDtrPDKlKJlE1K SSAWG1LfQ1USdACwKMSAt/GIdnkuajMjQzRxVy8DfHSSHdd5brL5HyKH3uezrNKFHzeh nt4JE6w3eTE/gnRJFgGSSPEvE7dt7bIgGoDBZx2wJwxwjlmADmhlKtoiqkDodd7wVpdI DDdw== X-Gm-Message-State: AMke39lf6CoAZysvtVN3TrmXI7ho46ZIjXslzZy6SrFJDNkD/E0+0ifFdYiNA+eiN/1Q8m/n X-Received: by 10.98.223.76 with SMTP id u73mr24431063pfg.147.1489196372647; Fri, 10 Mar 2017 17:39:32 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id t133sm20984084pgc.24.2017.03.10.17.39.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Mar 2017 17:39:32 -0800 (PST) From: Brian Norris To: Amitkumar Karwar , Nishant Sarmukadam Cc: Kalle Valo , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Rajat Jain , Brian Norris Subject: [PATCH 3/4] mwifiex: uninit wakeup info when removing device Date: Fri, 10 Mar 2017 17:39:23 -0800 Message-Id: <20170311013924.73348-4-briannorris@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170311013924.73348-1-briannorris@chromium.org> References: <20170311013924.73348-1-briannorris@chromium.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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");