From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8ADCD58CF for ; Mon, 13 Jun 2016 18:28:25 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 13 Jun 2016 09:28:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="1001002135" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.87]) ([10.237.220.87]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2016 09:28:24 -0700 To: Beilei Xing , helin.zhang@intel.com References: <1462514861-29419-1-git-send-email-beilei.xing@intel.com> <1462514861-29419-19-git-send-email-beilei.xing@intel.com> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <575EDF27.4090305@intel.com> Date: Mon, 13 Jun 2016 17:28:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1462514861-29419-19-git-send-email-beilei.xing@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 18/29] ixgbe/base: update swfw semaphore function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 16:28:26 -0000 On 5/6/2016 7:07 AM, Beilei Xing wrote: > For X540 and forward it is possible if a system reset occur at the > right time to leave the SWFW semaphore high. This new function will > attempt to grab and release the semaphore. If the grab times out it > will still release the semaphore placing it in a known good state. > The idea is to call this when you know no one should be holding the > semaphore (i.e. probe time) > This patch alse fixes possible race issue between ports when issuing > host interface command by acquiring/releasing the management host > interface semaphore in ixgbe_host_interface_command. > > Signed-off-by: Beilei Xing > --- Does it make sense to separate this patch into two. ... > +/** > + * ixgbe_init_swfw_semaphore - Clean up SWFW semaphore > + * @hw: pointer to hardware structure > + * > + * Attempts to acquire the SWFW semaphore through SW_FW_SYNC register. > + * Regardless of whether is succeeds or not it then release the semaphore. > + * This is function is called to recover from catastrophic failures that > + * may have left the semaphore locked. > + **/ > +void ixgbe_init_swfw_semaphore(struct ixgbe_hw *hw) > +{ > + if (hw->mac.ops.init_swfw_sync) > + hw->mac.ops.init_swfw_sync(hw); > +} One add ixgbe_init_swfw_semaphore related code (init_swfw_sync, ixgbe_init_swfw_sync_X540) ... > @@ -4390,6 +4392,12 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, > DEBUGOUT1("Buffer length failure buffersize=%d.\n", length); > return IXGBE_ERR_HOST_INTERFACE_COMMAND; > } > + /* Take management host interface semaphore */ > + status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); > + > + if (status) > + return status; > + Second is fix in ixgbe_host_interface_command, they are unrelated as far as I can see. > /* Set bit 9 of FWSTS clearing FW reset indication */ > fwsts = IXGBE_READ_REG(hw, IXGBE_FWSTS); > IXGBE_WRITE_REG(hw, IXGBE_FWSTS, fwsts | IXGBE_FWSTS_FWRI); ...