From patchwork Wed May 6 00:44:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 6345181 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 A369A9F1C2 for ; Wed, 6 May 2015 01:10:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC8DA20220 for ; Wed, 6 May 2015 01:10:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE8242017D for ; Wed, 6 May 2015 01:10:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965676AbbEFBKl (ORCPT ); Tue, 5 May 2015 21:10:41 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36340 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754380AbbEFBKk (ORCPT ); Tue, 5 May 2015 21:10:40 -0400 Received: by pabsx10 with SMTP id sx10so211055815pab.3; Tue, 05 May 2015 18:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4HwSySWw5JnsEMvvJ2U5lk43T7RjD1ROK1Vv0YFGmpg=; b=VlHpKS0nt+eXyp+oTLwwiAYSw2/Kbn80QKddnKkva+x9bU+2UqPAtoS3lo4Us+DrEs EZMXk0Mu9v9jvRyaywT6QO0efACeIR9Fdwd23uwFAwKHFvJVn7A58x1UTgMK2/JpyKz3 +t+JidbwzRNXckRWlhcb324WK4o9DF5C6XiVMUN43CP9ivamvblw44YNuwTLnJqxzjRq iJfbeeSRIbLORkfrlpnd1hrX2pGSoNSpc6UDGXOylhI5j5C1/wbPPpWhrD/y9pj9zJDU Ii2F+nehbHIleO/BWorsh7XVSs6yHWCLx3SXlMao1HQkCWNRfn0Ss7NlheH/Y59sUptR KZgQ== X-Received: by 10.66.142.137 with SMTP id rw9mr56397681pab.56.1430874640083; Tue, 05 May 2015 18:10:40 -0700 (PDT) Received: from mcgrof@gmail.com (c-98-234-145-61.hsd1.ca.comcast.net. [98.234.145.61]) by mx.google.com with ESMTPSA id x4sm96061pdl.55.2015.05.05.18.10.37 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 May 2015 18:10:39 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Tue, 05 May 2015 18:08:29 -0700 From: "Luis R. Rodriguez" To: rusty@rustcorp.com.au, dhowells@redhat.com, ming.lei@canonical.com, seth.forshee@canonical.com, kyle@kernel.org Cc: akpm@linux-foundation.org, gregkh@linuxfoundation.org, keescook@chromium.org, casey@schaufler-ca.com, tiwai@suse.de, mjg59@srcf.ucam.org, wireless-regdb@lists.infradead.org, linux-wireless@vger.kernel.org, jlee@suse.com, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [RFC v1 11/12] iwlwifi: use sysdata_file_request() and sysdata_file_request_async() Date: Tue, 5 May 2015 17:44:29 -0700 Message-Id: <1430873070-7290-12-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430873070-7290-1-git-send-email-mcgrof@do-not-panic.com> References: <1430873070-7290-1-git-send-email-mcgrof@do-not-panic.com> 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, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 From: "Luis R. Rodriguez" Signed-off-by: Luis R. Rodriguez --- drivers/net/wireless/iwlwifi/iwl-drv.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index c7154ac..f20bda9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -202,7 +203,7 @@ static int iwl_alloc_fw_desc(struct iwl_drv *drv, struct fw_desc *desc, return 0; } -static void iwl_req_fw_callback(const struct firmware *ucode_raw, +static void iwl_req_fw_callback(const struct sysdata_file *ucode_raw, void *context); #define UCODE_EXPERIMENTAL_INDEX 100 @@ -212,6 +213,9 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first) { const char *name_pre = drv->cfg->fw_name_pre; char tag[8]; + const struct sysdata_file_desc fw_desc = { + SYSDATA_DEFAULT_ASYNC(iwl_req_fw_callback, drv), + }; if (first) { #ifdef CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE @@ -256,9 +260,8 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first) ? "EXPERIMENTAL " : "", drv->firmware_name); - return request_firmware_nowait(THIS_MODULE, 1, drv->firmware_name, - drv->trans->dev, - GFP_KERNEL, drv, iwl_req_fw_callback); + return sysdata_file_request_async(drv->firmware_name, &fw_desc, + drv->trans->dev); } struct fw_img_parsing { @@ -453,7 +456,7 @@ static int iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data, } static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv, - const struct firmware *ucode_raw, + const struct sysdata_file *ucode_raw, struct iwl_firmware_pieces *pieces) { struct iwl_ucode_header *ucode = (void *)ucode_raw->data; @@ -554,7 +557,7 @@ static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv, } static int iwl_parse_tlv_firmware(struct iwl_drv *drv, - const struct firmware *ucode_raw, + const struct sysdata_file *ucode_raw, struct iwl_firmware_pieces *pieces, struct iwl_ucode_capabilities *capa) { @@ -1051,7 +1054,8 @@ static void _iwl_op_mode_stop(struct iwl_drv *drv) * If loaded successfully, copies the firmware into buffers * for the card to fetch (via DMA). */ -static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) +static void iwl_req_fw_callback(const struct sysdata_file *ucode_raw, + void *context) { struct iwl_drv *drv = context; struct iwl_fw *fw = &drv->fw; @@ -1210,7 +1214,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; /* We have our copies now, allow OS release its copies */ - release_firmware(ucode_raw); + release_sysdata_file(ucode_raw); mutex_lock(&iwlwifi_opmode_table_mtx); if (fw->mvm_fw) @@ -1262,7 +1266,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) try_again: /* try next, if any */ - release_firmware(ucode_raw); + release_sysdata_file(ucode_raw); if (iwl_request_firmware(drv, false)) goto out_unbind; kfree(pieces); @@ -1271,7 +1275,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) out_free_fw: IWL_ERR(drv, "failed to allocate pci memory\n"); iwl_dealloc_ucode(drv); - release_firmware(ucode_raw); + release_sysdata_file(ucode_raw); out_unbind: kfree(pieces); complete(&drv->request_firmware_complete);