From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 474A2C433E0 for ; Sun, 10 Jan 2021 16:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0811022AAE for ; Sun, 10 Jan 2021 16:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726303AbhAJQgK (ORCPT ); Sun, 10 Jan 2021 11:36:10 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:59850 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbhAJQgJ (ORCPT ); Sun, 10 Jan 2021 11:36:09 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kydgb-00HKtc-2H; Sun, 10 Jan 2021 17:35:25 +0100 Date: Sun, 10 Jan 2021 17:35:25 +0100 From: Andrew Lunn To: Russell King Cc: Richard Cochran , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: Re: [PATCH net-next] net: ethtool: allow MAC drivers to override ethtool get_ts_info Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Jan 10, 2021 at 11:13:44AM +0000, Russell King wrote: > Check whether the MAC driver has implemented the get_ts_info() > method first, and call it if present. If this method returns > -EOPNOTSUPP, defer to the phylib or default implementation. > > This allows network drivers such as mvpp2 to use their more accurate > timestamping implementation than using a less accurate implementation > in the PHY. Network drivers can opt to defer to phylib by returning > -EOPNOTSUPP. > > This change will be needed if the Marvell PHY drivers add support for > PTP. > > Note: this may cause a change for any drivers that use phylib and > provide get_ts_info(). It is not obvious if any such cases exist. Hi Russell We can detect that condition through? Call both, then do a WARN() if we are changing the order? Maybe we should do that for a couple of cycles? For netlink ethtool, we can also provide an additional attribute. A MAC, or PHY indicator we can do in the core. A string for the name of the driver would need a bigger change. Andrew