public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Frank <Frank.Sae@motor-comm.com>,
	Peter Geis <pgwipeout@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	yinghong.zhang@motor-comm.com, fei.zhang@motor-comm.com,
	hua.sun@motor-comm.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy
Date: Wed, 30 Nov 2022 19:19:08 +0100	[thread overview]
Message-ID: <Y4eenBOnpWt17ovJ@lunn.ch> (raw)
In-Reply-To: <Y4eT25bT7T8W6UXW@shell.armlinux.org.uk>

On Wed, Nov 30, 2022 at 05:33:15PM +0000, Russell King (Oracle) wrote:
> Hi Andrew,
> 
> On Wed, Nov 30, 2022 at 06:10:42PM +0100, Andrew Lunn wrote:
> > This is not the first time Russell has pointed out your locking is
> > wrong.
> > 
> > How about adding a check in functions which should be called with the
> > lock taken really do have the lock taken?
> 
> They already do:
> 
>         lockdep_assert_held_once(&bus->mdio_lock);
> 
> but I guess people just aren't testing their code with lockdep enabled.
> 
> The only other thing I can think of trying is to use mutex_trylock():
> 
> 	if (WARN_ON_ONCE(mutex_trylock(&bus->mdio_lock)))
> 		mutex_unlock(&bus->mdio_lock);
> 
> scattered throughout.

The ASSERT_RTNL() macro does this, it does not depend on lockdep.

And given the persistent sort of problems we have seen, you are
probably correct, lockdep is not being enabled by some developers.  I
guess they don't even know what it is.

	 Andrew

      reply	other threads:[~2022-11-30 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  9:49 [PATCH net-next] net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy Frank
2022-11-30  9:55 ` Russell King (Oracle)
2022-11-30 17:10   ` Andrew Lunn
2022-11-30 17:33     ` Russell King (Oracle)
2022-11-30 18:19       ` Andrew Lunn [this message]

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=Y4eenBOnpWt17ovJ@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Frank.Sae@motor-comm.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fei.zhang@motor-comm.com \
    --cc=hkallweit1@gmail.com \
    --cc=hua.sun@motor-comm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pgwipeout@gmail.com \
    --cc=yinghong.zhang@motor-comm.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