From: Florian Fainelli <f.fainelli@gmail.com>
To: RaghuramChary.Jallipalli@microchip.com, andrew@lunn.ch
Cc: davem@davemloft.net, netdev@vger.kernel.org,
UNGLinuxDriver@microchip.com, Woojung.Huh@microchip.com
Subject: Re: [PATCH net-next] lan78xx: Lan7801 Support for Fixed PHY
Date: Wed, 25 Apr 2018 10:36:26 -0700 [thread overview]
Message-ID: <7b563a2e-fff5-0d4b-aea2-3d98dda3c192@gmail.com> (raw)
In-Reply-To: <0573C9D4B793EF43BF95221F2F4CC85153E14C@CHN-SV-EXMX06.mchp-main.com>
On 04/25/2018 10:04 AM, RaghuramChary.Jallipalli@microchip.com wrote:
> Hi Andrew,
>>>>
>>> dev->fixedphy stores the fixed phydev, which will be passed to the
>>> fixed_phy_unregister routine , so I think phy_is_pseudo_fixed_link check
>> is not necessary.
>>
>> I'm saying you can get rid of dev->fixedphy, and just use
>> netdev->phydev, and phy_is_pseudo_fixed_link(netdev->phydev)
>>
> After phy_disconnect() , the netdev->phydev becomes null, but the phydev->mdio instances
> are still valid. So I'm saving the phydev ptr and passing to unregister the fixed phy.
> If I try to unregister first and disconnect, I see panic at sysfs remove link.
> I believe having dev->fixedphy should not cause any problem.
It still is completely unnecessary, you can do something like the following:
struct phy_device *phydev = netdev->phydev;
phy_disconnect(phydev);
if (phy_is_pseudo_fixed_link(phydev))
fixed_phy_unregister(phydev);
while netdev->phydev becomes NULL after phy_disconnect(), you retained a
reference to the original PHY device before disconnecting, in order to
unregister it. Can you see if that works?
--
Florian
next prev parent reply other threads:[~2018-04-25 17:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 4:46 [PATCH net-next] lan78xx: Lan7801 Support for Fixed PHY Raghuram Chary J
2018-04-23 12:42 ` Andrew Lunn
2018-04-25 5:21 ` RaghuramChary.Jallipalli
2018-04-25 12:39 ` Andrew Lunn
2018-04-25 17:04 ` RaghuramChary.Jallipalli
2018-04-25 17:36 ` Florian Fainelli [this message]
2018-04-25 19:05 ` RaghuramChary.Jallipalli
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=7b563a2e-fff5-0d4b-aea2-3d98dda3c192@gmail.com \
--to=f.fainelli@gmail.com \
--cc=RaghuramChary.Jallipalli@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--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 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).