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 9FDC9C4727C for ; Thu, 1 Oct 2020 12:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 635AF2075F for ; Thu, 1 Oct 2020 12:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732109AbgJAM5E (ORCPT ); Thu, 1 Oct 2020 08:57:04 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:38078 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731952AbgJAM5C (ORCPT ); Thu, 1 Oct 2020 08:57:02 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kNy8p-00H4Aq-3L; Thu, 01 Oct 2020 14:56:59 +0200 Date: Thu, 1 Oct 2020 14:56:59 +0200 From: Andrew Lunn To: Igor Russkikh Cc: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Subject: Re: [EXT] Re: [PATCH net-next 3/3] net: atlantic: implement media detect feature via phy tunables Message-ID: <20201001125659.GA4067422@lunn.ch> References: <20200929161307.542-1-irusskikh@marvell.com> <20200929161307.542-4-irusskikh@marvell.com> <20200929171815.GD3996795@lunn.ch> <20200930142204.GK3996795@lunn.ch> <04e72671-aa3e-ac11-ef92-bb17fc633a60@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04e72671-aa3e-ac11-ef92-bb17fc633a60@marvell.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Oct 01, 2020 at 01:18:06PM +0300, Igor Russkikh wrote: > Hi Andrew, > > > Since this is your own PHY, not some magical black box, i assume you > > actually know what value it is using? It probably even lists it in the > > data sheet. > > > > So just hard code that value in the driver. That has got to be better > > than saying the incorrect value of 1ms. > > You mean always return that value in get_, and ignore what we get in set_ ? > That could be done, will investigate. You should validate the set as well. Only two values are valid, 0 to turn the feature off, and whatever the firmware is hard coded with. This is where extack would be very useful. When the user initially tries to set it to 42, you can return -EINVAL, plus a message listing the acceptable values. The best you can do at the moment is write the text to the kernel log. Andrew