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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 915DAC5479D for ; Wed, 11 Jan 2023 19:19:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 36FA541053; Wed, 11 Jan 2023 19:19:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 36FA541053 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1673464772; bh=yKWuh0liIUzg6GKGL7+kxNpOdvh7kHmNLD38qxK5dQM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=4acpYsIJMUCKpfRcjTSiKNOtNmRNoHFaFzrNgVQ1qpPcwLc2wn9G+wvPMUtmtzngM Eet4XM58TH81U9V6r5WRvXpB7lD71GcZ7ygycMPIPKUUz0MAD8RNHFEem+f5ZqjcNG CEhw1WTQFmnus4EiUIO9Si6Alv+CbMJ61cgP6kR1ipYGrra2vN+mWbkxYiYhNi67tj uEuWsmFb+oenbG0vT6qWfPhuFyDkIYSb6oKZ5BlbYVz4Yia+ZoWsnakisLly2m1jUw ZzSfVpPVXI0ERdhitqIFcM8a2rQKOIQpccM+aqxcRR8+mgcaffWWIKVNa6JfUjHvJw TPLOeNOy+KNKg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r-zvKBv6sq8o; Wed, 11 Jan 2023 19:19:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 4ED4740C39; Wed, 11 Jan 2023 19:19:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4ED4740C39 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DF3281BF95F for ; Wed, 11 Jan 2023 19:19:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C60974186C for ; Wed, 11 Jan 2023 19:19:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C60974186C X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ppfRfC1rqiH1 for ; Wed, 11 Jan 2023 19:19:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E8E00402FD Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by smtp4.osuosl.org (Postfix) with ESMTPS id E8E00402FD for ; Wed, 11 Jan 2023 19:19:19 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="321205225" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="321205225" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 11:19:19 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="902892241" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="902892241" Received: from pmstillw-desk1.amr.corp.intel.com ([10.212.10.187]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 11:19:19 -0800 From: Paul M Stillwell Jr To: intel-wired-lan@lists.osuosl.org Date: Wed, 11 Jan 2023 11:19:05 -0800 Message-Id: <20230111191906.131-5-paul.m.stillwell.jr@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230111191906.131-1-paul.m.stillwell.jr@intel.com> References: <20230111191906.131-1-paul.m.stillwell.jr@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673464759; x=1705000759; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sW2dFFCRLSUcr5wQbesVB7sq5xTpEVAIYjjcKYr7eFk=; b=d9JcjF+4qNyBGhApfVog8pVFXCypaMCRhVUQtxKEbXk1vcrDNKkDgwot BD0nXlB31Gs2LRr28cx9khpPCkBrwsllZya/JT2YzN7DFBngVMLfIZMxU RxeA29Cl13ezfuva12q8vnHRPQ27AoCeNXOPjH2hljhJD47tKsH6lPJFU 6WrGOc1U8CLTYadf3EE6aGxHMrVwHhm3Z2UkrKXvzUNn2NIBboJ41hbj3 2uWY8/4Icf648GvNhw1/HtBbxK7OCMA0FyDgkglh5rak9BYRcYnfIJedu iYoAUE9VKYCn1UJl0Zuo6/MGXzMk/Hz1Am9dNfoOwIFxwCIyz1Jix8fAQ A==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=d9JcjF+4 Subject: [Intel-wired-lan] [PATCH net-next v5 4/5] ice: disable FW logging on driver unload X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" The FW is running in it's own context irregardless of what the driver is doing. In this case, if the driver previously registered for FW log events and then the driver unloads without informing the FW to unregister for FW log events then the FW still has a timer running to output FW logs. The next time the driver loads and tries to register for FW log events then the FW returns an error, but still enables the continued outputting of FW logs. This causes an IO error to devlink which isn't intuitive since the logs are still being output. Fix this by disabling FW logging when the driver is being unloaded. Signed-off-by: Paul M Stillwell Jr --- drivers/net/ethernet/intel/ice/ice_main.c | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 1b5debc3109d..593efc064f5b 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4500,6 +4500,33 @@ static void ice_unregister_netdev(struct ice_vsi *vsi) clear_bit(ICE_VSI_NETDEV_REGISTERED, vsi->state); } +/** + * ice_pf_fwlog_deinit - clear FW logging metadata on device exit + * @pf: pointer to the PF struct + */ +static void ice_pf_fwlog_deinit(struct ice_pf *pf) +{ + struct ice_hw *hw = &pf->hw; + + /* make sure FW logging is disabled to not put the FW in a weird state + * for the next driver load + */ + if (hw->fwlog_ena) { + int status; + + hw->fwlog_cfg.options &= ~ICE_FWLOG_OPTION_ARQ_ENA; + status = ice_fwlog_set(hw, &hw->fwlog_cfg); + if (status) + dev_warn(ice_pf_to_dev(pf), "Unable to turn off FW logging, status: %d\n", + status); + + status = ice_fwlog_unregister(hw); + if (status) + dev_warn(ice_pf_to_dev(pf), "Unable to unregister FW logging, status: %d\n", + status); + } +} + /** * ice_cfg_netdev - Allocate, configure and register a netdev * @vsi: the VSI associated with the new netdev @@ -5237,6 +5264,8 @@ static void ice_remove(struct pci_dev *pdev) msleep(100); } + ice_pf_fwlog_deinit(pf); + if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) { set_bit(ICE_VF_RESETS_DISABLED, pf->state); ice_free_vfs(pf); -- 2.35.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan