[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e459ad06-e261-91a0-1c42-d9135b9ca6b5@gmail.com>
Date: Thu, 11 May 2023 09:17:19 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Paolo Abeni <pabeni@...hat.com>, Florian Fainelli <f.fainelli@...il.com>,
netdev@...r.kernel.org
Cc: Doug Berger <opendmb@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>, Russell King
<linux@...linux.org.uk>, Marek BehĂșn <kabel@...nel.org>,
Peter Geis <pgwipeout@...il.com>, Frank <Frank.Sae@...or-comm.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v2 2/3] net: phy: broadcom: Add support for
Wake-on-LAN
On 5/11/23 03:26, Paolo Abeni wrote:
> Hi,
>
> On Tue, 2023-05-09 at 15:34 -0700, Florian Fainelli wrote:
>> @@ -821,7 +917,28 @@ static int bcm54xx_phy_probe(struct phy_device *phydev)
>> if (IS_ERR(priv->ptp))
>> return PTR_ERR(priv->ptp);
>>
>> - return 0;
>> + /* We cannot utilize the _optional variant here since we want to know
>> + * whether the GPIO descriptor exists or not to advertise Wake-on-LAN
>> + * support or not.
>> + */
>> + wakeup_gpio = devm_gpiod_get(&phydev->mdio.dev, "wakeup", GPIOD_IN);
>> + if (PTR_ERR(wakeup_gpio) == -EPROBE_DEFER)
>> + return PTR_ERR(wakeup_gpio);
>> +
>> + if (!IS_ERR(wakeup_gpio)) {
>> + priv->wake_irq = gpiod_to_irq(wakeup_gpio);
>> + ret = irq_set_irq_type(priv->wake_irq, IRQ_TYPE_LEVEL_LOW);
>> + if (ret)
>> + return ret;
>> + }
>> +
>> + /* If we do not have a main interrupt or a side-band wake-up interrupt,
>> + * then the device cannot be marked as wake-up capable.
>> + */
>> + if (!bcm54xx_phy_can_wakeup(phydev))
>> + return ret;
>
> AFAICS, as this point 'ret' is 0, so the above is confusing. Do you
> intend the probe to complete successfully? If so, would not be
> better/more clear:
>
> return 0;
Yes probe needs to be successful if bcm54xx_phy_can_wakeup() returns
false, will change to return 0 to make that clearer. Thanks!
--
Florian
Powered by blists - more mailing lists