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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 AD37DC433F5 for ; Thu, 14 Apr 2022 07:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jYJ4tyPbjss+PZEJX8Cvgpwh6oTjmK2iL69IZj1FxzM=; b=kOY3wz8GkQ/xfF 3duLfTb2NMTUfkntxEEDIC2BjvKQ4PFVu/5rRgJXe0NlgEi1esakstJOOXwNnFOMFrPfv/u3S3d3Q hTPd3GaJTjYh7JYJDTfDyQVVrnzaSxvPRyvZqYFzGpN9enB+h3NDU8MLDKkItNJeT8y0O6LM1XlOK q0YZW79nZalljDHDxMLQiyxUX7Y1yy6bp1YqzdOvDfBphnFDOXqgASIv5tWZKwSsp3fx6wuRB86QY 2duoqsm3xENfuUbzd4xY7XpC7WFCfw2E5CMH9EVIdHgVXn6H88t5tXWPXAoMpZW6BqmvBEhq/oljA ZyMfZWUP0aeA7K59akLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1netxW-004Lvh-N0; Thu, 14 Apr 2022 07:32:06 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1netxT-004Lr7-AF for linux-arm-kernel@lists.infradead.org; Thu, 14 Apr 2022 07:32:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649921523; x=1681457523; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xTe/USNWGaWU+a+ifxzMMD7mLSnomvLGY2rXT/S2iZk=; b=P3VfLd0x/kfZeLD5NVydJW3EwZNYb8shrAFOGVyv5sRdi/w8z1HGSd2G C3BB4eeRcIoGJOd5anytT1btAt4szVMNhQqyQazqgEJ2Z+BBSka8FsX1e 1pOumD/Ql1IYJFsUeqcXkDp0/DN+sv1zF0QFCucrB98yCUxP2KNhAkbEd wvltL3OUP7Mc3Amwfg8R7ZYX3dvQRwOVpoCmqc6KXwMQx1F8y8ZLpmxZu IOQTcpmZJYLb6i1Bl73h0rORVgyiVgtYcQMqjGAPjnFCDzPNORVyOXfWH c7yGJiGg74z/bgLOPE7lIzZUkmx/n+cg+Tw0y3QuWW9qprdpK+a0AZhxF A==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="250161375" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="250161375" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 00:31:48 -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-Disposition: inline In-Reply-To: <20220413125915.GA667752@hoboy.vegasvil.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220414_003203_479772_EE5D0633 X-CRM114-Status: GOOD ( 20.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel