[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220616153057.GB28995@pengutronix.de>
Date: Thu, 16 Jun 2022 17:30:57 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v1 1/1] net: dsa: ar9331: fix potential dead
lock on mdio access
On Thu, Jun 16, 2022 at 03:34:18PM +0200, Andrew Lunn wrote:
> > static int ar9331_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
> > @@ -849,6 +849,8 @@ static int ar9331_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
> > return 0;
> > }
> >
> > + mutex_lock_nested(&sbus->mdio_lock, MDIO_MUTEX_NESTED);
> > +
>
> Do you know about mdiobus_read_nested() and
> mdiobus_write_nested(). The mv88e6xxx driver uses these.
Yes.
I need at least 2 master MDIO accesses to implement 1 slave mdio access.
So I decided to get lock one time for all needed accesses instead of
taking it multiple times.
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists