From: Florian Fainelli <f.fainelli@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org
Cc: "Doug Berger" <opendmb@gmail.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Marek Behún" <kabel@kernel.org>,
"Peter Geis" <pgwipeout@gmail.com>,
Frank <Frank.Sae@motor-comm.com>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2 2/3] net: phy: broadcom: Add support for Wake-on-LAN
Date: Thu, 11 May 2023 09:17:19 -0700 [thread overview]
Message-ID: <e459ad06-e261-91a0-1c42-d9135b9ca6b5@gmail.com> (raw)
In-Reply-To: <8aebd38cf057cf659d5133527f55e1ced0e6f70c.camel@redhat.com>
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
next prev parent reply other threads:[~2023-05-11 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 22:34 [PATCH net-next v2 0/3] Support for Wake-on-LAN for Broadcom Florian Fainelli
2023-05-09 22:34 ` [PATCH net-next v2 1/3] net: phy: Allow drivers to always call into ->suspend() Florian Fainelli
2023-05-11 10:10 ` Simon Horman
2023-05-11 12:08 ` Andrew Lunn
2023-05-09 22:34 ` [PATCH net-next v2 2/3] net: phy: broadcom: Add support for Wake-on-LAN Florian Fainelli
2023-05-11 10:10 ` Simon Horman
2023-05-11 10:26 ` Paolo Abeni
2023-05-11 16:17 ` Florian Fainelli [this message]
2023-05-09 22:34 ` [PATCH net-next v2 3/3] net: bcmgenet: Add support for PHY-based Wake-on-LAN Florian Fainelli
2023-05-11 10:10 ` Simon Horman
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=e459ad06-e261-91a0-1c42-d9135b9ca6b5@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Frank.Sae@motor-comm.com \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=pgwipeout@gmail.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).