Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbdINUMg (ORCPT ); Thu, 14 Sep 2017 16:12:36 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34358 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbdINUMd (ORCPT ); Thu, 14 Sep 2017 16:12:33 -0400 X-Google-Smtp-Source: AOwi7QAb+z7sUruBUiKd+qAbcmFWWZ8dZdNxE+nyFnUUMh2aYVnQYwhR8duHFHrzJ84fF5Ms76U+g20+FxFh7gCgu+A= MIME-Version: 1.0 In-Reply-To: References: <20170828191748.19492-1-vivien.didelot@savoirfairelinux.com> <20170828191748.19492-2-vivien.didelot@savoirfairelinux.com> <20170907193434.GA11006@kroah.com> <87h8wdb8bj.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> From: Alexander Duyck Date: Thu, 14 Sep 2017 13:12:31 -0700 Message-ID: Subject: Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface To: Maxim Uvarov Cc: Vivien Didelot , Greg KH , netdev , "linux-kernel@vger.kernel.org" , kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Egil Hjelmeland , John Crispin , Woojung Huh , Sean Wang , Nikita Yushchenko , Chris Healy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 23 On Thu, Sep 14, 2017 at 12:59 PM, Maxim Uvarov wrote: > debugfs here is very very useful to read registers directly and > compare what use space tools see. Cool feature to get regs by port and > use standard tools to diff and print them. Even might be better to > allow drivers to decode register names and bits values. Once that is > done driver mainaince will be much easy. I.e. you need only match regs > with spec from one side and regs with user space tools from other > side. Of course it's needed only for debuging, not for production. But > even for production regs dump on something wrong might tell a lot. > > Maxim. Can you clarify what type of registers it is you are wanting to read? We already have ethtool which is meant to allow reading the device registers for a given netdev. As long as the port has a netdev associated it then there is no need to be getting into debugfs since we should probably just be using ethtool. Also as Jiri pointed out there is already devlink which would probably be a better way to get the associated information for those pieces that don't have a netdev associated with them. - Alex