lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Apr 2018 10:36:26 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     RaghuramChary.Jallipalli@...rochip.com, andrew@...n.ch
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        UNGLinuxDriver@...rochip.com, Woojung.Huh@...rochip.com
Subject: Re: [PATCH net-next] lan78xx: Lan7801 Support for Fixed PHY

On 04/25/2018 10:04 AM, RaghuramChary.Jallipalli@...rochip.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ