From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: johannes.berg@intel.com, luciano.coelho@intel.com,
emmanuel.grumbach@intel.com, tj@kernel.org,
arjan@linux.intel.com, ming.lei@canonical.com, zajec5@gmail.com
Cc: jeyu@redhat.com, rusty@rustcorp.com.au, pmladek@suse.com,
gregkh@linuxfoundation.org, linuxwifi@intel.com,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [RFC 5/5] iwlwifi: convert final opmode work into a workqueue
Date: Thu, 16 Feb 2017 18:09:03 -0800 [thread overview]
Message-ID: <20170217020903.6370-6-mcgrof@kernel.org> (raw)
In-Reply-To: <20170217020903.6370-1-mcgrof@kernel.org>
This lets us offload and share all the final opmode related work
necessary for either an opmode driver or new device. This has the most
impact for opmode drivers as this now offloads opmode start for each
device onto the workqueue.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 6cfbc3c6e0d6..d39a5c73afdc 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -145,6 +145,8 @@ static struct iwlwifi_opmode_table {
[DVM_OP_MODE] = { .name = "iwldvm", .ops = NULL },
[MVM_OP_MODE] = { .name = "iwlmvm", .ops = NULL },
};
+static void iwlwifi_opmode_dowork(struct work_struct *work);
+static DECLARE_WORK(iwlwifi_opmode_work, iwlwifi_opmode_dowork);
#define IWL_DEFAULT_SCAN_CHANNELS 40
@@ -1291,7 +1293,7 @@ static void iwlwifi_opmode_start(struct iwlwifi_opmode_table *op)
iwlwifi_opmode_start_drv(op, drv);
}
-static void iwlwifi_opmode_dowork(void)
+static void iwlwifi_opmode_dowork(struct work_struct *unused_work)
{
unsigned int i;
struct iwlwifi_opmode_table *op;
@@ -1530,7 +1532,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
mutex_unlock(&iwlwifi_opmode_table_mtx);
- iwlwifi_opmode_dowork();
+ schedule_work(&iwlwifi_opmode_work);
goto free;
try_again:
@@ -1614,6 +1616,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans)
void iwl_drv_stop(struct iwl_drv *drv)
{
wait_for_completion(&drv->request_firmware_complete);
+ cancel_work_sync(&iwlwifi_opmode_work);
_iwl_op_mode_stop(drv);
@@ -1667,7 +1670,7 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
mutex_unlock(&iwlwifi_opmode_table_mtx);
if (!ret)
- iwlwifi_opmode_dowork();
+ schedule_work(&iwlwifi_opmode_work);
return ret;
}
--
2.11.0
next prev parent reply other threads:[~2017-02-17 2:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 2:08 [RFC 0/5] iwlwifi: enhance final opmode work Luis R. Rodriguez
2017-02-17 2:08 ` [RFC 1/5] iwlwifi: fix drv cleanup on opmode registration failure Luis R. Rodriguez
2017-02-19 9:16 ` Grumbach, Emmanuel
2017-02-20 17:32 ` Luis R. Rodriguez
2017-02-17 2:09 ` [RFC 2/5] iwlwifi: fix request_module() use Luis R. Rodriguez
2017-02-19 9:47 ` Grumbach, Emmanuel
2017-02-21 2:23 ` Luis R. Rodriguez
2017-02-21 7:16 ` Grumbach, Emmanuel
2017-02-21 18:15 ` Luis R. Rodriguez
2017-02-21 20:17 ` Luis R. Rodriguez
2017-02-22 0:18 ` Luis R. Rodriguez
2017-02-22 2:09 ` [PATCH v2 0/2] iwlwifi: corner case fix and request module changes Luis R. Rodriguez
2017-02-22 2:09 ` [PATCH v2 1/2] iwlwifi: fix drv cleanup on opmode registration failure Luis R. Rodriguez
2017-02-22 2:09 ` [PATCH v2 2/2] iwlwifi: simplify requesting ops module Luis R. Rodriguez
2017-02-22 2:10 ` [PATCH v2 0/2] iwlwifi: share opmode start code Luis R. Rodriguez
2017-02-22 2:10 ` [PATCH v2 1/2] iwlwifi: share opmode start work code Luis R. Rodriguez
2017-02-22 2:10 ` [PATCH v2 2/2] iwlwifi: convert final opmode work into a workqueue Luis R. Rodriguez
2017-02-17 2:09 ` [RFC 3/5] iwlwifi: share opmode start work code Luis R. Rodriguez
2017-02-17 2:09 ` [RFC 4/5] iwlwifi: move opmode loading to shared routine Luis R. Rodriguez
2017-02-17 2:09 ` Luis R. Rodriguez [this message]
2017-03-01 7:12 ` [RFC 0/5] iwlwifi: enhance final opmode work Johannes Berg
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=20170217020903.6370-6-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=arjan@linux.intel.com \
--cc=emmanuel.grumbach@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeyu@redhat.com \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwifi@intel.com \
--cc=luciano.coelho@intel.com \
--cc=ming.lei@canonical.com \
--cc=pmladek@suse.com \
--cc=rusty@rustcorp.com.au \
--cc=tj@kernel.org \
--cc=zajec5@gmail.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).