Subject: Re: [PATCH 1/3] net: phylib: add adjust_state callback to phy device

From: Daniel Mack <[email-masked]>
Date: Thu, 05 Jun 2014 09:14:30 +0200

Hi Florian,

On 06/05/2014 07:11 AM, Florian Fainelli wrote:
> 2014-06-04 2:00 GMT-07:00 Daniel Mack <[email-masked]>:
>> Allow phy drivers to take action when the core does its link adjustment.
>> No change for drivers that do not implement this callback.
> 
> This sounds potentially dangerous if misused, PHY drivers would
> basically be allowed to do arbitrary link state changes based on their
> custom needs.

Yes, and this is basically what my quirk handler does. It takes action
when the link goes down (PHY_NOLINK), as we unfortunately need to reset
the chip every time this happens.

> I really need to review your workaround here to better
> understand whether we can come up with a solution that allows for less
> liberty in PHY drivers.

Sure, any other way of calling back to the PHY when the core enters the
PHY_NOLINK state would do. I just thought that an adjust_state callback
is most versatile, but I understand that it could be misused.

Thanks for having a look!

Daniel