From: Johannes Berg <johannes@sipsolutions.net>
To: Nikolai Zhubr <zhubr.2@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] alx: use fine-grained locking instead of RTNL
Date: Fri, 14 May 2021 13:22:56 +0200 [thread overview]
Message-ID: <8e2a8567d79141f8f5cb180be656efb378dcfee8.camel@sipsolutions.net> (raw)
In-Reply-To: <609E5817.8090000@gmail.com> (sfid-20210514_124949_830593_01576FC8)
On Fri, 2021-05-14 at 13:59 +0300, Nikolai Zhubr wrote:
> Hi Johannes,
>
> 12.05.2021 13:19, Johannes Berg:
> > In the alx driver, all locking depended on the RTNL, but
> [...]
> > @@ -232,7 +240,7 @@ static int alx_set_pauseparam(struct net_device *netdev,
> > if (pause->autoneg)
> > fc |= ALX_FC_ANEG;
> >
> > - ASSERT_RTNL();
> > + mutex_lock(&alx->mtx);
> >
> > /* restart auto-neg for auto-mode */
> > if (hw->adv_cfg& ADVERTISED_Autoneg) {
> > @@ -254,6 +262,7 @@ static int alx_set_pauseparam(struct net_device *netdev,
> > alx_cfg_mac_flowcontrol(hw, fc);
> >
> > hw->flowctrl = fc;
> > + mutex_unlock(&alx->mtx);
> >
> > return 0;
> > }
>
> Isn't this fragment missing a mutex_unlock(&alx->mtx) for the "return
> err" codepath in the middle? I'm not sure, its like very suspicious,
> please have a look.
I clearly missed it, somebody already picked up on it:
https://lore.kernel.org/r/20210514082405.91011-1-pulehui@huawei.com
johannes
next prev parent reply other threads:[~2021-05-14 11:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 10:19 [PATCH net-next] alx: use fine-grained locking instead of RTNL Johannes Berg
2021-05-13 20:20 ` patchwork-bot+netdevbpf
2021-05-14 10:59 ` Nikolai Zhubr
2021-05-14 11:22 ` Johannes Berg [this message]
2021-05-14 12:04 ` Nikolai Zhubr
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=8e2a8567d79141f8f5cb180be656efb378dcfee8.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
--cc=zhubr.2@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;
as well as URLs for NNTP newsgroup(s).