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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 241C3C433ED for ; Fri, 16 Apr 2021 00:28:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAA06610EA for ; Fri, 16 Apr 2021 00:28:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236138AbhDPA2X (ORCPT ); Thu, 15 Apr 2021 20:28:23 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:54662 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234716AbhDPA2W (ORCPT ); Thu, 15 Apr 2021 20:28:22 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lXCKr-00GzPZ-Ea; Fri, 16 Apr 2021 02:27:49 +0200 Date: Fri, 16 Apr 2021 02:27:49 +0200 From: Andrew Lunn To: Ilya Lipnitskiy Cc: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Pablo Neira Ayuso , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next,v2] net: ethernet: mediatek: ppe: fix busy wait loop Message-ID: References: <20210416001148.333969-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416001148.333969-1-ilya.lipnitskiy@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 05:11:48PM -0700, Ilya Lipnitskiy wrote: > The intention is for the loop to timeout if the body does not succeed. > The current logic calls time_is_before_jiffies(timeout) which is false > until after the timeout, so the loop body never executes. > > Fix by using readl_poll_timeout as a more standard and less error-prone > solution. > > Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE") > Signed-off-by: Ilya Lipnitskiy > Cc: Felix Fietkau Reviewed-by: Andrew Lunn Andrew