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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE378C4708D for ; Wed, 7 Dec 2022 21:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbiLGVKn (ORCPT ); Wed, 7 Dec 2022 16:10:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbiLGVKL (ORCPT ); Wed, 7 Dec 2022 16:10:11 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF8F27616D for ; Wed, 7 Dec 2022 13:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670447387; x=1701983387; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I7VysYvbGZXx4DJnxk9nGFqEbFPqVxeGpkDqH5E0dqE=; b=GtRWI4Q7w03Sp31NmifPykC/wlxDqkAkahfVDKw8Yt1bcb8THad1sg7K qM8zxzNmQxkrN94t7ak+tTs4nBpNsVt7w7zHwx2N99s1uns05EX/66CWN ZaSEeSUGXuZtWV73PHS3B4HGDFxHE33kvXgX+2YNaYN79ndabMuvO8GY6 sKDQSZeiiVbKnEwhOTBtbACtod1z9gzcZU/y3DuMYUE5nGMx/tInZqD74 KyPMNZxarKExVSR0x6PeZ7p/A1ObrmsfEzMuN1ba7F0V/RMGl84KW+IR1 jiNFcCh0NF+Pe4YEn6peoKaVYukUzPMKnMd1oJtaqXlJ8XeSnfWtXL7jl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="296697123" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="296697123" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 13:09:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="677508874" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="677508874" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga008.jf.intel.com with ESMTP; 07 Dec 2022 13:09:43 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com Cc: Jacob Keller , netdev@vger.kernel.org, anthony.l.nguyen@intel.com, richardcochran@gmail.com, leon@kernel.org, Siddaraju DH , Gurucharan G Subject: [PATCH net-next v2 15/15] ice: reschedule ice_ptp_wait_for_offset_valid during reset Date: Wed, 7 Dec 2022 13:09:37 -0800 Message-Id: <20221207210937.1099650-16-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221207210937.1099650-1-anthony.l.nguyen@intel.com> References: <20221207210937.1099650-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jacob Keller If the ice_ptp_wait_for_offest_valid function is scheduled to run while the driver is resetting, it will exit without completing calibration. The work function gets scheduled by ice_ptp_port_phy_restart which will be called as part of the reset recovery process. It is possible for the first execution to occur before the driver has completely cleared its resetting flags. Ensure calibration completes by rescheduling the task until reset is fully completed. Reported-by: Siddaraju DH Signed-off-by: Jacob Keller Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ptp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index b1cc1f45e419..bd6fe25321bd 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -1245,8 +1245,13 @@ static void ice_ptp_wait_for_offsets(struct kthread_work *work) pf = ptp_port_to_pf(port); hw = &pf->hw; - if (ice_is_reset_in_progress(pf->state)) + if (ice_is_reset_in_progress(pf->state)) { + /* wait for device driver to complete reset */ + kthread_queue_delayed_work(pf->ptp.kworker, + &port->ov_work, + msecs_to_jiffies(100)); return; + } tx_err = ice_ptp_check_tx_fifo(port); if (!tx_err) -- 2.35.1