From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Pavel Skripkin <paskripkin@gmail.com>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>,
"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"clement.leger@bootlin.com" <clement.leger@bootlin.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v4] net: ocelot: fix wrong time_after usage
Date: Wed, 6 Jul 2022 13:30:42 +0000 [thread overview]
Message-ID: <20220706133041.qsmuwnljlb4ng6gn@skbuf> (raw)
In-Reply-To: <20220706132845.27968-1-paskripkin@gmail.com>
On Wed, Jul 06, 2022 at 04:28:45PM +0300, Pavel Skripkin wrote:
> Accidentally noticed, that this driver is the only user of
> while (time_after(jiffies...)).
>
> It looks like typo, because likely this while loop will finish after 1st
> iteration, because time_after() returns true when 1st argument _is after_
> 2nd one.
>
> There is one possible problem with this poll loop: the scheduler could put
> the thread to sleep, and it does not get woken up for
> OCELOT_FDMA_CH_SAFE_TIMEOUT_US. During that time, the hardware has done
> its thing, but you exit the while loop and return -ETIMEDOUT.
>
> Fix it by using sane poll API that avoids all problems described above
>
> Fixes: 753a026cfec1 ("net: ocelot: add FDMA support")
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
This patch should target the "net" tree.
next prev parent reply other threads:[~2022-07-06 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 13:28 [PATCH v4] net: ocelot: fix wrong time_after usage Pavel Skripkin
2022-07-06 13:30 ` Vladimir Oltean [this message]
2022-07-08 1:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220706133041.qsmuwnljlb4ng6gn@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paskripkin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox