Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5457324pxu; Tue, 22 Dec 2020 18:38:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZk1B0Z9T8TBOtLSOj5Iw/tlhcUtBu/GVEN6mEANVtckWPH9O/8doT1LmiCbVYC15JG5Qo X-Received: by 2002:aa7:d886:: with SMTP id u6mr23398779edq.139.1608691091428; Tue, 22 Dec 2020 18:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691091; cv=none; d=google.com; s=arc-20160816; b=M2Gtx2HHJqRYNCLZH+PR5dl3nzPxvuu0TfwwRZz3ggWfpTdYMwm0FrqwJt21JpTDVU 5pvhmEP/kVmp2O//lum1/AUEzzagvsm2BAQne0a0fDqEHRBCV43vJR7pxPBg/wFp9e2A cFDyzjr2MKmxMH0+z1twFuFJ0myGt2dBBDlyovO4m9D59+EQM12ybxgEdHWAnb1KQcsU hFC5WqlXSW4kirzb3/gbMm0504J109tGakzfBi2l6iFn4406XJoaaliCSBbgQkog/6Tj b40erePqyxkDYGx0mA/oKTw5TUie4FcybMzWe3geNvVIod5EU2LCUN5eGiI54zW4Ab39 dyQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8m8eZ/3ND/8jWyif0LNJTj3HetkdbjVGqY4P6m10yJs=; b=ekIM76EU6mRgOM/0sk1crnfRd84uZpJywlDDIcWIPywV6+y4htcOtq5MR71fdo+u1+ PG3h3aDh6aw6xuMGZfmMrwU7ek7rClJzbC4Z9x+9prUuKWtpptFv1i1x7X0tW6aJ3Atz zRXxDEuOLiPWczr/ykeSSdWs0d5GvqDts16gqwUl7ANKh0WTYMeQnKFk8eL3B5aOyPMP gatcZs4dKo2R36Eq8HcMrw0EXRC7E6LXtdbdZ9fEDwpquDHVbmM2aHKwlcEupMvd0d3P ZQ4pXRCgJP1QC6xARaiBX5fJj459Z6/q9MiL890eOimGvu8bSKbIHGgB8IWeSXLfZyI1 UKxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="EU4/cHxf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pw18si11122791ejb.163.2020.12.22.18.37.49; Tue, 22 Dec 2020 18:38:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="EU4/cHxf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730583AbgLWCho (ORCPT + 99 others); Tue, 22 Dec 2020 21:37:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:52102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730165AbgLWCYS (ORCPT ); Tue, 22 Dec 2020 21:24:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EC5A22525; Wed, 23 Dec 2020 02:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690243; bh=pLvGQrKoyRHODKTVyggvW/EotFZdol+tHnntxQ160MM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EU4/cHxfqSOfAceliEXD2loFb7Hv3K8dBbXVGKVuMlaYcrp5wMA4uV4eVC4aKeGKL x1sM/UrpO8LK4UWLLgvaMWjqH7iSk33zlLu0/faCF4M8rfkAv6/wYj+UAO1nxHv8GE jaMas8pM4st42za8EbUfRDuR+PukK0LgRwcE6IoQpe67YX9Tay6J8LThQKM3yu+3fF z6rVXpuwrs2GQiurMCG6R3PaVa5BTMDcIRJXTxD+Q97lCbxiVyiWsBS9uhf0bA1Rnv dK6huiAFIswLEomJegJP3P70kMlToMNPZ8H4oLDIpfeT8Ad6vWo/GJZZ3DQlJoRcSQ 1yukV2cQKxZvg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , Luca Coelho , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 56/66] iwlwifi: add an extra firmware state in the transport Date: Tue, 22 Dec 2020 21:22:42 -0500 Message-Id: <20201223022253.2793452-56-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit b2ed841ed070ccbe908016537f429a3a8f0221bf ] Start tracking not just if the firmware is dead or alive, but also if it's starting. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20201209231352.33e50d40b688.I8bbd41af7aa5e769273a6fc1c06fbf548dd2eb26@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h index 7de7dac3260ce..8e567e53a4333 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h @@ -600,12 +600,14 @@ struct iwl_trans_ops { /** * enum iwl_trans_state - state of the transport layer * - * @IWL_TRANS_NO_FW: no fw has sent an alive response - * @IWL_TRANS_FW_ALIVE: a fw has sent an alive response + * @IWL_TRANS_NO_FW: firmware wasn't started yet, or crashed + * @IWL_TRANS_FW_STARTED: FW was started, but not alive yet + * @IWL_TRANS_FW_ALIVE: FW has sent an alive response */ enum iwl_trans_state { - IWL_TRANS_NO_FW = 0, - IWL_TRANS_FW_ALIVE = 1, + IWL_TRANS_NO_FW, + IWL_TRANS_FW_STARTED, + IWL_TRANS_FW_ALIVE, }; /** @@ -824,12 +826,18 @@ static inline int iwl_trans_start_fw(struct iwl_trans *trans, const struct fw_img *fw, bool run_in_rfkill) { + int ret; + might_sleep(); WARN_ON_ONCE(!trans->rx_mpdu_cmd); clear_bit(STATUS_FW_ERROR, &trans->status); - return trans->ops->start_fw(trans, fw, run_in_rfkill); + ret = trans->ops->start_fw(trans, fw, run_in_rfkill); + if (ret == 0) + trans->state = IWL_TRANS_FW_STARTED; + + return ret; } static inline int iwl_trans_update_sf(struct iwl_trans *trans, -- 2.27.0