Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1406783pxb; Thu, 14 Apr 2022 05:38:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6z1ELk3xLMbCl8vDzJLwujF0a08nfDleEp0CQcDiN7debJVKv1r9/SCWaDTGIviPMPLRa X-Received: by 2002:a05:6402:2806:b0:420:713f:b5e1 with SMTP id h6-20020a056402280600b00420713fb5e1mr2719988ede.93.1649939929062; Thu, 14 Apr 2022 05:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649939929; cv=none; d=google.com; s=arc-20160816; b=0kcPTsAAQ1s4CAnox5/ZAaJ/JT0JGJ5JwSpFj7Z8icSOFd0pZtZ+1gNHxcKVWJ5EJP M8iHl4CRT8RSRBF9FM9x56GWMpjRqE4RVSBMlW4EfiThrNqr4hBd46dEAMBcr2gK8ePi wQBvDcLefh9DlrtYpW6iaT1frZG8FBYmYMyYaLqtSEImbxYsbLQY4R31s0+E8uHWdqAO Y3GF6+OxqvIm21Aqwh0Sj1DvS8+8wJOm2AlVa22iaB5PGIaYgUDzFe+hXjwpfaakrk8X tsylcpUTzJkVDHua5HxndKvgaj1g2sxFhvnTOT4wZ8u0cLt0m9OC1IR1PnwBK/n2CsWA IjTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8Mk1pf7tbFJ57umjNmgltsjUF68N7zCVkSEcoxxNMxE=; b=JiMeo/LgqkednJ0/SB+9AefbU5mxZek0wCKhiYHx+DL1CV4rUgutxvy1gtNaSc/dkQ mC0qUzLrIedsoxlBzPVvIjTVAMJ/8MG+1PWTArWw9i88XJ42dDi/SGZTNKzX63pVLICR Jv3SXXWWgSHCvcdu/AUDD7JYM2hkm7t3/uB5ibezkqCxKhS2ZybrHhOBtkACW8kvpSyl yYuCi4L5KyTikRW3dONdDOkpMreL5pMlzVSK+dzT1PmtEVLK6SMcqA0qm51sLWOS/rUj RdsH19r0179ta0AYCBFOYs08WJXzQaGKtcFmqZHMEY3anQV0GRGGf2xl4DQ3Q4wss9SS lOZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="OcuDrYV/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k25-20020a170906a39900b006e8b1219735si1911550ejz.8.2022.04.14.05.38.23; Thu, 14 Apr 2022 05:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="OcuDrYV/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240344AbiDNHeN (ORCPT + 99 others); Thu, 14 Apr 2022 03:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240330AbiDNHeL (ORCPT ); Thu, 14 Apr 2022 03:34:11 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E4625C57; Thu, 14 Apr 2022 00:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649921507; x=1681457507; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xTe/USNWGaWU+a+ifxzMMD7mLSnomvLGY2rXT/S2iZk=; b=OcuDrYV/xMu4I2YGZfIv6bhGHOAR19e9liepVkLFLdGiCvuD9/ZI/ndM MMMhm5XeZkc58OC6Hg/NppGPhZ3Fb7JqpxcUWF/Nu90CDybkORAADFYag 4w2tAAebvuzXovyNpB1WIMNCML4Gx6UpZ5IIaUdO9FHZ22gX1iazaGAzP aJoHziDnmGOE0TkcMGjadBFci/WKJyE1IkyyDhSK5i0BUBvdzVwesmVKv sMn9S8kTobsEmZnyZVblhbLOnx5iXqcobcrgjehwZH/06ofYH1I/9eqUM IaSC3DngVjlSmq6g6n73mBMtbghVJF2BkBaJVvejS8lpD2I1srpsIgbLq w==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="262623045" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="262623045" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 00:31:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="624010417" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 14 Apr 2022 00:31:46 -0700 Received: from linux.intel.com (ssid-ilbpg3-teeminta.png.intel.com [10.88.227.74]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 527075807E8; Thu, 14 Apr 2022 00:31:42 -0700 (PDT) Date: Thu, 14 Apr 2022 15:29:34 +0800 From: Tan Tee Min To: Richard Cochran Cc: Tan Tee Min , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Rayagond Kokatanur , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Voon Wei Feng , Wong Vee Khee , Song Yoong Siang Subject: Re: [PATCH net 1/1] net: stmmac: add fsleep() in HW Rx timestamp checking loop Message-ID: <20220414072934.GA10025@linux.intel.com> References: <20220413040115.2351987-1-tee.min.tan@intel.com> <20220413125915.GA667752@hoboy.vegasvil.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220413125915.GA667752@hoboy.vegasvil.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Wed, Apr 13, 2022 at 05:59:15AM -0700, Richard Cochran wrote: > On Wed, Apr 13, 2022 at 12:01:15PM +0800, Tan Tee Min wrote: > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c > > index d3b4765c1a5b..289bf26a6105 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c > > @@ -279,10 +279,11 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, void *next_desc, > > /* Check if timestamp is OK from context descriptor */ > > do { > > ret = dwmac4_rx_check_timestamp(next_desc); > > - if (ret < 0) > > + if (ret <= 0) > > goto exit; > > i++; > > > > + fsleep(1); > > This is nutty. Why isn't this code using proper deferral mechanisms > like work or kthread? Appreciate your comment. The dwmac4_wrback_get_rx_timestamp_status() is called by stmmac_rx() function which is scheduled by NAPI framework. Do we still need to create deferred work inside NAPI work? Would you mind to explain it more in detail? > > > } while ((ret == 1) && (i < 10)); > > > > if (i == 10) > > -- > > 2.25.1 > > > > Thanks, > Richard Thanks, Tee Min