Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2501456rdb; Thu, 21 Sep 2023 23:41:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWdTb/avzSUpLnSFofXpImOLbPo57ONl7+4JiWZC/yi1AQbM+2GS8mCKMqkJyfVxrqSYmQ X-Received: by 2002:a17:902:6b07:b0:1c3:29c4:c501 with SMTP id o7-20020a1709026b0700b001c329c4c501mr6615824plk.14.1695364870534; Thu, 21 Sep 2023 23:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695364870; cv=none; d=google.com; s=arc-20160816; b=Ix+GOjPIZoZBUyuOihPedIzhAY/LKjVIxPm/5G64vCTQD50NPTEARZarBxFIxklas2 G03VzOFnu4Tzcge47h/zY8jnqKH9OVBwbqVKfGiUaY0gZI9ehY74SXTplvmpUOanXmjx MJAw3+eqKKrwazjQ/xXnC03b2XMv2/82cLVwtOUjBojVSHTApTFabGg09I1Gad5dM6rO y2YKrIZ2za/bmlKaXwP9n66NY29p2p6mPvceCvElPm9opVFjEHjraTyLfYG070pJL2mx yxmI9Fn9k6TagYB+XXKvCTuT98AV8h7dLlZYeASA1aYgnf8x6Bm3S0LrF1pFXDH5aG51 T9hA== 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=8UbVmmp1He01P9XGUkCrxPGXy/YzWTanNlxP+Q3zEYU=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=oGfycztSzgfWZcwV8GXiOZs2HR2n9Hw+b/Yf5xwxc6Gqxx115Z368zPN9emPoEF2CH 4p8EZP8Gj/aSGxR7Kg99WNWra4id6dOB+PFUBVP8H9T39zz+MbiJ/tZMbXcEFxO2ZBd9 cglePE8WcWY5ZwOowZCxv57fgKuURkl1k+RLIszEdOnBC9WdNq1ha7bF2W3cKvxfHY12 ugOULbMiXSvNzE++dCLNS9OEWEm3aCCBS1yHXf/1FyVXlAJqDzYfzTOfA7hRo1qyFSmd FxdqPWuA3mT8txmL4MKOpXrs26X4nVE4UgIMfCv83i+4CuY+cMAerjv5PW2xqpfD1GQo QCCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AGJAYaFP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001c5cf1c30d8si3281177plh.367.2023.09.21.23.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AGJAYaFP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2F248801B4A7; Thu, 21 Sep 2023 12:43:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjIUTn6 (ORCPT + 56 others); Thu, 21 Sep 2023 15:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjIUTnl (ORCPT ); Thu, 21 Sep 2023 15:43:41 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B74C76BE for ; Thu, 21 Sep 2023 10:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695318632; x=1726854632; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a7CqduE05xO8qh1k5tSlX+IKpKRwG8L6cqNSryhsu3s=; b=AGJAYaFP9z0aPqO6suCxeYdOaaSnhsfSszZdhPie3F6+PyQJmIfFMj72 hipkbqS5UBm5nruLT2JroYxl9SdXcoDuoaThBRJ6AIlTCVnj/BRn7zPPO 5/WYtZUyyrpK81LZRk9rWCwIaG5FFjs1PcOrKJQoOPw2ADpF2epzYYGhI HAsGcPnAb98+9XCaKQ2v0/+J1sQHR2+IUuHugA2nhvONvZuhVa/TRUZ2z xs9iDYT+awHwmDzTH1W5LB7xDuf4WXzdBX5suJjneFR5YTMujbcjDOt/J 5+sLlfSirscVG3958IfQtXuNV8GceOaATo9lSQouK49h5gdk75pbUolyz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="384305375" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="384305375" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 01:58:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="740545577" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="740545577" Received: from rchuwer-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.229.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 01:58:58 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 07/12] wifi: iwlwifi: fail NIC access fast on dead NIC Date: Thu, 21 Sep 2023 11:58:05 +0300 Message-Id: <20230921110726.f3d8498c5a60.I5d0c442a731ca4c00716910d215b4bcde6963a65@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230921085810.693048-1-gregory.greenman@intel.com> References: <20230921085810.693048-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:43:57 -0700 (PDT) From: Johannes Berg If the NIC is already dead, as detected by the transport then there's no point to try to grab the NIC access and time out, we can just fail fast. This may speed up recovery. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 5020ae4493c6..385e152f04fe 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -2177,6 +2177,9 @@ bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans) CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP; u32 poll = CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN; + if (test_bit(STATUS_TRANS_DEAD, &trans->status)) + return false; + spin_lock(&trans_pcie->reg_lock); if (trans_pcie->cmd_hold_nic_awake) -- 2.38.1