[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250123183358.502e8032@kmaincent-XPS-13-7390>
Date: Thu, 23 Jan 2025 18:33:58 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Paul Barker <paul.barker.ct@...renesas.com>
Cc: Niklas Söderlund <niklas.soderlund@...natech.se>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Mikhail Ulyanov
<mikhail.ulyanov@...entembedded.com>, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com>, Thomas Petazzoni
<thomas.petazzoni@...tlin.com>, Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>, Claudiu Beznea
<claudiu.beznea.uj@...renesas.com>, netdev@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org, Sergey
Shtylyov <s.shtylyov@....ru>
Subject: Re: [PATCH net v2 1/2] net: ravb: Fix missing rtnl lock in suspend
path
On Thu, 23 Jan 2025 17:23:11 +0000
Paul Barker <paul.barker.ct@...renesas.com> wrote:
> On 23/01/2025 16:58, Kory Maincent wrote:
> > Fix the suspend path by ensuring the rtnl lock is held where required.
> > Calls to ravb_open, ravb_close and wol operations must be performed under
> > the rtnl lock to prevent conflicts with ongoing ndo operations.
...
> >
> > @@ -3247,7 +3253,9 @@ static int ravb_resume(struct device *dev)
> >
> > /* If WoL is enabled restore the interface. */
> > if (priv->wol_enabled) {
> > + rtnl_lock();
> > ret = ravb_wol_restore(ndev);
> > + rtnl_unlock();
> > if (ret)
> > return ret;
> > } else {
> > @@ -3257,7 +3265,9 @@ static int ravb_resume(struct device *dev)
> > }
> >
> > /* Reopening the interface will restore the device to the working
> > state. */
> > + rtnl_lock();
> > ret = ravb_open(ndev);
> > + rtnl_unlock();
> > if (ret < 0)
> > goto out_rpm_put;
> >
> >
>
> Please remove Reviewed-by tags when making changes like this in a
> subsequent version of a patch series, this is no longer the patch I
> reviewed.
Oh, sorry for that!
> I don't like the multiple lock/unlock calls in each function. I think v1
> was better, where we take the lock once in each function and then unlock
> when it is no longer needed or when we're about to return.
You will need to achieve a consensus on it with Claudiu. His point of view has
that the locking scheme looks complicated.
On my side I don't have really an opinion, maybe a small preference for v1 which
is protecting wol_enabled flag even if it is not needed.
---
pw-bot: cr
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists