Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2246949imm; Wed, 3 Oct 2018 00:25:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV60cPoLl3HKtRMm7aUPdeRml4biCJNyax52Qy7dLthhEe8glOWpCT7So1zeuEALwrNtyMJNL X-Received: by 2002:a17:902:758b:: with SMTP id j11-v6mr204196pll.5.1538551556072; Wed, 03 Oct 2018 00:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538551556; cv=none; d=google.com; s=arc-20160816; b=RKbDFdxgb48r8sqSRWmOPgr9FZhseNUmbdz9e8sQVsOuCTe4uOGbqQWNGQivjZPJyX gQhY6bPPmpkxLOe/zG6GbndvBGTTgtlnRtsFLzZbldFEILZWA1MFcQZrM8HHXsZjDBrk 2nSXH9qys4mxDTzvDMOOrWOxcmZnVe6SYAZqwhc2OXI8m21sWacdFbzk7meWzFs2UFvI cVrffq/kTE8M8cNEuZ8m5Ebe8YRG6FpvM8BrkSuseI2tphwP9RP2y3n/3MmsFDFpqeTn 2o2DoBvTXKmXspN92MuGkUWsOiqxklQVPrTExgC9W67RY90vw0P7WzscIdl0Jtyso8Ee Tg+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=cJH1HjxQrx5C3mRT3oGgU69M9i8izJ2SAFhdC9/uIWw=; b=zBjle666zE9oXhTcjyPh0XFrn8BlwNOACojIvJjaiSRuyVbYQh4EcnaNEQT+I5yhu1 Mc8dlPfv2UiXCWvqXix3QEIkJxJAjhTbjIA1y/IEV0vliujEncd8A/T7FqDghAGysh3a P7agJyFxY2jIqjUUI0EeZdNoVT+Ze7V8m5KsSIE4jjzbWyNSAMP/sc52jN/TxL1s7qdT XYOoW+1SjCGdqu0AcJk84sGLYBTwfBAfR4GxUt0g9t5JtH5qXuwaqDptfxhtP+y5QL4K eZMJb7EHEpTkIeHs67zyrlH5NKu/Sna9ss2lvnDv8qw6sPWzi13YMXElfCz4TIBxajVe q7DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si537410pgw.401.2018.10.03.00.25.41; Wed, 03 Oct 2018 00:25:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbeJCOMf (ORCPT + 99 others); Wed, 3 Oct 2018 10:12:35 -0400 Received: from mga02.intel.com ([134.134.136.20]:33110 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbeJCOMf (ORCPT ); Wed, 3 Oct 2018 10:12:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 00:25:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,335,1534834800"; d="scan'208";a="94192628" Received: from dhenry-mobl.ger.corp.intel.com ([10.252.4.16]) by fmsmga004.fm.intel.com with ESMTP; 03 Oct 2018 00:24:44 -0700 Message-ID: <2787bccf20b6f647de9f4cafae5fd223e771b167.camel@intel.com> Subject: Re: [PATCH 3/3] iwlwifi: Load firmware exclusively for Intel WiFi From: Luciano Coelho To: Kai-Heng Feng , linux-kernel@vger.kernel.org Cc: Johannes Berg , Emmanuel Grumbach , Intel Linux Wireless , Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Wed, 03 Oct 2018 10:24:44 +0300 In-Reply-To: <20181003071513.13004-3-kai.heng.feng@canonical.com> References: <20181003071513.13004-3-kai.heng.feng@canonical.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-10-03 at 15:15 +0800, Kai-Heng Feng wrote: > To avoid the firmware loading race between Bluetooth and WiFi on Intel > 8260, load firmware exclusively when BT_INTEL is enabled. > > Signed-off-by: Kai-Heng Feng > --- Where is this coming from? Can you explain what "the firmware loading race" is? > .../net/wireless/intel/iwlwifi/pcie/trans.c | 37 ++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > index cc8c53dc0ab6..c30d3989e2a8 100644 > --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > @@ -71,6 +71,7 @@ > #include > #include > #include > +#include I don't see this upstream. Is it something that was recently added? Looks odd... Regardless, this should also be protected on CONFIG_BT_INTEL. > #include "iwl-drv.h" > #include "iwl-trans.h" > @@ -1335,6 +1336,10 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, > bool hw_rfkill; > int ret; > > +#if IS_ENABLED(CONFIG_BT_INTEL) > + void (*firmware_lock_func)(void); > + void (*firmware_unlock_func)(void); > +#endif > /* This may fail if AMT took ownership of the device */ > if (iwl_pcie_prepare_card_hw(trans)) { > IWL_WARN(trans, "Exit HW not ready\n"); > @@ -1394,6 +1399,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, > * RF-Kill switch is toggled, we will find out after having loaded > * the firmware and return the proper value to the caller. > */ > + Stray empty line. > iwl_enable_fw_load_int(trans); > > /* really make sure rfkill handshake bits are cleared */ > @@ -1401,8 +1407,37 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, > iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); > > /* Load the given image to the HW */ > - if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000) > + if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000) { > +#if IS_ENABLED(CONFIG_BT_INTEL) > + firmware_lock_func = symbol_request(btintel_firmware_lock); > + firmware_unlock_func = symbol_request(btintel_firmware_unlock); > + if (!firmware_lock_func || !firmware_unlock_func) { > + if (firmware_lock_func) { > + symbol_put(btintel_firmware_lock); > + firmware_lock_func = NULL; > + } > + > + if (firmware_unlock_func) { > + symbol_put(btintel_firmware_unlock); > + firmware_unlock_func = NULL; > + } > + } > + > + if (firmware_lock_func) > + firmware_lock_func(); > +#endif > ret = iwl_pcie_load_given_ucode_8000(trans, fw); > + > +#if IS_ENABLED(CONFIG_BT_INTEL) > + if (firmware_unlock_func) { > + firmware_unlock_func(); > + symbol_put(btintel_firmware_lock); > + firmware_lock_func = NULL; > + symbol_put(btintel_firmware_unlock); > + firmware_unlock_func = NULL; > + } > +#endif > + } > else > ret = iwl_pcie_load_given_ucode(trans, fw); > I'm not sure I like adding this BT-specific stuff here, especially not without a detailed explanation. Did you also send the other patches in this series to linux-wireless? I can't see them... -- Cheers, Luca.