Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3303224lfo; Mon, 23 May 2022 01:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOH7J6x3YbeqAKJUoKhrVacBNIARTpBTPoyhxvFEf807Ew1soDXo/6HRHhxKDxaY8kCTLR X-Received: by 2002:a63:4a4b:0:b0:3fa:8a72:b2 with SMTP id j11-20020a634a4b000000b003fa8a7200b2mr396938pgl.544.1653293376823; Mon, 23 May 2022 01:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653293376; cv=none; d=google.com; s=arc-20160816; b=OITfrgPPaxdLtYcqxDblAtNe5OABTLzHslMSEXL5jaOpRQyR/GlcVcuRftGbeLpZBM +r2Wb96FHy17HT/DC0SqY5Yuh82PR3zCL2UqNe8rbopW3nYiInNHeAWhuds+GnZANG7Z 41qVa77SjV08FqzplXusfRtRESziGyRiEKaUqrcd82U4+dRc0tL5y2J3gsLL5Fh49GoK BS8RBw4+6EYVGFowRwgfzJei84LVO+9+zYCcZm/d0q+/CGS+HxwV8hF0n9LMWjGI0BDh ERi/JX5ge9jCvZAh3IcPMy/BFMhjlx3J8Tb7lwfRjW9LsV8f8bxJuT11J+xwlJhIppXg /cqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=JlS5+Zx7bLL9B/sG6JFr0mdsjKOX7o7My0JbDoCnCW4=; b=Tif4BXnLU3bZ+tbMZ0b1OIMDU85dx/xZd7D2Jf49XFqyI4DwOFaMmmvbHaYdttKjHS +aXczak2uUN+0ZiaNpAXuhWyRiXYhJjRF4JPGQQXct5nVM+l/GFJCPl+sLaIh00GhDJB TVszQLjOwWr41aUQahdMjJ0ltl5bCgpTziWhs0CMbRFm2H1Z/aI8vHE/wORRG4mbiDGP 8rhS31UdZRYOJkzIHghleCtzHXWRl1pg9gEw82g/B6pGBfwSnw6qELJx3c7kBgiJi9Ru XBypfpoHaJ7pydWpDf38MNGdLZNGgpF0omDtxwodoqifQaIbhHcpsDsCUELKWz0HrPeA HGPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="JR/J206B"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g7-20020a63fa47000000b003c186ab9092si9058137pgk.538.2022.05.23.01.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:09:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="JR/J206B"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12B5C2195; Mon, 23 May 2022 00:04:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346939AbiETIXG (ORCPT + 99 others); Fri, 20 May 2022 04:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346932AbiETIXF (ORCPT ); Fri, 20 May 2022 04:23:05 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E1F14041B; Fri, 20 May 2022 01:23:03 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id BB65B60003; Fri, 20 May 2022 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1653034981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JlS5+Zx7bLL9B/sG6JFr0mdsjKOX7o7My0JbDoCnCW4=; b=JR/J206Bb0WHaSd1ufr21uQ7Kvqhz5NK4wj362Aro/gHNsM1fE0vI/9fv0qR6agAde89Jh 3rnp4LHlhs3Thd3giYMy719Fqrc53Q9hzfUh7Z9OcVdJ1gj+e1KwrKsWcheOAB3e5fwHQt F/Zqg2WAsrU8bh5/RGdWZpi174yqUfQIzzcq+qHPcGXY9Sn07CRZy4H1wBc/4CPx9m9HdB h+YKP3BkREBvZJktCrGref0FxWtjdNQrr7mnfsFxD72NAKPrh7fstYK1JmVXasgO84ZPsW iDYYZXYXceeBYxRr+ODjKiflCRr3gBVSxS6tl30cqgne0cjpUxWoz5MoI7R5UQ== Date: Fri, 20 May 2022 10:21:51 +0200 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Vladimir Oltean Cc: Pavel Skripkin , Claudiu Manoil , "alexandre.belloni@bootlin.com" , "UNGLinuxDriver@microchip.com" , "davem@davemloft.net" , "kuba@kernel.org" , "pabeni@redhat.com" , "dan.carpenter@oracle.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: ocelot: fix wront time_after usage Message-ID: <20220520102151.411c8e35@fixe.home> In-Reply-To: <20220519231300.k6hizfdu5chi7lpu@skbuf> References: <20220519204017.15586-1-paskripkin@gmail.com> <20220519231300.k6hizfdu5chi7lpu@skbuf> Organization: Bootlin X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Le Thu, 19 May 2022 23:13:01 +0000, Vladimir Oltean a =C3=A9crit : > On Thu, May 19, 2022 at 11:40:17PM +0300, Pavel Skripkin wrote: > > Accidentally noticed, that this driver is the only user of > > while (timer_after(jiffies...)). > >=20 > > It looks like typo, because likely this while loop will finish after 1st > > iteration, because time_after() returns true when 1st argument _is afte= r_ > > 2nd one. > >=20 > > Fix it by negating time_after return value inside while loops statement > >=20 > > Fixes: 753a026cfec1 ("net: ocelot: add FDMA support") > > Signed-off-by: Pavel Skripkin > > --- > > drivers/net/ethernet/mscc/ocelot_fdma.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/drivers/net/ethernet/mscc/ocelot_fdma.c b/drivers/net/ethe= rnet/mscc/ocelot_fdma.c > > index dffa597bffe6..4500fed3ce5c 100644 > > --- a/drivers/net/ethernet/mscc/ocelot_fdma.c > > +++ b/drivers/net/ethernet/mscc/ocelot_fdma.c > > @@ -104,7 +104,7 @@ static int ocelot_fdma_wait_chan_safe(struct ocelot= *ocelot, int chan) > > safe =3D ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE); > > if (safe & BIT(chan)) > > return 0; > > - } while (time_after(jiffies, timeout)); > > + } while (!time_after(jiffies, timeout)); > > =20 > > return -ETIMEDOUT; > > } > > --=20 > > 2.36.1 > > =20 >=20 > +Clement. Also, there seems to be a typo in the commit message (wront -> = wrong), > but maybe this isn't so important. Hi Pavel, Thanks for this fix which is indeed necessary. Acked-by: Cl=C3=A9ment L=C3=A9ger --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com