mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: phy: realtek: make sure paged read is protected by mutex
Date: Sat, 5 Oct 2024 16:20:07 +0200	[thread overview]
Message-ID: <32c342ef-62e8-4d85-8451-cfbb6024d869@lunn.ch> (raw)
In-Reply-To: <ZwBl5XBPGRS_eL9Y@makrotopia.org>

On Fri, Oct 04, 2024 at 11:02:13PM +0100, Daniel Golle wrote:
> On Fri, Oct 04, 2024 at 11:25:29PM +0200, Andrew Lunn wrote:
> > On Fri, Oct 04, 2024 at 04:52:04PM +0100, Daniel Golle wrote:
> > > As we cannot rely on phy_read_paged function before the PHY is
> > > identified, the paged read in rtlgen_supports_2_5gbps needs to be open
> > > coded as it is being called by the match_phy_device function, ie. before
> > > .read_page and .write_page have been populated.
> > > 
> > > Make sure it is also protected by the MDIO bus mutex and use
> > > rtl821x_write_page instead of 3 individually locked MDIO bus operations.
> > 
> > match_phy_device() as far as i know, is only used during bus probe,
> > when trying to match a driver to a device. What are you trying to lock
> > against during probe?
> 
> The idea is to reduce the amount of unnecessary lock/unlock cycles (1 vs
> 3). Of course, we could just omit locking entirely here, but that seemed
> a bit wild to me, and even if it would work in that specific case, it
> just serve as a bad example.

I would just comment the requirement that it can only be used during
probe, and remove all the locks.

	Andrew

      reply	other threads:[~2024-10-05 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 15:52 Daniel Golle
2024-10-04 21:25 ` Andrew Lunn
2024-10-04 22:02   ` Daniel Golle
2024-10-05 14:20     ` 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=32c342ef-62e8-4d85-8451-cfbb6024d869@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.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 \
    /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

all inboxes | Powered by JetHome®