[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SJ0PR18MB5216A8D227B2B3651DB9AC0DDB152@SJ0PR18MB5216.namprd18.prod.outlook.com>
Date: Fri, 3 Jan 2025 07:47:54 +0000
From: Suman Ghosh <sumang@...vell.com>
To: Francesco Valla <francesco@...la.it>, Andrew Lunn <andrew+netdev@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Russell King
<linux@...linux.org.uk>
Subject: RE: [EXTERNAL] [PATCH] net: phy: don't issue a module request if a
driver is available
>> > 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.
[Suman] Hmm got it. We can isolate the else part but that won't make much difference. Thank you!!
>
Powered by blists - more mailing lists