From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752244AbbDCT0g (ORCPT ); Fri, 3 Apr 2015 15:26:36 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:32966 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbbDCT0f (ORCPT ); Fri, 3 Apr 2015 15:26:35 -0400 Message-ID: <551EE936.4010700@gmail.com> Date: Fri, 03 Apr 2015 12:25:42 -0700 From: Florian Fainelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Stas Sergeev , netdev@vger.kernel.org CC: Linux kernel , Stas Sergeev Subject: Re: [PATCH 1/2] add fixed_phy_update_state() - update state of fixed_phy References: <551C2AB9.8020508@list.ru> <551C2B37.6000100@list.ru> In-Reply-To: <551C2B37.6000100@list.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/15 10:30, Stas Sergeev wrote: > > Currently fixed_phy uses a callback to periodically poll the link state. > This patch adds the fixed_phy_update_state() API. > It solves the following problems: > - On link state interrupt, MAC driver can't update status. > Instead it needs to provide the callback to periodically query > the HW about the link state. It is more efficient to update status > after interrupt. > - The callback needs to be unregistered before phy_disconnect(), > or otherwise it will be called with net_dev==NULL. phy_disconnect() > does not have enough info to unregister the callback automatically. > - The callback needs to be registered before of_phy_connect() to > avoid running with outdated state, but of_phy_connect() returns the > phy_device pointer, which is needed to register the callback. Registering > it before of_phy_connect() will therefore require a hack to get the > pointer earlier. > > Overall, this addition makes the subsequent patch that implements > SGMII link status for mvneta, much cleaner. Agreed, now that we have that, we should probably just remove the ability to have a fixed link update callback since it suffers from all the deficiencies you outlined above, and is creating some overhead by polling the hardware. Thanks! -- Florian