Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3043318iog; Mon, 27 Jun 2022 08:03:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUZU/7smLdlin1RWLXmvWIYMQbwKsr/MHRaXI3S27ErUcrS7nwTuhCIpRsJi+gHStKaIze X-Received: by 2002:a17:903:2447:b0:16a:3b58:48c1 with SMTP id l7-20020a170903244700b0016a3b5848c1mr15296636pls.44.1656342191107; Mon, 27 Jun 2022 08:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656342191; cv=none; d=google.com; s=arc-20160816; b=sD3ylOowDdi9GGo6Tha5yUVG+zuS0AY9QcpMunZ4z+uJLHu20na4TYlsBN0IInrL3u SZDXF2qo/SyS+jtC1MoZBRggH4w5KpAuD2eEpfC+udqpBpe5b5o+xoiuNxTqRAUDrHDH ZUkHV9Za3EaF7zvsqMJE9BI92rzyrlvG+0cxFaipLV5s2QTeY/VOdP6GLvkhAj0c415T 3cO4yV4Okl6Z3mom7pjmf+V9qnpenW0RJTPyCFF5wu9D3ZAwBTTGG4Ie7l6CJ/CKAfuK qhXiEPL5vAIG6b0AaF6prd2/T4Ul2e6A1L9Faq+EVIkTQauelza1uXZ3mIBipDNW/eyF 39eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=LUcZmkTGR5Hh6C+2kCtH4XekfuDCWDdiu6aLWv9Bsvc=; b=zCCiLiH4wBmnxYRNEwCtKr5ICSsfW+YlJUVibZlNHDdQbDJjo+LJxT/gCRHOk9Is1H PkmDGClG/W+mvXw+e7cME17Vlol+jyqX1swu60Vxuq6/PV/CSXCNiLbv/ivrYqnIo5Ib QwFEOnfdg6oJxFFesYR6ljnpLMT04+pGZV484XIxz1wbYG5mzkBpF2I9CJeIdLNFqCcO APpANKoSB9Oc1+z6bNskFuVRGjfcRpqFmlLfHbnoJtB54iwT4/7U92l/MLgrkIYm/B7u XH5GqJ4DNmoX2iaw/8ztM+ZCmqWP5HwSFUTWEGDFmsSZmq0v8Y9xzwCPlA5A+B7Zvs+e etPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bsPG5e6p; 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 e20-20020a17090ab39400b001e858081883si15377467pjr.64.2022.06.27.08.02.57; Mon, 27 Jun 2022 08:03: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=bsPG5e6p; 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 S237594AbiF0OqR (ORCPT + 99 others); Mon, 27 Jun 2022 10:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237514AbiF0OqQ (ORCPT ); Mon, 27 Jun 2022 10:46:16 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6E3DF65; Mon, 27 Jun 2022 07:46:14 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id i18so17029262lfu.8; Mon, 27 Jun 2022 07:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=LUcZmkTGR5Hh6C+2kCtH4XekfuDCWDdiu6aLWv9Bsvc=; b=bsPG5e6pSA54rPqXT/iG2JQkmpub79669Ga7QL7JTWZMGl9RnNaHE8Jeonlpw/N9+x zKu7VxfkFdEDaC8YdNx165AUkCsKJ23tmjMePbt814goc5Sj/GbwIpsfUfkNupx29Zo0 u+QI/m8Ejf5qNPjjprjSvoixrfmEcLhdyA8f9xGz2W9lAhu6NsXhYFm22t0Kscu8WKzM rMMN5hE72xUJN4GBMyhG7ZBzVkC2XJ0WfOXCHtBEFtqlZTHR4PPL5g8/ZsaNWoFE4Dza UIAnVrGZsdr8o3RZZS30SQPKbjmC1jORZ5DRQdLwErj+ORRpJ44plrdGgRyQdnYUPTMm oeOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=LUcZmkTGR5Hh6C+2kCtH4XekfuDCWDdiu6aLWv9Bsvc=; b=OeP9l3EH4CjFCkTfLN8Bf+nE1yIyA5r4E+Fvqt2IyH3/LTQ5rxMDHkf5UQcHdAAZwR j/2GFjsS4iEOhMnGKkT32J+AoDhr4mhs2yfAPHFjDvFWAPUJM60Pw5FfzuLT2hWSOfp+ fc1qa3hRsrkWhM6XRmmviH/XKgx5qSRuBr3vhvJaRr/InAjlT4+pj3NSIYnA1dzr3w+y KNg9WlDUB/42oCStvt6ko2yPHtExxbB8BjmpSVX7oZCJSgifEqy+E7tydQy6+w1mhxCN 8MJY6gf0NZLa0wOalTE0ZWpMEmAVVwlDgPd9k57CC998pShazQzFMo0ol5kMNt4fLY/M 1beA== X-Gm-Message-State: AJIora/DFKN+nWd+irRlna3lLsO4dI5ZlRXgvuVIjBr0Ey84WYmAEWjF ZqihKBDflUnwoZozk2Yw9L0= X-Received: by 2002:a05:6512:3e16:b0:47f:9d6d:c7e3 with SMTP id i22-20020a0565123e1600b0047f9d6dc7e3mr9221730lfv.393.1656341172695; Mon, 27 Jun 2022 07:46:12 -0700 (PDT) Received: from [192.168.1.11] ([46.235.67.63]) by smtp.gmail.com with ESMTPSA id c2-20020ac25f62000000b00478f3fe716asm1828735lfc.200.2022.06.27.07.46.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 07:46:11 -0700 (PDT) Message-ID: <4d08b849-3e79-7c82-803c-51c251344c7a@gmail.com> Date: Mon, 27 Jun 2022 17:46:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2] net: ocelot: fix wrong time_after usage Content-Language: en-US To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Vladimir Oltean Cc: Andrew Lunn , Claudiu Manoil , "alexandre.belloni@bootlin.com" , "UNGLinuxDriver@microchip.com" , "kuba@kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20220520213115.7832-1-paskripkin@gmail.com> <20220521162108.bact3sn4z2yuysdt@skbuf> <20220624171429.4b3f7c0a@fixe.home> From: Pavel Skripkin In-Reply-To: <20220624171429.4b3f7c0a@fixe.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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,NICE_REPLY_A, 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 6/24/22 18:14, Clément Léger wrote: > So I actually tested and added logging to see if the CH_SAFE > register bits are set for the channel on the first iteration. From > what I could test (iperf3 with huge/non huge packets, TCP/UDP), it > always return true on the first try. So since I think Pavel solution > is ok to go with. > > However, since ocelot_fdma_wait_chan_safe() is also called in the napi > poll function of this driver, I don't think sleeping is allowed (softirq > context) and thus I would suggest using the readx_poll_timeout_atomic() > function instead. > > Regarding the delay to wait between each read, I don't have any > information about that possible value, the datasheet only says "wait > for the bit to be set" so I guess we'll have to live with an > approximate value. > Thank you for testing! I will update update v3 with _atomic variant Thanks, --Pavel Skripkin