From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Francesco Valla <francesco@valla.it>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: phy: don't issue a module request if a driver is available
Date: Thu, 2 Jan 2025 11:06:15 +0000 [thread overview]
Message-ID: <Z3ZzJ3aUN5zrtqcx@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250101235122.704012-1-francesco@valla.it>
On Thu, Jan 02, 2025 at 12:51:22AM +0100, Francesco Valla wrote:
> Whenever a new PHY device is created, request_module() is called
> unconditionally, without checking if a driver for the new PHY is already
> available (either built-in or from a previous probe). This conflicts
> with async probing of the underlying MDIO bus and always throws a
> warning (because if a driver is loaded it _might_ cause a deadlock, if
> in turn it calls async_synchronize_full()).
Why aren't any of the phylib maintainers seeing this warning? Where does
the warning come from?
> +static bool phy_driver_exists(u32 phy_id)
> +{
> + bool found = false;
> + struct phy_drv_node *node;
> +
> + down_read(&phy_drv_list_sem);
> + list_for_each_entry(node, &phy_drv_list, list) {
> + if (phy_id_compare(phy_id, node->drv->phy_id, node->drv->phy_id_mask)) {
> + found = true;
> + break;
> + }
> + }
> + up_read(&phy_drv_list_sem);
> +
> + return found;
> +}
> +
Why do we need this, along with the associated additional memory
allocations? What's wrong with bus_for_each_drv() which the core
code provides?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-01-02 11:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-01 23:51 [PATCH] net: phy: don't issue a module request if a driver is available Francesco Valla
2025-01-02 9:35 ` [EXTERNAL] " Suman Ghosh
2025-01-02 10:21 ` Francesco Valla
2025-01-03 7:47 ` Suman Ghosh
2025-01-02 11:06 ` Russell King (Oracle) [this message]
2025-01-02 13:26 ` Francesco Valla
2025-01-02 13:52 ` Andrew Lunn
2025-01-02 14:01 ` Francesco Valla
2025-01-02 14:21 ` Andrew Lunn
2025-01-03 18:00 ` Francesco Valla
2025-01-03 11:25 ` Niklas Cassel
2025-01-03 12:08 ` Russell King (Oracle)
2025-01-03 12:49 ` Niklas Cassel
2025-01-03 14:03 ` Russell King (Oracle)
2025-01-03 14:12 ` Andrew Lunn
2025-01-03 14:34 ` Niklas Cassel
2025-01-03 15:37 ` Andrew Lunn
2025-01-03 17:57 ` Francesco Valla
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=Z3ZzJ3aUN5zrtqcx@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew+netdev@lunn.ch \
--cc=francesco@valla.it \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.