From mboxrd@z Thu Jan 1 00:00:00 1970 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 318CBC54EBC for ; Thu, 12 Jan 2023 10:49:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C355E400D0; Thu, 12 Jan 2023 10:49:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C355E400D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1673520564; bh=tqN7/Fqk4nNYtMke34snldi4kRpCBc5EZ/1fOnD38g8=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=VOhSAYG52zpw/97ASOU2QOkj+zRcsHamFeJhuIQFmXvBBnVvUV/CB+Ks/jclq9y8H Fww3EZl7veSWX94eivIc4AZSmZ/dfosVCrZGOg2zmgM7ptnrfuE0c71OAl3irAd8gt +G8E9yPA160Jzk+dY10HduUdzlR4JbUxpTpwlboN7PJlo/OQbt6LfOCbI6XVv5PWn/ /v4fiAsEd7UCDbkNqKKV47WrR1NfKkkvHoHs8WPStCwtft88tla4YKi3aAa0qztR1s s/Cz+Ogs+4F+PTDgickECNf9Zl5231sOj7Xtt8IT6nvwY5qfgEiSRj7FaJZXW2tOks YgYElW6H5sTjg== 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 wbD396DbcVya; Thu, 12 Jan 2023 10:49:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id B877D4014D; Thu, 12 Jan 2023 10:49:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B877D4014D Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 43DAE1BF476 for ; Thu, 12 Jan 2023 10:49:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1DFE54014D for ; Thu, 12 Jan 2023 10:49:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1DFE54014D 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 T4nCpcAOGXi5 for ; Thu, 12 Jan 2023 10:49:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D1D66400D0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by smtp2.osuosl.org (Postfix) with ESMTPS id D1D66400D0 for ; Thu, 12 Jan 2023 10:49:20 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="409911331" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="409911331" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 02:49:12 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="765557911" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="765557911" Received: from unknown (HELO localhost.localdomain) ([10.237.112.144]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 02:49:11 -0800 Date: Thu, 12 Jan 2023 11:49:08 +0100 From: Michal Swiatkowski To: Paul M Stillwell Jr Message-ID: References: <20230111191906.131-1-paul.m.stillwell.jr@intel.com> <20230111191906.131-5-paul.m.stillwell.jr@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230111191906.131-5-paul.m.stillwell.jr@intel.com> 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=1673520560; x=1705056560; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HPb1jmCEaJ+C888CxgAHmzZ1FaYfc9Gz40sm8p1Nqn4=; b=HvGqavVruBDgC27li1buw91bvgDJ7kLVufRDklnDzkaHFrmCHHBbXvN3 LmsRNfKT3BAILg6ySm0qzO9FkJxyQLLWPT40nHAvz7lZREw3Ltb/h4cO3 uG4HEw5eP7uCb7viL6G1qH6Dp0SwA2N3yV/dIasu15XYsiT1ygOxuRdCF dyTEz9SNxHd5HGe3OxBsEP07ArkYj5YhCDDRDlYKV098gKBIapbTrC4iY xxezbIvcSrqwtAgY1/O8DqLUYIxD14Zj0yZIlrt/fEwk03rpwu0Bg/uFy 9/cVcVffMhscFtSpc14SDN06IuQgAvsFivYfPzuFznEAva11JcYpWEYEa g==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HvGqavVr Subject: Re: [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: , Cc: intel-wired-lan@lists.osuosl.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, Jan 11, 2023 at 11:19:05AM -0800, Paul M Stillwell Jr wrote: > 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); Shouldn't hw->fwlog_cfg be free on deinit? Or if not here, where does this happen? > + } > +} > + > /** > * 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 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan