Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp1133534lfv; Thu, 14 Apr 2022 08:22:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ7lCoTIcj+8dDCcjZYDCVG1Jm27EQMiBCwJvF4k+xcpDdS1YK5XbpCKG4z/WYO/HpevAA X-Received: by 2002:a17:90b:4acc:b0:1cd:37de:3baf with SMTP id mh12-20020a17090b4acc00b001cd37de3bafmr4922900pjb.194.1649949611353; Thu, 14 Apr 2022 08:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649949611; cv=none; d=google.com; s=arc-20160816; b=MzA9XwwAZDzqE20n+p15sju8SFfU9AKh4yshc18qckNFza6mfSpV84XtImvwVCn3BR ZKRPTDRCHaoxeyQfKTCjRyYJC0X14pUij3365OLKNycbLBB+j70I60iEj0sZI9jdvUn1 xC/AixklMgQcCT+XBx+ZWTA2K+AA282EGSA50FJIEpkhRck70DmpmJNa7nvcHPUKk7Vw a3UnmSKT6ZVVFAIo8q8lN4v6zoaTjyczu3Yc88bte0XOtKnrHCwIOdc8lik3/Ozsm5uu FWNwH6QH2SCCbSVkHQsurUnw5NfZph5LJWTBN5IT70wBardsO0GRDDLYha/VeKPCFe+Y HtRg== 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=tLvIKnCsgwq0Fk81VHoLGLNWgDzppdl1EGVsnwIiwWk=; b=h0wvlU6Gm0ST6WYMq9uY8Io1YnPU8uu6H27d4UkEOkoT9iiyZ7Dl06NrKxK6F418ho NiEYOwX/imw/6wFOBs/Eqz7L06Z0EpA3N2S1FEkLWdQfaBEJcG2K3P6oXeSlcCDtUkUk 5kNOyBaQriuPHjZadCllqvtIN9yTVfFRh6seyFoFNANXy7wXHnPOev0bAFN7CIuG4d/R em9UHCqSPJDLLpLfek8GV6ZsN/8FmHSSIdaqpErFY+UJVfPAIZtnSqZQ2mzyZgwNZ9ic DS01mDzmvU66lFoPxER52qbEjQIthxeMedZgzEvUl5gMq9NyxlVyrH62G4sxkcGgpqLN M9wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="J+TeCd/4"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u23-20020a62d457000000b004fa3a8dfffbsi191898pfl.178.2022.04.14.08.19.54; Thu, 14 Apr 2022 08:20:11 -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=@gmail.com header.s=20210112 header.b="J+TeCd/4"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235686AbiDMNBp (ORCPT + 99 others); Wed, 13 Apr 2022 09:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbiDMNBm (ORCPT ); Wed, 13 Apr 2022 09:01:42 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE30303; Wed, 13 Apr 2022 05:59:20 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id x3so1017301wmj.5; Wed, 13 Apr 2022 05:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tLvIKnCsgwq0Fk81VHoLGLNWgDzppdl1EGVsnwIiwWk=; b=J+TeCd/41OhdiO9FUGEfBABaBHyh/+x7sT23BLdtYO5M/x78pQgF4HUNKv9pzckLvE MxPd2HtNgkI6X7aRD/PgoHW6pVhDxI8euAS9xxP6mmaE1kusyaJ0y+ZjzUz6BMYa5ozG 9uinPwymgXMcz+Gg+OuQDeTD5Y8mH6LmuNMUDP/r/iZ6ncTL2KniEyeWwa8admD2JJxh 55468CiYjZUtegpegbpzGpHqZ2PuQ9QJf08kGj4VNjg0PuJiBgKjEWPP6vJNz5uLeKJS pPiToZDXWjoFGkMUuKIofSm8bW4zIWYbuSBz6fEuW6Ccl8EM9Nmw4ioblOFhaO1IvD9d ZBkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tLvIKnCsgwq0Fk81VHoLGLNWgDzppdl1EGVsnwIiwWk=; b=WX/tvb6yVCz0T6oV6WZN9+6cGtZhttzYuuK5nSYV09C9Nf/8nT8nUC27ygpJ6dyW2M tw4WVyuhWOsbAs5rRRxi+A8YXNIaJjfzYueLHOTK7PuHS1kRAA6HhrNb9lZf+9I+3efh q5aP3vEfB4QJZfH9dKO3jgemiFzZrUpLBt0nMYlnlLGPYMPvRtsKm9bGQrIZYB4cgXlD yZ8gg7MQ8JmPXOTqdATmbeBPPxC4+mmYKb6QO+8ieUL6qBFLvzTqdjjLyB0Ix3GE+ur0 BbVl9LErdE+CUZ9DvyXMyCao/qXJ3XmkWJbhPhuUeNMF7mFkdemSZdR4Uhytm5ofLP/l PIzQ== X-Gm-Message-State: AOAM530Y88/NxUFQi4GGkUdRWW2wfznoyTrFW2Z52bKjMeNg5nlLdW0A zaZgs1M/kX/38/5e/2ssP1o= X-Received: by 2002:a05:600c:5128:b0:38e:bcdd:53bf with SMTP id o40-20020a05600c512800b0038ebcdd53bfmr8352243wms.109.1649854759438; Wed, 13 Apr 2022 05:59:19 -0700 (PDT) Received: from hoboy.vegasvil.org (195-70-108-137.stat.salzburg-online.at. [195.70.108.137]) by smtp.gmail.com with ESMTPSA id f9-20020a05600c4e8900b0038cc29bb0e1sm2873992wmq.4.2022.04.13.05.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 05:59:18 -0700 (PDT) Date: Wed, 13 Apr 2022 05:59:15 -0700 From: Richard Cochran To: Tan Tee Min Cc: 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: <20220413125915.GA667752@hoboy.vegasvil.org> References: <20220413040115.2351987-1-tee.min.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220413040115.2351987-1-tee.min.tan@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 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? > } while ((ret == 1) && (i < 10)); > > if (i == 10) > -- > 2.25.1 > Thanks, Richard