mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philippe Reynes <tremyfr@gmail.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: fugang.duan@nxp.com, davem@davemloft.net, kan.liang@intel.com,
	decot@googlers.com, aduyck@mirantis.com, jiri@mellanox.com,
	jacob.e.keller@intel.com, tom@herbertland.com, andrew@lunn.ch,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] net: ethernet: fec: use phydev from struct net_device
Date: Mon, 09 May 2016 00:47:38 +0200	[thread overview]
Message-ID: <572FC20A.5030805@gmail.com> (raw)
In-Reply-To: <1462746137.2634.67.camel@decadent.org.uk>

On 09/05/16 00:22, Ben Hutchings wrote:
> On Sun, 2016-05-08 at 23:44 +0200, Philippe Reynes wrote:
>> The private structure contain a pointer to phydev, but the structure
>> net_device already contain such pointer. So we can remove the pointer
>> phydev in the private structure, and update the driver to use the one
>> contained in struct net_device.
>
> But there is no central code that updates the pointer, so:

The function phy_attach_direct and phy_detach update the pointer
phydev in the struct net_device.

>
> [...]
>> @@ -1928,7 +1926,6 @@ static int fec_enet_mii_probe(struct net_device *ndev)
>>
>>   	phy_dev->advertising = phy_dev->supported;
>>
>> -	fep->phy_dev = phy_dev;
>
> you need to assign ndev->phydev here

The function fec_enet_mii_probe call of_phy_connect,
which call phy_connect_direct, which call phy_attach_direct.
This last function update the pointer phydev of struct net_device.

> [...]
>> @@ -2875,8 +2869,7 @@ fec_enet_close(struct net_device *ndev)
>>   		fec_stop(ndev);
>>   	}
>>
>> -	phy_disconnect(fep->phy_dev);
>> -	fep->phy_dev = NULL;
>> +	phy_disconnect(ndev->phydev);
> [...]
>
> and you need to set it to NULL here.

The function fec_enet_close call phy_disconnect, which call phy_detach.
This last function set the pointer phydev in the struct net_device to NULL.


So from my understanding, those two lines aren't usefull.
May you confirm that I'm on the right way please ?

  
> Ben.
>

Philippe

  reply	other threads:[~2016-05-08 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08 21:44 [PATCH v2 0/3] net: ethtool: add ethtool_op_{get|set}_link_ksettings Philippe Reynes
2016-05-08 21:44 ` [PATCH v2 1/3] net: core: " Philippe Reynes
2016-05-09 16:44   ` David Decotigny
2016-05-08 21:44 ` [PATCH v2 2/3] net: ethernet: fec: use phydev from struct net_device Philippe Reynes
2016-05-08 22:22   ` Ben Hutchings
2016-05-08 22:47     ` Philippe Reynes [this message]
2016-05-08 23:01       ` Ben Hutchings
2016-05-08 21:44 ` [PATCH v2 3/3] net: ethernet: fec: use ethtool_op_{get|set}_link_ksettings Philippe Reynes
2016-05-09  1:57 ` [PATCH v2 0/3] net: ethtool: add ethtool_op_{get|set}_link_ksettings Fugang Duan

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=572FC20A.5030805@gmail.com \
    --to=tremyfr@gmail.com \
    --cc=aduyck@mirantis.com \
    --cc=andrew@lunn.ch \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=decot@googlers.com \
    --cc=fugang.duan@nxp.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@mellanox.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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

Powered by JetHome