All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <jose.abreu@synopsys.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	Jose Abreu <jose.abreu@synopsys.com>, <netdev@vger.kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Joao Pinto <joao.pinto@synopsys.com>
Subject: Re: [PATCH net-next 1/4] net: phy: Use C45 Helpers when forcing PHY
Date: Tue, 23 Oct 2018 11:20:26 +0100	[thread overview]
Message-ID: <62064558-d1dd-a1cb-8697-2b7e8206ce3b@synopsys.com> (raw)
In-Reply-To: <8e1a35a5-de85-e7b3-c9f3-524b3313feaa@gmail.com>

On 22-10-2018 18:11, Florian Fainelli wrote:
> On 10/22/18 3:32 AM, Jose Abreu wrote:
>> If PHY is in force state and we have a C45 phy we need to use the
>> standard C45 helpers and not the C22 ones.
>>
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Joao Pinto <joao.pinto@synopsys.com>
>> ---
>>  drivers/net/phy/phy.c | 2 +-
>>  include/linux/phy.h   | 8 ++++++++
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>> index 1d73ac3309ce..0ff4946e208e 100644
>> --- a/drivers/net/phy/phy.c
>> +++ b/drivers/net/phy/phy.c
>> @@ -995,7 +995,7 @@ void phy_state_machine(struct work_struct *work)
>>  		}
>>  		break;
>>  	case PHY_FORCING:
>> -		err = genphy_update_link(phydev);
>> +		err = phy_update_link(phydev);
>>  		if (err)
>>  			break;
>>  
>> diff --git a/include/linux/phy.h b/include/linux/phy.h
>> index 3ea87f774a76..02c2ee8bc05b 100644
>> --- a/include/linux/phy.h
>> +++ b/include/linux/phy.h
>> @@ -1044,6 +1044,14 @@ static inline int phy_read_status(struct phy_device *phydev)
>>  		return genphy_read_status(phydev);
>>  }
>>  
>> +static inline int phy_update_link(struct phy_device *phydev)
>> +{
>> +	if (phydev->is_c45)
>> +		return gen10g_read_status(phydev);
> Should not this be genphy_c45_read_link() for symmetry with
> genphy_update_link() which only updates phydev->link?

Hmmm, genphy_c45_read_link() does not update phydev->link ... I
can create a new gen10g_update_link() that wraps around
genphy_c45_read_link() and updates link ...

Thanks and Best Regards,
Jose Miguel Abreu

  reply	other threads:[~2018-10-23 18:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 10:32 [PATCH net-next 0/4] net: phy: Misc improvements for Generic 10G PHY Jose Abreu
2018-10-22 10:32 ` [PATCH net-next 1/4] net: phy: Use C45 Helpers when forcing PHY Jose Abreu
2018-10-22 17:11   ` Florian Fainelli
2018-10-23 10:20     ` Jose Abreu [this message]
2018-10-22 10:32 ` [PATCH net-next 2/4] net: phy-c45: Populate autoneg_done callback Jose Abreu
2018-10-22 12:21   ` Andrew Lunn
2018-10-22 10:32 ` [PATCH net-next 3/4] net: phy-c45: Implement reset/suspend/resume callbacks Jose Abreu
2018-10-22 12:28   ` Andrew Lunn
2018-10-22 12:47     ` Jose Abreu
2018-10-22 15:48       ` Russell King - ARM Linux
2018-10-22 17:13         ` Florian Fainelli
2018-10-23 10:17           ` Jose Abreu
2018-10-23 10:20             ` Russell King - ARM Linux
2018-10-23 10:28               ` Jose Abreu
2018-10-23 10:58                 ` Russell King - ARM Linux
2018-10-24  7:50                   ` Jose Abreu
2018-10-24 12:03                     ` Andrew Lunn
2018-10-23 12:38                 ` Andrew Lunn
2018-10-22 10:32 ` [PATCH net-next 4/4] net: phy-c45: Populate missing features Jose Abreu

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=62064558-d1dd-a1cb-8697-2b7e8206ce3b@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=joao.pinto@synopsys.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.