netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Valla <francesco@valla.it>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Suman Ghosh <sumang@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [EXTERNAL] [PATCH] net: phy: don't issue a module request if a driver is available
Date: Thu, 02 Jan 2025 11:21:36 +0100	[thread overview]
Message-ID: <4771715.vXUDI8C0e8@fedora.fritz.box> (raw)
In-Reply-To: <SJ0PR18MB5216590A9FD664CF63993E95DB142@SJ0PR18MB5216.namprd18.prod.outlook.com>

Hi Suman,

On Thursday, 2 January 2025 at 10:35:40 Suman Ghosh <sumang@marvell.com> wrote:
> > 	mutex_init(&dev->lock);
> > 	INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
> >
> >-	/* Request the appropriate module unconditionally; don't
> >-	 * bother trying to do so only if it isn't already loaded,
> >-	 * because that gets complicated. A hotplug event would have
> >-	 * done an unconditional modprobe anyway.
> >-	 * We don't do normal hotplug because it won't work for MDIO
> >+	/* We don't do normal hotplug because it won't work for MDIO
> > 	 * -- because it relies on the device staying around for long
> > 	 * enough for the driver to get loaded. With MDIO, the NIC
> > 	 * driver will get bored and give up as soon as it finds that @@ -
> >724,7 +745,8 @@ struct phy_device *phy_device_create(struct mii_bus
> >*bus, int addr, u32 phy_id,
> > 		int i;
> >
> > 		for (i = 1; i < num_ids; i++) {
> >-			if (c45_ids->device_ids[i] == 0xffffffff)
> >+			if (c45_ids->device_ids[i] == 0xffffffff ||
> >+			    phy_driver_exists(c45_ids->device_ids[i]))
> > 				continue;
> >
> > 			ret = phy_request_driver_module(dev, @@ -732,7 +754,7 @@
> >struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32
> >phy_id,
> > 			if (ret)
> > 				break;
> > 		}
> >-	} else {
> >+	} else if (!phy_driver_exists(phy_id)) {
> [Suman] Can we add this phy_driver_exists() API call before the if/else check?
> 

Not really, as in case of C45 PHYs we have to check for drivers using (multiple)
IDs, which are different from phy_id.

> > 		ret = phy_request_driver_module(dev, phy_id);
> > 	}
> >
> 


Thank you!

Regards,
Francesco





  reply	other threads:[~2025-01-02 10:21 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 [this message]
2025-01-03  7:47     ` Suman Ghosh
2025-01-02 11:06 ` Russell King (Oracle)
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=4771715.vXUDI8C0e8@fedora.fritz.box \
    --to=francesco@valla.it \
    --cc=andrew+netdev@lunn.ch \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=sumang@marvell.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).