From patchwork Mon Dec 20 12:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 12687823 X-Patchwork-Delegate: luca@coelho.fi Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43E6EC433F5 for ; Mon, 20 Dec 2021 12:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbhLTMd1 (ORCPT ); Mon, 20 Dec 2021 07:33:27 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:51532 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230089AbhLTMd0 (ORCPT ); Mon, 20 Dec 2021 07:33:26 -0500 Received: from 91-156-5-105.elisa-laajakaista.fi ([91.156.5.105] helo=kveik.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mzHr2-001OhV-Bu; Mon, 20 Dec 2021 14:33:25 +0200 From: Luca Coelho To: kvalo@kernel.org Cc: luca@coelho.fi, linux-wireless@vger.kernel.org Date: Mon, 20 Dec 2021 14:33:17 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211220123318.345841-1-luca@coelho.fi> References: <20211220123318.345841-1-luca@coelho.fi> MIME-Version: 1.0 Subject: [PATCH 1/2] iwlwifi: mei: clear the ownership when the driver goes down Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Emmanuel Grumbach When the driver is unregistered, CSME will take ownership on the device. Reflect this in the iwlmei object so that we will remember to re-ask for ownership when the driver will register again. Not doing so will cause CSME not to give the host ownership and we will see the following error message when trying to bring up the interface: iwlwifi 0000:a9:00.0: iwl_pcie_prepare_card_hw iwl_trans_prepare_card_hw enter iwlwifi 0000:a9:00.0: iwl_pcie_set_hw_ready hardware not ready iwlwifi 0000:a9:00.0: iwl_pcie_set_hw_ready hardware not ready iwlwifi 0000:a9:00.0: iwl_pcie_prepare_card_hw Couldn't prepare the card but SAP is connected iwlwifi 0000:a9:00.0: Error while preparing HW: -16 Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mei/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c index 4453cd2571c2..787d64276f36 100644 --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -1703,6 +1703,7 @@ void iwl_mei_unregister_complete(void) mei_cldev_get_drvdata(iwl_mei_global_cldev); iwl_mei_send_sap_msg(mei->cldev, SAP_MSG_NOTIF_WIFIDR_DOWN); + mei->got_ownership = false; } mutex_unlock(&iwl_mei_mutex);