From patchwork Wed Mar 30 14:04:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 8697051 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23A13C0553 for ; Wed, 30 Mar 2016 14:08:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7C7620384 for ; Wed, 30 Mar 2016 14:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A793A2037E for ; Wed, 30 Mar 2016 14:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbcC3OFl (ORCPT ); Wed, 30 Mar 2016 10:05:41 -0400 Received: from mga14.intel.com ([192.55.52.115]:59098 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753022AbcC3OFk (ORCPT ); Wed, 30 Mar 2016 10:05:40 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 30 Mar 2016 07:05:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,416,1455004800"; d="scan'208";a="678001645" Received: from egrumbacbox.jer.intel.com ([10.12.124.189]) by FMSMGA003.fm.intel.com with ESMTP; 30 Mar 2016 07:05:18 -0700 From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Matti Gottlieb , Emmanuel Grumbach Subject: [PATCH 02/43] iwlwifi: mvm: Decrease size of the paging download buffer Date: Wed, 30 Mar 2016 17:04:34 +0300 Message-Id: <1459346715-7954-2-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459346667.4731.9.camel@intel.com> References: <1459346667.4731.9.camel@intel.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=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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: Matti Gottlieb Currently the driver has 2 buffers for paging: 1. paging db - this contains all of the pages that were in the FW image, that the driver stores for the FW. This is allocated for each block separately (not contiguous). 2. download buffer - we need to provide this empty buffer for the iwl_sdio_load_fw_chunk function to copy the requested pages to the shared memory. This is one big buffer of contiguous memory whose size is the size of all the blocks that the fw paging section can contain. This download buffer size is too big, and causes the allocation to fail sometimes. Since the driver allocates memory for each block separately, it is not possible for the FW to request all of the pages in one request (the FW gives an address and size, so blocks need to be contiguous for this to happen), therefore the FW is limited to request only one block. Decrease the size of the paging download buffer to be the size of a paging block. Signed-off-by: Matti Gottlieb Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 594cd0d..ebbadcf 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -410,7 +410,9 @@ static int iwl_trans_get_paging_item(struct iwl_mvm *mvm) goto exit; } - mvm->trans->paging_download_buf = kzalloc(MAX_PAGING_IMAGE_SIZE, + /* Add an extra page for headers */ + mvm->trans->paging_download_buf = kzalloc(PAGING_BLOCK_SIZE + + FW_PAGING_SIZE, GFP_KERNEL); if (!mvm->trans->paging_download_buf) { ret = -ENOMEM;