Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1732544

Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface

From Maxim Uvarov <muvarov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface
Date 2017-09-14 22:00 +0200
Message-ID <upIsN-QU-1@gated-at.bofh.it> (permalink)
References <ujxTr-16C-5@gated-at.bofh.it> <ujxTt-16C-45@gated-at.bofh.it> <unjRU-2lN-5@gated-at.bofh.it> <uns8N-87v-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

2017-09-08 16:58 GMT+03:00 Vivien Didelot <vivien.didelot@savoirfairelinux.com>:
> Hi Greg,
>
> Greg KH <gregkh@linuxfoundation.org> writes:
>
>> I agree you shouldn't be using debugfs for this, but in the future, if
>> you do write debugfs code, please take the following review into
>> account:
>
> Humm sorry I may not have given enough details. This was really meant
> for debug and dev only, because DSA makes it hard to query directly the
> hardware (some switch ports are not exposed to userspace as well.)
>
> This is not meant to be used for anything real at all, or even be
> compiled-in in a production kernel. That's why I found it appropriate.
>
> So I am still wondering why it doesn't fit here, can you tell me why?
>
>> You should _never_ care about the return value of a debugfs call, and
>> you should not need to ever propagate the error upward.  The api was
>> written to not need this.
>>
>> Just call the function, and return, that's it.  If you need to save the
>> return value (i.e. it's a dentry), you also don't care, just save it and
>> pass it to some other debugfs call, and all will still be fine.  Your
>> code should never do anything different if a debugfs call succeeds or
>> fails.
>
> Thank for your interesting review! I'll cleanup my out-of-tree patches.
>
>
>       Vivien



-- 
Best regards,
Maxim Uvarov

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface Maxim Uvarov <muvarov@gmail.com> - 2017-09-14 22:00 +0200
  Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface Alexander Duyck <alexander.duyck@gmail.com> - 2017-09-14 22:20 +0200
    Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface Andrew Lunn <andrew@lunn.ch> - 2017-09-14 23:10 +0200
      Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface Jiri Pirko <jiri@resnulli.us> - 2017-09-15 08:00 +0200
        Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface Egil Hjelmeland <privat@egil-hjelmeland.no> - 2017-09-15 10:10 +0200

csiph-web